mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2026-08-04 08:56:50 +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>
3253 lines
115 KiB
Python
3253 lines
115 KiB
Python
# coding: utf-8
|
|
|
|
"""
|
|
Administrative API
|
|
|
|
Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These operations can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
|
|
|
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 = {
|
|
|
|
"create_account_group": OperationExpectation(
|
|
operation_id="create_account_group",
|
|
method="POST",
|
|
path="/account-groups",
|
|
path_param_examples={
|
|
},
|
|
success_status=201,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"isCurrentAccountGroup" : true,
|
|
"organizationName" : "organizationName",
|
|
"_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"
|
|
}
|
|
},
|
|
"accountGroupName" : "Account A",
|
|
"isDefaultAccountGroup" : true,
|
|
"aid" : "1234",
|
|
"orgId" : "12345",
|
|
"users" : [ {
|
|
"uid" : "235",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2022-07-17T22:00:54Z"
|
|
}, {
|
|
"uid" : "235",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2022-07-17T22:00:54Z"
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"accountGroupName" : "My testing account group",
|
|
"agents" : [ "105", "719" ]
|
|
}
|
|
|
|
"""),
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"delete_account_group": OperationExpectation(
|
|
operation_id="delete_account_group",
|
|
method="DELETE",
|
|
path="/account-groups/{id}",
|
|
path_param_examples={
|
|
"id": '1234',
|
|
},
|
|
success_status=204,
|
|
success_body=None,
|
|
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_account_group": OperationExpectation(
|
|
operation_id="get_account_group",
|
|
method="GET",
|
|
path="/account-groups/{id}",
|
|
path_param_examples={
|
|
"id": '1234',
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"isCurrentAccountGroup" : true,
|
|
"organizationName" : "organizationName",
|
|
"_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"
|
|
}
|
|
},
|
|
"accountGroupName" : "Account A",
|
|
"isDefaultAccountGroup" : true,
|
|
"accountToken" : "accountToken",
|
|
"aid" : "1234",
|
|
"orgId" : "12345",
|
|
"users" : [ {
|
|
"uid" : "235",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2022-07-17T22:00:54Z"
|
|
}, {
|
|
"uid" : "235",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2022-07-17T22:00:54Z"
|
|
} ],
|
|
"agents" : [ {
|
|
"agentId" : "281474976710706",
|
|
"agentType" : "enterprise-cluster",
|
|
"ipv6Policy" : "force-ipv4",
|
|
"prefix" : "99.128.0.0/11",
|
|
"networkProviderInfo" : {
|
|
"asn" : 7018,
|
|
"name" : "AT&T Services, Inc.",
|
|
"type" : "isp"
|
|
},
|
|
"countryId" : "US",
|
|
"enabled" : true,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"hostname" : "thousandeyes.com",
|
|
"keepBrowserCache" : true,
|
|
"agentState" : "online",
|
|
"localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ],
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"coordinates" : {
|
|
"latitude" : 37.77493,
|
|
"longitude" : -122.41942
|
|
},
|
|
"agentName" : "thousandeyes-stg-va-254",
|
|
"utilization" : 25,
|
|
"testIds" : [ 281474976710706 ],
|
|
"clusterMembers" : [ {
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"agentState" : "online",
|
|
"targetForTests" : "1.1.1.1",
|
|
"name" : "Cluster member name",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"utilization" : 25,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"memberId" : "10",
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
}, {
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"agentState" : "online",
|
|
"targetForTests" : "1.1.1.1",
|
|
"name" : "Cluster member name",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"utilization" : 25,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"memberId" : "10",
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
} ],
|
|
"tests" : [ {
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"
|
|
} ],
|
|
"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"
|
|
}
|
|
},
|
|
"liveShare" : false,
|
|
"savedEvent" : true,
|
|
"description" : "ThousandEyes Test",
|
|
"type" : "agent-to-server",
|
|
"enabled" : true,
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"createdBy" : "user@user.com",
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"modifiedBy" : "user@user.com",
|
|
"testId" : "281474976710706",
|
|
"alertsEnabled" : true,
|
|
"testName" : "ThousandEyes Test"
|
|
}, {
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"
|
|
} ],
|
|
"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"
|
|
}
|
|
},
|
|
"liveShare" : false,
|
|
"savedEvent" : true,
|
|
"description" : "ThousandEyes Test",
|
|
"type" : "agent-to-server",
|
|
"enabled" : true,
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"createdBy" : "user@user.com",
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"modifiedBy" : "user@user.com",
|
|
"testId" : "281474976710706",
|
|
"alertsEnabled" : true,
|
|
"testName" : "ThousandEyes Test"
|
|
} ],
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"interfaceIpMapping" : [ {
|
|
"ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ],
|
|
"interfaceName" : "wlp4s0"
|
|
}, {
|
|
"ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ],
|
|
"interfaceName" : "wlp4s0"
|
|
} ],
|
|
"targetForTests" : "1.1.1.1",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"location" : "San Francisco Bay Area",
|
|
"accountGroups" : [ {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}, {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
} ],
|
|
"verifySslCertificates" : true,
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
}, {
|
|
"agentId" : "281474976710706",
|
|
"agentType" : "enterprise-cluster",
|
|
"ipv6Policy" : "force-ipv4",
|
|
"prefix" : "99.128.0.0/11",
|
|
"networkProviderInfo" : {
|
|
"asn" : 7018,
|
|
"name" : "AT&T Services, Inc.",
|
|
"type" : "isp"
|
|
},
|
|
"countryId" : "US",
|
|
"enabled" : true,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"hostname" : "thousandeyes.com",
|
|
"keepBrowserCache" : true,
|
|
"agentState" : "online",
|
|
"localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ],
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"coordinates" : {
|
|
"latitude" : 37.77493,
|
|
"longitude" : -122.41942
|
|
},
|
|
"agentName" : "thousandeyes-stg-va-254",
|
|
"utilization" : 25,
|
|
"testIds" : [ 281474976710706 ],
|
|
"clusterMembers" : [ {
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"agentState" : "online",
|
|
"targetForTests" : "1.1.1.1",
|
|
"name" : "Cluster member name",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"utilization" : 25,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"memberId" : "10",
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
}, {
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"agentState" : "online",
|
|
"targetForTests" : "1.1.1.1",
|
|
"name" : "Cluster member name",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"utilization" : 25,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"memberId" : "10",
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
} ],
|
|
"tests" : [ {
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"
|
|
} ],
|
|
"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"
|
|
}
|
|
},
|
|
"liveShare" : false,
|
|
"savedEvent" : true,
|
|
"description" : "ThousandEyes Test",
|
|
"type" : "agent-to-server",
|
|
"enabled" : true,
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"createdBy" : "user@user.com",
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"modifiedBy" : "user@user.com",
|
|
"testId" : "281474976710706",
|
|
"alertsEnabled" : true,
|
|
"testName" : "ThousandEyes Test"
|
|
}, {
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"
|
|
} ],
|
|
"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"
|
|
}
|
|
},
|
|
"liveShare" : false,
|
|
"savedEvent" : true,
|
|
"description" : "ThousandEyes Test",
|
|
"type" : "agent-to-server",
|
|
"enabled" : true,
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"createdBy" : "user@user.com",
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"modifiedBy" : "user@user.com",
|
|
"testId" : "281474976710706",
|
|
"alertsEnabled" : true,
|
|
"testName" : "ThousandEyes Test"
|
|
} ],
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"interfaceIpMapping" : [ {
|
|
"ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ],
|
|
"interfaceName" : "wlp4s0"
|
|
}, {
|
|
"ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ],
|
|
"interfaceName" : "wlp4s0"
|
|
} ],
|
|
"targetForTests" : "1.1.1.1",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"location" : "San Francisco Bay Area",
|
|
"accountGroups" : [ {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}, {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
} ],
|
|
"verifySslCertificates" : true,
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
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_account_groups": OperationExpectation(
|
|
operation_id="get_account_groups",
|
|
method="GET",
|
|
path="/account-groups",
|
|
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"
|
|
}
|
|
},
|
|
"accountGroups" : [ {
|
|
"isCurrentAccountGroup" : true,
|
|
"organizationName" : "organizationName",
|
|
"accountGroupName" : "Account A",
|
|
"isDefaultAccountGroup" : true,
|
|
"aid" : "1234",
|
|
"orgId" : "12345"
|
|
}, {
|
|
"isCurrentAccountGroup" : true,
|
|
"organizationName" : "organizationName",
|
|
"accountGroupName" : "Account A",
|
|
"isDefaultAccountGroup" : true,
|
|
"aid" : "1234",
|
|
"orgId" : "12345"
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"update_account_group": OperationExpectation(
|
|
operation_id="update_account_group",
|
|
method="PUT",
|
|
path="/account-groups/{id}",
|
|
path_param_examples={
|
|
"id": '1234',
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"isCurrentAccountGroup" : true,
|
|
"organizationName" : "organizationName",
|
|
"_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"
|
|
}
|
|
},
|
|
"accountGroupName" : "Account A",
|
|
"isDefaultAccountGroup" : true,
|
|
"accountToken" : "accountToken",
|
|
"aid" : "1234",
|
|
"orgId" : "12345",
|
|
"users" : [ {
|
|
"uid" : "235",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2022-07-17T22:00:54Z"
|
|
}, {
|
|
"uid" : "235",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2022-07-17T22:00:54Z"
|
|
} ],
|
|
"agents" : [ {
|
|
"agentId" : "281474976710706",
|
|
"agentType" : "enterprise-cluster",
|
|
"ipv6Policy" : "force-ipv4",
|
|
"prefix" : "99.128.0.0/11",
|
|
"networkProviderInfo" : {
|
|
"asn" : 7018,
|
|
"name" : "AT&T Services, Inc.",
|
|
"type" : "isp"
|
|
},
|
|
"countryId" : "US",
|
|
"enabled" : true,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"hostname" : "thousandeyes.com",
|
|
"keepBrowserCache" : true,
|
|
"agentState" : "online",
|
|
"localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ],
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"coordinates" : {
|
|
"latitude" : 37.77493,
|
|
"longitude" : -122.41942
|
|
},
|
|
"agentName" : "thousandeyes-stg-va-254",
|
|
"utilization" : 25,
|
|
"testIds" : [ 281474976710706 ],
|
|
"clusterMembers" : [ {
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"agentState" : "online",
|
|
"targetForTests" : "1.1.1.1",
|
|
"name" : "Cluster member name",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"utilization" : 25,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"memberId" : "10",
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
}, {
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"agentState" : "online",
|
|
"targetForTests" : "1.1.1.1",
|
|
"name" : "Cluster member name",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"utilization" : 25,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"memberId" : "10",
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
} ],
|
|
"tests" : [ {
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"
|
|
} ],
|
|
"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"
|
|
}
|
|
},
|
|
"liveShare" : false,
|
|
"savedEvent" : true,
|
|
"description" : "ThousandEyes Test",
|
|
"type" : "agent-to-server",
|
|
"enabled" : true,
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"createdBy" : "user@user.com",
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"modifiedBy" : "user@user.com",
|
|
"testId" : "281474976710706",
|
|
"alertsEnabled" : true,
|
|
"testName" : "ThousandEyes Test"
|
|
}, {
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"
|
|
} ],
|
|
"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"
|
|
}
|
|
},
|
|
"liveShare" : false,
|
|
"savedEvent" : true,
|
|
"description" : "ThousandEyes Test",
|
|
"type" : "agent-to-server",
|
|
"enabled" : true,
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"createdBy" : "user@user.com",
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"modifiedBy" : "user@user.com",
|
|
"testId" : "281474976710706",
|
|
"alertsEnabled" : true,
|
|
"testName" : "ThousandEyes Test"
|
|
} ],
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"interfaceIpMapping" : [ {
|
|
"ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ],
|
|
"interfaceName" : "wlp4s0"
|
|
}, {
|
|
"ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ],
|
|
"interfaceName" : "wlp4s0"
|
|
} ],
|
|
"targetForTests" : "1.1.1.1",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"location" : "San Francisco Bay Area",
|
|
"accountGroups" : [ {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}, {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
} ],
|
|
"verifySslCertificates" : true,
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
}, {
|
|
"agentId" : "281474976710706",
|
|
"agentType" : "enterprise-cluster",
|
|
"ipv6Policy" : "force-ipv4",
|
|
"prefix" : "99.128.0.0/11",
|
|
"networkProviderInfo" : {
|
|
"asn" : 7018,
|
|
"name" : "AT&T Services, Inc.",
|
|
"type" : "isp"
|
|
},
|
|
"countryId" : "US",
|
|
"enabled" : true,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"hostname" : "thousandeyes.com",
|
|
"keepBrowserCache" : true,
|
|
"agentState" : "online",
|
|
"localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ],
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"coordinates" : {
|
|
"latitude" : 37.77493,
|
|
"longitude" : -122.41942
|
|
},
|
|
"agentName" : "thousandeyes-stg-va-254",
|
|
"utilization" : 25,
|
|
"testIds" : [ 281474976710706 ],
|
|
"clusterMembers" : [ {
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"agentState" : "online",
|
|
"targetForTests" : "1.1.1.1",
|
|
"name" : "Cluster member name",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"utilization" : 25,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"memberId" : "10",
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
}, {
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"serialNumber" : "FOC2218ABCD",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"agentState" : "online",
|
|
"targetForTests" : "1.1.1.1",
|
|
"name" : "Cluster member name",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"utilization" : 25,
|
|
"network" : "AT&T Services, Inc. (AS 7018)",
|
|
"memberId" : "10",
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
} ],
|
|
"tests" : [ {
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"
|
|
} ],
|
|
"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"
|
|
}
|
|
},
|
|
"liveShare" : false,
|
|
"savedEvent" : true,
|
|
"description" : "ThousandEyes Test",
|
|
"type" : "agent-to-server",
|
|
"enabled" : true,
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"createdBy" : "user@user.com",
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"modifiedBy" : "user@user.com",
|
|
"testId" : "281474976710706",
|
|
"alertsEnabled" : true,
|
|
"testName" : "ThousandEyes Test"
|
|
}, {
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"
|
|
} ],
|
|
"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"
|
|
}
|
|
},
|
|
"liveShare" : false,
|
|
"savedEvent" : true,
|
|
"description" : "ThousandEyes Test",
|
|
"type" : "agent-to-server",
|
|
"enabled" : true,
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"createdBy" : "user@user.com",
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"modifiedBy" : "user@user.com",
|
|
"testId" : "281474976710706",
|
|
"alertsEnabled" : true,
|
|
"testName" : "ThousandEyes Test"
|
|
} ],
|
|
"lastSeen" : "2022-07-17T22:00:54Z",
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ],
|
|
"interfaceIpMapping" : [ {
|
|
"ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ],
|
|
"interfaceName" : "wlp4s0"
|
|
}, {
|
|
"ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ],
|
|
"interfaceName" : "wlp4s0"
|
|
} ],
|
|
"targetForTests" : "1.1.1.1",
|
|
"ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ],
|
|
"location" : "San Francisco Bay Area",
|
|
"accountGroups" : [ {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}, {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
} ],
|
|
"verifySslCertificates" : true,
|
|
"errorDetails" : [ {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
}, {
|
|
"code" : "agent-version-outdated",
|
|
"description" : "Agent Version 0.1.1 (latest: 1.0.0)"
|
|
} ]
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"accountGroupName" : "My testing account group",
|
|
"agents" : [ "105", "719" ]
|
|
}
|
|
|
|
"""),
|
|
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_permissions": OperationExpectation(
|
|
operation_id="get_permissions",
|
|
method="GET",
|
|
path="/permissions",
|
|
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"
|
|
}
|
|
},
|
|
"permissions" : [ {
|
|
"label" : "View reports",
|
|
"permissionId" : "1",
|
|
"isManagementPermission" : true,
|
|
"permission" : "REPORT_READ"
|
|
}, {
|
|
"label" : "View snapshots",
|
|
"permissionId" : "51",
|
|
"isManagementPermission" : false,
|
|
"permission" : "REPORT_SNAPSHOTS_READ"
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"create_role": OperationExpectation(
|
|
operation_id="create_role",
|
|
method="POST",
|
|
path="/roles",
|
|
path_param_examples={
|
|
},
|
|
success_status=201,
|
|
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"
|
|
}
|
|
},
|
|
"roleId" : "35",
|
|
"permissions" : [ {
|
|
"label" : "View reports",
|
|
"permissionId" : "1",
|
|
"isManagementPermission" : true,
|
|
"permission" : "REPORT_READ"
|
|
}, {
|
|
"label" : "View snapshots",
|
|
"permissionId" : "51",
|
|
"isManagementPermission" : false,
|
|
"permission" : "REPORT_SNAPSHOTS_READ"
|
|
} ],
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"permissions" : [ "56", "315" ],
|
|
"name" : "Organization Admin"
|
|
}
|
|
|
|
"""),
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"delete_role": OperationExpectation(
|
|
operation_id="delete_role",
|
|
method="DELETE",
|
|
path="/roles/{id}",
|
|
path_param_examples={
|
|
"id": '23',
|
|
},
|
|
success_status=204,
|
|
success_body=None,
|
|
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_role": OperationExpectation(
|
|
operation_id="get_role",
|
|
method="GET",
|
|
path="/roles/{id}",
|
|
path_param_examples={
|
|
"id": '23',
|
|
},
|
|
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"
|
|
}
|
|
},
|
|
"roleId" : "35",
|
|
"permissions" : [ {
|
|
"label" : "View reports",
|
|
"permissionId" : "1",
|
|
"isManagementPermission" : true,
|
|
"permission" : "REPORT_READ"
|
|
}, {
|
|
"label" : "View snapshots",
|
|
"permissionId" : "51",
|
|
"isManagementPermission" : false,
|
|
"permission" : "REPORT_SNAPSHOTS_READ"
|
|
} ],
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true
|
|
}
|
|
|
|
"""),
|
|
|
|
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_roles": OperationExpectation(
|
|
operation_id="get_roles",
|
|
method="GET",
|
|
path="/roles",
|
|
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"
|
|
}
|
|
},
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"update_role": OperationExpectation(
|
|
operation_id="update_role",
|
|
method="PUT",
|
|
path="/roles/{id}",
|
|
path_param_examples={
|
|
"id": '23',
|
|
},
|
|
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"
|
|
}
|
|
},
|
|
"roleId" : "35",
|
|
"permissions" : [ {
|
|
"label" : "View reports",
|
|
"permissionId" : "1",
|
|
"isManagementPermission" : true,
|
|
"permission" : "REPORT_READ"
|
|
}, {
|
|
"label" : "View snapshots",
|
|
"permissionId" : "51",
|
|
"isManagementPermission" : false,
|
|
"permission" : "REPORT_SNAPSHOTS_READ"
|
|
} ],
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"permissions" : [ "56", "315" ],
|
|
"name" : "Organization Admin"
|
|
}
|
|
|
|
"""),
|
|
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_user_events": OperationExpectation(
|
|
operation_id="get_user_events",
|
|
method="GET",
|
|
path="/audit-user-events",
|
|
path_param_examples={
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"endDate" : "2022-07-18T22:00:54Z",
|
|
"_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"
|
|
}
|
|
},
|
|
"auditEvents" : [ {
|
|
"accountGroupName" : "API Sandbox",
|
|
"aid" : "1234",
|
|
"date" : "2020-07-17T21:54:54Z",
|
|
"event" : "Report created.",
|
|
"ipAddress" : "99.128.0.0/11",
|
|
"uid" : "1234",
|
|
"user" : "API Sandbox User (noreply@thousandeyes.com)",
|
|
"resources" : [ {
|
|
"name" : "My New report",
|
|
"type" : "reportTitle"
|
|
}, {
|
|
"name" : "Other Report",
|
|
"type" : "testName"
|
|
} ]
|
|
}, {
|
|
"accountGroupName" : "API Sandbox",
|
|
"aid" : "1234",
|
|
"date" : "2020-07-17T22:00:54Z",
|
|
"event" : "Login failed.",
|
|
"ipAddress" : "99.128.0.0/11",
|
|
"uid" : "1234",
|
|
"user" : "API Sandbox User (noreply@thousandeyes.com)"
|
|
} ],
|
|
"startDate" : "2022-07-17T22:00:54Z"
|
|
}
|
|
|
|
"""),
|
|
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"create_user": OperationExpectation(
|
|
operation_id="create_user",
|
|
method="POST",
|
|
path="/users",
|
|
path_param_examples={
|
|
},
|
|
success_status=201,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"loginAccountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
},
|
|
"uid" : "245",
|
|
"allAccountGroupRoles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"_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"
|
|
}
|
|
},
|
|
"accountGroupRoles" : [ {
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"accountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}
|
|
}, {
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"accountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2020-07-17T22:00:54Z"
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"loginAccountGroupId" : "691",
|
|
"accountGroupRoles" : [ {
|
|
"roleIds" : [ "57", "1140" ],
|
|
"accountGroupId" : "315"
|
|
}, {
|
|
"roleIds" : [ "57", "1140" ],
|
|
"accountGroupId" : "315"
|
|
} ],
|
|
"name" : "User X",
|
|
"allAccountGroupRoleIds" : [ "57", "1140" ],
|
|
"email" : "userx@thousandeyes.com"
|
|
}
|
|
|
|
"""),
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"delete_user": OperationExpectation(
|
|
operation_id="delete_user",
|
|
method="DELETE",
|
|
path="/users/{id}",
|
|
path_param_examples={
|
|
"id": '1234',
|
|
},
|
|
success_status=204,
|
|
success_body=None,
|
|
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_current_user": OperationExpectation(
|
|
operation_id="get_current_user",
|
|
method="GET",
|
|
path="/users/current",
|
|
path_param_examples={
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"loginAccountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
},
|
|
"uid" : "245",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"allAccountGroupRoles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"_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"
|
|
}
|
|
},
|
|
"accountGroupRoles" : [ {
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"accountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}
|
|
}, {
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"accountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2020-07-17T22:00:54Z"
|
|
}
|
|
|
|
"""),
|
|
|
|
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_user": OperationExpectation(
|
|
operation_id="get_user",
|
|
method="GET",
|
|
path="/users/{id}",
|
|
path_param_examples={
|
|
"id": '1234',
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"loginAccountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
},
|
|
"uid" : "245",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"allAccountGroupRoles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"_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"
|
|
}
|
|
},
|
|
"accountGroupRoles" : [ {
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"accountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}
|
|
}, {
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"accountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2020-07-17T22:00:54Z"
|
|
}
|
|
|
|
"""),
|
|
|
|
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_users": OperationExpectation(
|
|
operation_id="get_users",
|
|
method="GET",
|
|
path="/users",
|
|
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"
|
|
}
|
|
},
|
|
"users" : [ {
|
|
"loginAccountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
},
|
|
"uid" : "245",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2020-07-17T22:00:54Z"
|
|
}, {
|
|
"loginAccountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
},
|
|
"uid" : "245",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2020-07-17T22:00:54Z"
|
|
} ]
|
|
}
|
|
|
|
"""),
|
|
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"update_user": OperationExpectation(
|
|
operation_id="update_user",
|
|
method="PUT",
|
|
path="/users/{id}",
|
|
path_param_examples={
|
|
"id": '1234',
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"loginAccountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
},
|
|
"uid" : "245",
|
|
"lastLogin" : "2022-07-17T22:00:54Z",
|
|
"allAccountGroupRoles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"_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"
|
|
}
|
|
},
|
|
"accountGroupRoles" : [ {
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"accountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}
|
|
}, {
|
|
"roles" : [ {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
}, {
|
|
"roleId" : "35",
|
|
"name" : "Organization Admin",
|
|
"isBuiltin" : true,
|
|
"hasManagementPermissions" : true
|
|
} ],
|
|
"accountGroup" : {
|
|
"accountGroupName" : "Account A",
|
|
"aid" : "1234"
|
|
}
|
|
} ],
|
|
"name" : "User X",
|
|
"email" : "userx@thousandeyes.com",
|
|
"dateRegistered" : "2020-07-17T22:00:54Z"
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"loginAccountGroupId" : "691",
|
|
"accountGroupRoles" : [ {
|
|
"roleIds" : [ "57", "1140" ],
|
|
"accountGroupId" : "315"
|
|
}, {
|
|
"roleIds" : [ "57", "1140" ],
|
|
"accountGroupId" : "315"
|
|
} ],
|
|
"name" : "User X",
|
|
"allAccountGroupRoleIds" : [ "57", "1140" ],
|
|
"email" : "userx@thousandeyes.com"
|
|
}
|
|
|
|
"""),
|
|
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",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
}
|