mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2026-08-04 00:46:52 +00:00
Sync OAS-driven integration test artifacts (mock manifest, test base, conftest, and per-operation integration tests) across 21 packages for CP-2453 full rollout evaluation. Co-authored-by: Cursor <cursoragent@cursor.com>
1184 lines
38 KiB
Python
1184 lines
38 KiB
Python
# coding: utf-8
|
|
|
|
"""
|
|
Usage API
|
|
|
|
These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View organization usage` permission to access this endpoint. * This operation offers visibility across all account groups within the organization. * Users with `View organization usage` permission in multiple organizations should query the operation with the `aid` query string parameter (see optional parameters) for each organization. * The `agentId` field in enterprise agent unit responses may be omitted when not available. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the Usage API operations for detailed usage instructions and optional parameters.
|
|
|
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
|
|
Do not edit the class manually.
|
|
""" # noqa: E501
|
|
|
|
|
|
import json
|
|
|
|
from sdk_test_support.mock_server_types import ErrorResponseExpectation, OperationExpectation
|
|
|
|
OPERATION_MANIFEST = {
|
|
|
|
"assign_organizations_account_groups_quotas": OperationExpectation(
|
|
operation_id="assign_organizations_account_groups_quotas",
|
|
method="POST",
|
|
path="/quotas/account-groups/assign",
|
|
path_param_examples={
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"organizations" : [ {
|
|
"orgId" : "1234",
|
|
"accountGroups" : [ {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
}, {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
} ]
|
|
}, {
|
|
"orgId" : "1234",
|
|
"accountGroups" : [ {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
}, {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
} ]
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"organizations" : [ {
|
|
"orgId" : "1234",
|
|
"accountGroups" : [ {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
}, {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
} ]
|
|
}, {
|
|
"orgId" : "1234",
|
|
"accountGroups" : [ {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
}, {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
} ]
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"assign_organizations_quotas": OperationExpectation(
|
|
operation_id="assign_organizations_quotas",
|
|
method="POST",
|
|
path="/quotas/assign",
|
|
path_param_examples={
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"organizations" : [ {
|
|
"orgId" : "1234",
|
|
"value" : 12000
|
|
}, {
|
|
"orgId" : "12345",
|
|
"value" : 10000
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"organizations" : [ {
|
|
"value" : 12000
|
|
}, {
|
|
"orgId" : "1234",
|
|
"value" : 10000
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"get_quotas": OperationExpectation(
|
|
operation_id="get_quotas",
|
|
method="GET",
|
|
path="/quotas",
|
|
path_param_examples={
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"quotas" : [ {
|
|
"accountGroupQuotas" : [ {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
}, {
|
|
"value" : 10000,
|
|
"aid" : "12345"
|
|
} ],
|
|
"organizationQuota" : {
|
|
"value" : 22500,
|
|
"orgId" : "10"
|
|
}
|
|
}, {
|
|
"accountGroupQuotas" : [ {
|
|
"value" : 12000,
|
|
"aid" : "1234"
|
|
}, {
|
|
"value" : 10000,
|
|
"aid" : "12345"
|
|
} ],
|
|
"organizationQuota" : {
|
|
"value" : 22500,
|
|
"orgId" : "10"
|
|
}
|
|
} ],
|
|
"_links" : {
|
|
"self" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
}
|
|
}
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=None,
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"unassign_organizations_account_groups_quotas": OperationExpectation(
|
|
operation_id="unassign_organizations_account_groups_quotas",
|
|
method="POST",
|
|
path="/quotas/account-groups/unassign",
|
|
path_param_examples={
|
|
},
|
|
success_status=204,
|
|
success_body=None,
|
|
success_content_type="application/json",
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"organizations" : [ {
|
|
"orgId" : "1234",
|
|
"accountGroups" : [ "1234", "12345" ]
|
|
}, {
|
|
"orgId" : "1234",
|
|
"accountGroups" : [ "1234", "12345" ]
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"unassign_organizations_quotas": OperationExpectation(
|
|
operation_id="unassign_organizations_quotas",
|
|
method="POST",
|
|
path="/quotas/unassign",
|
|
path_param_examples={
|
|
},
|
|
success_status=204,
|
|
success_body=None,
|
|
success_content_type="application/json",
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"organizations" : [ "1234", "12345" ]
|
|
}
|
|
|
|
"""),
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"get_enterprise_agents_units_usage": OperationExpectation(
|
|
operation_id="get_enterprise_agents_units_usage",
|
|
method="GET",
|
|
path="/usage/units/enterprise-agents",
|
|
path_param_examples={
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"_links" : {
|
|
"next" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
},
|
|
"previous" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
},
|
|
"self" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
}
|
|
},
|
|
"breakdowns" : [ {
|
|
"aid" : "1234",
|
|
"agentId" : "123456",
|
|
"accountGroupName" : "Support",
|
|
"agentName" : "TEVA-test-agent",
|
|
"enterpriseUnitsUsed" : 599878,
|
|
"enterpriseUnitsProjected" : 597808
|
|
}, {
|
|
"aid" : "315",
|
|
"agentId" : "789",
|
|
"accountGroupName" : "Documentation",
|
|
"agentName" : "lab-physical-appliance-1",
|
|
"enterpriseUnitsUsed" : 597123,
|
|
"enterpriseUnitsProjected" : 597808
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=None,
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"get_tests_units_usage": OperationExpectation(
|
|
operation_id="get_tests_units_usage",
|
|
method="GET",
|
|
path="/usage/units/tests",
|
|
path_param_examples={
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"_links" : {
|
|
"next" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
},
|
|
"previous" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
},
|
|
"self" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
}
|
|
},
|
|
"breakdowns" : [ {
|
|
"testId" : "1158",
|
|
"testName" : "https://app.thousandeyes.com",
|
|
"testType" : "Web-Page Load",
|
|
"enterpriseUnitsUsed" : 14050,
|
|
"enterpriseUnitsProjected" : 340674,
|
|
"cloudUnitsUsed" : 10000,
|
|
"cloudUnitsProjected" : 12000,
|
|
"aid" : "1234",
|
|
"accountGroupName" : "Support"
|
|
}, {
|
|
"testId" : "1221",
|
|
"testName" : "https://app.thousandeyes.com",
|
|
"testType" : "Web - HTTP Server",
|
|
"enterpriseUnitsUsed" : 194051,
|
|
"enterpriseUnitsProjected" : 30622,
|
|
"cloudUnitsUsed" : 12000,
|
|
"cloudUnitsProjected" : 13000,
|
|
"aid" : "1234",
|
|
"accountGroupName" : "Support"
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=None,
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"get_usage": OperationExpectation(
|
|
operation_id="get_usage",
|
|
method="GET",
|
|
path="/usage",
|
|
path_param_examples={
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"_links" : {
|
|
"self" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
}
|
|
},
|
|
"usage" : {
|
|
"cloudUnitsProjected" : 20993812,
|
|
"connectedDevicesUnitsUsed" : 79640902,
|
|
"enterpriseAgentsUsed" : 58,
|
|
"endpointAgents" : [ {
|
|
"aid" : "1234",
|
|
"accountGroupName" : "Support",
|
|
"endpointAgentsUsed" : 22
|
|
}, {
|
|
"aid" : "12345",
|
|
"accountGroupName" : "Documentation",
|
|
"endpointAgentsUsed" : 14
|
|
} ],
|
|
"cloudUnitsNextBillingPeriod" : 25123456,
|
|
"enterpriseUnitsNextBillingPeriod" : 0,
|
|
"endpointAgentsUsed" : 42,
|
|
"enterpriseUnitsUsed" : 79640902,
|
|
"cloudUnitsUsed" : 8500489,
|
|
"connectedDevicesUnitsNextBillingPeriod" : 0,
|
|
"connectedDevicesUnitsProjected" : 108016317,
|
|
"tests" : [ {
|
|
"aid" : "1234",
|
|
"testId" : "1158",
|
|
"accountGroupName" : "Documentation",
|
|
"testName" : "https://app.thousandeyes.com",
|
|
"testType" : "Web-Page Load",
|
|
"cloudUnitsUsed" : 14050,
|
|
"cloudUnitsProjected" : 340674
|
|
}, {
|
|
"aid" : "12345",
|
|
"testId" : "1159",
|
|
"accountGroupName" : "Documentation",
|
|
"testName" : "https://support.thousandeyes.com",
|
|
"testType" : "Web - HTTP Server",
|
|
"cloudUnitsUsed" : 64390,
|
|
"cloudUnitsProjected" : 164457
|
|
} ],
|
|
"endpointAgentsEmbedded" : [ {
|
|
"aid" : "1234",
|
|
"accountGroupName" : "Support",
|
|
"endpointAgentsEmbeddedUsed" : 2
|
|
}, {
|
|
"aid" : "12345",
|
|
"accountGroupName" : "Documentation",
|
|
"endpointAgentsEmbeddedUsed" : 3
|
|
} ],
|
|
"allocations" : {
|
|
"used" : 1000,
|
|
"projected" : 1000,
|
|
"allocations" : [ {
|
|
"productName" : "Some Product Name",
|
|
"allocatedUnits" : 600
|
|
} ]
|
|
},
|
|
"endpointAgentsEssentialsUsed" : 5,
|
|
"quota" : {
|
|
"monthEnd" : "2020-02-05T08:00:00Z",
|
|
"endpointAgentsEmbeddedIncluded" : 10,
|
|
"enterpriseAgentsIncluded" : 25,
|
|
"monthStart" : "2020-01-05T08:00:00Z",
|
|
"cloudUnitsIncluded" : 4320000000,
|
|
"deviceAgentsIncluded" : 100,
|
|
"endpointAgentsIncluded" : 200,
|
|
"endpointAgentsEssentialsIncluded" : 10
|
|
},
|
|
"enterpriseUnitsProjected" : 108016317,
|
|
"endpointAgentsEmbeddedUsed" : 5,
|
|
"enterpriseAgents" : [ {
|
|
"aid" : "1234",
|
|
"accountGroupName" : "Support",
|
|
"enterpriseAgentsUsed" : 7
|
|
}, {
|
|
"aid" : "12345",
|
|
"accountGroupName" : "Documentation",
|
|
"enterpriseAgentsUsed" : 1
|
|
} ],
|
|
"enterpriseAgentUnits" : [ {
|
|
"aid" : "1234",
|
|
"agentId" : "123456",
|
|
"accountGroupName" : "Support",
|
|
"agentName" : "TEVA-test-agent",
|
|
"enterpriseUnitsUsed" : 599878,
|
|
"enterpriseUnitsProjected" : 597808
|
|
}, {
|
|
"aid" : "315",
|
|
"agentId" : "789",
|
|
"accountGroupName" : "Documentation",
|
|
"agentName" : "lab-physical-appliance-1",
|
|
"enterpriseUnitsUsed" : 597123,
|
|
"enterpriseUnitsProjected" : 597808
|
|
} ],
|
|
"endpointAgentsEssentials" : [ {
|
|
"aid" : "1234",
|
|
"accountGroupName" : "Support",
|
|
"endpointAgentsEssentialsUsed" : 2
|
|
}, {
|
|
"aid" : "12345",
|
|
"accountGroupName" : "Documentation",
|
|
"endpointAgentsEssentialsUsed" : 3
|
|
} ]
|
|
}
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=None,
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
}
|