Skip to content

Latest commit

 

History

History
202 lines (138 loc) · 10.6 KB

File metadata and controls

202 lines (138 loc) · 10.6 KB

Events

(events)

Overview

REST APIs for capturing event data

Available Operations

get_workspace_events_by_target

Load recent events for a particular workspace

Example Usage

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

Parameters

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.

Response

operations.GetWorkspaceEventsByTargetResponse

Errors

Error Object Status Code Content Type
errors.Error 5XX application/json
errors.SDKError 4xx-5xx /

get_workspace_targets

Load targets for a particular workspace

Example Usage

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

Parameters

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.

Response

operations.GetWorkspaceTargetsResponse

Errors

Error Object Status Code Content Type
errors.Error 5XX application/json
errors.SDKError 4xx-5xx /

post_workspace_events

Sends an array of events to be stored for a particular workspace.

Example Usage

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

Parameters

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.

Response

operations.PostWorkspaceEventsResponse

Errors

Error Object Status Code Content Type
errors.Error 5XX application/json
errors.SDKError 4xx-5xx /

search_workspace_events

Search events for a particular workspace by any field

Example Usage

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

Parameters

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.

Response

operations.SearchWorkspaceEventsResponse

Errors

Error Object Status Code Content Type
errors.Error 5XX application/json
errors.SDKError 4xx-5xx /