mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2026-09-18 07:53:55 +00:00
|
Some checks failed
Python CI / build (push) Has been cancelled
Co-authored-by: API Team <api-team@thousandeyes.com> |
||
|---|---|---|
| .. | ||
| .openapi-generator | ||
| docs | ||
| src/thousandeyes_sdk/bgp_updates | ||
| test | ||
| .openapi-generator-ignore | ||
| MANIFEST.in | ||
| pyproject.toml | ||
| README.md | ||
| setup.cfg | ||
thousandeyes-sdk-bgp-updates
Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 7.0.104
- Generator version: 7.6.0
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator
Requirements.
Python 3.9+
Installation & Usage
pip install
Install directly via PyPi:
pip install thousandeyes-sdk-bgp-updates
(you may need to run pip with root permission: sudo pip install thousandeyes-sdk-bgp-updates)
Then import the package:
import thousandeyes_sdk.bgp_updates
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 thousandeyes_sdk.bgp_updates
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import thousandeyes_sdk.core
import thousandeyes_sdk.bgp_updates
from thousandeyes_sdk.core.exceptions import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com/v7
# See configuration.py for a list of all supported configuration parameters.
configuration = thousandeyes_sdk.core.Configuration(
host = "https://api.thousandeyes.com/v7"
)
# 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 = thousandeyes_sdk.core.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with thousandeyes_sdk.core.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = thousandeyes_sdk.bgp_updates.BGPUpdatesApi(api_client)
aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
max = 20 # int | Maximum number of BGP updates to return. (optional) (default to 20)
cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional)
expand = ["monitor"] # List[BgpDataExpandOption] | Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects. (optional)
start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional)
end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional)
prefixes = ["192.0.2.0/24"] # List[str] | Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. (optional)
origin_ases = [64512] # List[int] | Origin AS filters. Repeat the parameter to filter by multiple ASNs. (optional)
as_paths = ["64512 64513"] # List[str] | AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. (optional)
rpki_statuses = [
'Valid'
] # List[BgpRpkiStatus] | RPKI status filters. (optional)
update_type = [
'announcement'
] # List[BgpUpdateType] | BGP update type filters. (optional)
monitor_ids = ["101"] # List[str] | BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint. (optional)
communities = ["64512:100"] # List[str] | BGP community filters. Repeat the parameter to filter by multiple communities. (optional)
try:
# List BGP updates
api_response = api_instance.get_bgp_updates(aid=aid, max=max, cursor=cursor, expand=expand, start_date=start_date, end_date=end_date, prefixes=prefixes, origin_ases=origin_ases, as_paths=as_paths, rpki_statuses=rpki_statuses, update_type=update_type, monitor_ids=monitor_ids, communities=communities)
print("The response of BGPUpdatesApi->get_bgp_updates:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling BGPUpdatesApi->get_bgp_updates: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.thousandeyes.com/v7
| Class | Method | HTTP request | Description |
|---|---|---|---|
| BGPUpdatesApi | get_bgp_updates | GET /bgp/updates | List BGP updates |
Documentation For Models
- BgpDataExpandOption
- BgpMonitor
- BgpRpkiStatus
- BgpUpdate
- BgpUpdateType
- BgpUpdates
- Error
- Link
- Monitor
- MonitorType
- PaginationLinks
- UnauthorizedError
- ValidationError
- ValidationErrorItem
Documentation For Authorization
Authentication schemes defined for the API:
BearerAuth
- Type: Bearer authentication