thousandeyes-sdk-python/usage_api/docs/QuotasApi.md
2023-12-11 09:29:15 +00:00

19 KiB
Raw Blame History

usage_api.QuotasApi

All URIs are relative to https://api.thousandeyes.com

Method HTTP request Description
assign_organizations_account_groups_quotas POST /v7/quotas/account-groups/assign Create or update accout group quotas
assign_organizations_quotas POST /v7/quotas/assign Create or update organizations quotas
get_quotas GET /v7/quotas Get organization and account group usage quota
unassign_organizations_account_groups_quotas POST /v7/quotas/account-groups/unassign Remove account group quotas from organizations
unassign_organizations_quotas POST /v7/quotas/unassign Remove organization quotas

assign_organizations_account_groups_quotas

OrganizationsQuotasAssign assign_organizations_account_groups_quotas(aid=aid, organizations_quotas_assign=organizations_quotas_assign)

Create or update accout group quotas

Assigns quota values to multiple account groups from multiple organizations. Edit organization and account group quotas permission (a management permission) is required. This endpoint has cumulative behavior: The quotas are assigned to the specified account groups, and the previous assignments persist. No unassignment takes place. This endpoint assigns quota values to multiple account groups across multiple organizations. To use this endpoint, you need the Edit organization and account group quotas permission, which is a management-level permission. This endpoint follows a cumulative behaviorThis means that the quotas are assigned to the designated account groups, and any previous assignments remain in place without any unassignment occurring.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import usage_api
from usage_api.models.organizations_quotas_assign import OrganizationsQuotasAssign
from usage_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = usage_api.Configuration(
    host = "https://api.thousandeyes.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: BearerAuth
configuration = usage_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with usage_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = usage_api.QuotasApi(api_client)
    aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
    organizations_quotas_assign = usage_api.OrganizationsQuotasAssign() # OrganizationsQuotasAssign |  (optional)

    try:
        # Create or update accout group quotas
        api_response = api_instance.assign_organizations_account_groups_quotas(aid=aid, organizations_quotas_assign=organizations_quotas_assign)
        print("The response of QuotasApi->assign_organizations_account_groups_quotas:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling QuotasApi->assign_organizations_account_groups_quotas: %s\n" % e)

Parameters

Name Type Description Notes
aid str A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. [optional]
organizations_quotas_assign OrganizationsQuotasAssign [optional]

Return type

OrganizationsQuotasAssign

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/hal+json, application/problem+json

HTTP response details

Status code Description Response headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Insufficient permissions to query endpoint -
404 Not found -
429 Exhausted rate limit for the organization -
500 Internal server error -

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

assign_organizations_quotas

QuotasAssignResponse assign_organizations_quotas(aid=aid, quotas_assign_request=quotas_assign_request)

Create or update organizations quotas

This endpoint recieves a list of organization quotas to create or update. If there's no specific orgId defined for a quota, it defaults to using the authenticated organization. To use this endpoint, you need the Edit organization and account group quotas permission, which is a management-level permission. This endpoint follows cumulative behaviorThis means that the quotas are assigned to the specified organizations, and any previous assignments remain unchanged; no unassignments occur.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import usage_api
from usage_api.models.quotas_assign_request import QuotasAssignRequest
from usage_api.models.quotas_assign_response import QuotasAssignResponse
from usage_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = usage_api.Configuration(
    host = "https://api.thousandeyes.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: BearerAuth
configuration = usage_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with usage_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = usage_api.QuotasApi(api_client)
    aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
    quotas_assign_request = usage_api.QuotasAssignRequest() # QuotasAssignRequest |  (optional)

    try:
        # Create or update organizations quotas
        api_response = api_instance.assign_organizations_quotas(aid=aid, quotas_assign_request=quotas_assign_request)
        print("The response of QuotasApi->assign_organizations_quotas:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling QuotasApi->assign_organizations_quotas: %s\n" % e)

Parameters

Name Type Description Notes
aid str A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. [optional]
quotas_assign_request QuotasAssignRequest [optional]

Return type

QuotasAssignResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/hal+json, application/problem+json

HTTP response details

Status code Description Response headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Insufficient permissions to query endpoint -
404 Not found -
429 Exhausted rate limit for the organization -
500 Internal server error -

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

get_quotas

GetQuotas200Response get_quotas()

Get organization and account group usage quota

This endpoint retrieves usage quotas for both organization and account groups. To use this endpoint, you need the Edit organization and account group quotas permission, which is a management-level permission. If a user has quota update permission in multiple organizations, the API returns data from all such organizations.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import usage_api
from usage_api.models.get_quotas200_response import GetQuotas200Response
from usage_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = usage_api.Configuration(
    host = "https://api.thousandeyes.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: BearerAuth
configuration = usage_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with usage_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = usage_api.QuotasApi(api_client)

    try:
        # Get organization and account group usage quota
        api_response = api_instance.get_quotas()
        print("The response of QuotasApi->get_quotas:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling QuotasApi->get_quotas: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

GetQuotas200Response

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/hal+json, application/problem+json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Insufficient permissions to query endpoint -
404 Not found -
429 Exhausted rate limit for the organization -
500 Internal server error -

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

unassign_organizations_account_groups_quotas

unassign_organizations_account_groups_quotas(aid=aid, organizations_quotas_unassign=organizations_quotas_unassign)

Remove account group quotas from organizations

Removes the quotas from multiple account groups from multiple organizations. Edit organization and account group quotas permission (a management permission) is required. Removes quotas from multiple account groups across multiple organizations. To use this endpoint, you need the Edit organization and account group quotas permission, which is a management-level permission.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import usage_api
from usage_api.models.organizations_quotas_unassign import OrganizationsQuotasUnassign
from usage_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = usage_api.Configuration(
    host = "https://api.thousandeyes.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: BearerAuth
configuration = usage_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with usage_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = usage_api.QuotasApi(api_client)
    aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
    organizations_quotas_unassign = usage_api.OrganizationsQuotasUnassign() # OrganizationsQuotasUnassign |  (optional)

    try:
        # Remove account group quotas from organizations
        api_instance.unassign_organizations_account_groups_quotas(aid=aid, organizations_quotas_unassign=organizations_quotas_unassign)
    except Exception as e:
        print("Exception when calling QuotasApi->unassign_organizations_account_groups_quotas: %s\n" % e)

Parameters

Name Type Description Notes
aid str A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. [optional]
organizations_quotas_unassign OrganizationsQuotasUnassign [optional]

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
204 No content -
400 Bad Request -
401 Unauthorized -
403 Insufficient permissions to query endpoint -
404 Not found -
429 Exhausted rate limit for the organization -
500 Internal server error -

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

unassign_organizations_quotas

unassign_organizations_quotas(aid=aid, quotas_unassign=quotas_unassign)

Remove organization quotas

This endpoint recieves a list of organization IDs to remove their current quota. To use this endpoint, you need the Edit organization and account group quotas permission, which is a management-level permission.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import usage_api
from usage_api.models.quotas_unassign import QuotasUnassign
from usage_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = usage_api.Configuration(
    host = "https://api.thousandeyes.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: BearerAuth
configuration = usage_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with usage_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = usage_api.QuotasApi(api_client)
    aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
    quotas_unassign = usage_api.QuotasUnassign() # QuotasUnassign |  (optional)

    try:
        # Remove organization quotas
        api_instance.unassign_organizations_quotas(aid=aid, quotas_unassign=quotas_unassign)
    except Exception as e:
        print("Exception when calling QuotasApi->unassign_organizations_quotas: %s\n" % e)

Parameters

Name Type Description Notes
aid str A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. [optional]
quotas_unassign QuotasUnassign [optional]

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
204 No content -
400 Bad Request -
401 Unauthorized -
403 Insufficient permissions to query endpoint -
404 Not found -
429 Exhausted rate limit for the organization -
500 Internal server error -

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