(events)
REST APIs for capturing event data
- get_workspace_events_by_target - Load recent events for a particular workspace
- get_workspace_targets - Load targets for a particular workspace
- post_workspace_events - Post events for a specific workspace
- search_workspace_events - Search events for a particular workspace by any field
Load recent events for a particular workspace
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.events.get_workspace_events_by_target(request={
"target_id": "<value>",
})
if res.cli_event_batch is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceEventsByTargetRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspaceEventsByTargetResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.Error | 5XX | application/json |
errors.SDKError | 4xx-5xx | / |
Load targets for a particular workspace
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.events.get_workspace_targets()
if res.target_sdk_list is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceTargetsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspaceTargetsResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.Error | 5XX | application/json |
errors.SDKError | 4xx-5xx | / |
Sends an array of events to be stored for a particular workspace.
import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.events.post_workspace_events(request={
"request_body": [
{
"created_at": dateutil.parser.isoparse("2024-11-21T06:58:42.120Z"),
"execution_id": "<value>",
"id": "<id>",
"interaction_type": shared.InteractionType.CLI_EXEC,
"local_started_at": dateutil.parser.isoparse("2024-05-07T12:35:47.182Z"),
"speakeasy_api_key_name": "<value>",
"speakeasy_version": "<value>",
"success": False,
"workspace_id": "<value>",
},
],
})
if res is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.PostWorkspaceEventsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.PostWorkspaceEventsResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.Error | 5XX | application/json |
errors.SDKError | 4xx-5xx | / |
Search events for a particular workspace by any field
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.events.search_workspace_events()
if res.cli_event_batch is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.SearchWorkspaceEventsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.SearchWorkspaceEventsResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.Error | 5XX | application/json |
errors.SDKError | 4xx-5xx | / |