8.6 KiB
admin-api
Overview
Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API.
This API provides the following endpoints that define the operations to manage your organization:
/account-groups: Account groups are used to divide an organization into different sections. These endpoints 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.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 7.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 3.7+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git)
Then import the package:
import admin_api
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import admin_api
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import time
import admin_api
from admin_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = admin_api.Configuration(
host = "https://api.thousandeyes.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = admin_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with admin_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = admin_api.AccountGroupsApi(api_client)
account_group_request_body = admin_api.AccountGroupRequestBody() # AccountGroupRequestBody |
expand = [admin_api.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional)
try:
# Create account group
api_response = api_instance.create_account_group(account_group_request_body, expand=expand)
print("The response of AccountGroupsApi->create_account_group:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountGroupsApi->create_account_group: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.thousandeyes.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AccountGroupsApi | create_account_group | POST /v7/account-groups | Create account group |
| AccountGroupsApi | delete_account_group | DELETE /v7/account-groups/{id} | Delete account group |
| AccountGroupsApi | get_account_group | GET /v7/account-groups/{id} | Retrieve account group |
| AccountGroupsApi | get_account_groups | GET /v7/account-groups | List account groups |
| AccountGroupsApi | update_account_group | PUT /v7/account-groups/{id} | Update account group |
| PermissionsApi | get_permissions | GET /v7/permissions | List assignable permissions |
| RolesApi | create_role | POST /v7/roles | Create role |
| RolesApi | delete_role | DELETE /v7/roles/{id} | Delete role |
| RolesApi | get_role | GET /v7/roles/{id} | Retrieve role |
| RolesApi | get_roles | GET /v7/roles | List roles |
| RolesApi | update_role | PUT /v7/roles/{id} | Update role |
| UserEventsApi | get_user_events | GET /v7/audit-user-events | List activity log events |
| UsersApi | create_user | POST /v7/users | Create user |
| UsersApi | delete_user | DELETE /v7/users/{id} | Delete user |
| UsersApi | get_user | GET /v7/users/{id} | Retrieve user |
| UsersApi | get_users | GET /v7/users | List users |
| UsersApi | update_user | PUT /v7/users/{id} | Update user |
Documentation For Models
- AccountGroup
- AccountGroup1
- AccountGroupDetail
- AccountGroupId
- AccountGroupRequestBody
- AccountGroupRoles
- AccountGroupRolesAccountGroupRolesInner
- AccountGroupRolesRequestBodyInner
- AccountGroups
- Agent
- AgentBase
- AllAccountGroupRoles
- BaseRole
- CloudEnterpriseAgentType
- ClusterMember
- CreateAccountGroup201Response
- CreateRole201Response
- CreateUser201Response
- CreatedUser
- EnterpriseAgent
- EnterpriseAgentIpv6Policy
- EnterpriseAgentState
- EnterpriseAgents
- Error
- ErrorDetail
- ErrorDetailCode
- Expand
- ExtendedUser
- GetAccountGroup200Response
- GetAccountGroups200Response
- GetPermissions200Response
- GetRoles200Response
- GetUser200Response
- GetUserEvents200Response
- GetUsers200Response
- InterfaceIpMapping
- Link
- LoginAccountGroup
- NewAccountGroupResponse
- PaginationLinks
- PaginationLinksLinks
- Permission
- Permissions
- QueryWindow
- Role
- RoleDetail
- RoleRequestBody
- Roles
- SelfLinks
- SelfLinksLinks
- UnauthorizedError
- User
- UserAccountGroup
- UserAccountGroups
- UserDetail
- UserEvent
- UserEventAllOfResourcesInner
- UserEvents
- UserRequestBody
- Users
Documentation For Authorization
Authentication schemes defined for the API:
BearerAuth
- Type: Bearer authentication