(events)
REST APIs for capturing event data
- getWorkspaceEventsByTarget - Load recent events for a particular workspace
- getWorkspaceTargets - Load targets for a particular workspace
- postWorkspaceEvents - Post events for a specific workspace
- searchWorkspaceEvents - Search events for a particular workspace by any field
Load recent events for a particular workspace
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
workspaceID: "<value>",
});
const res = await sdk.events.getWorkspaceEventsByTarget({
targetID: "<value>",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceEventsByTargetRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetWorkspaceEventsByTargetResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Load targets for a particular workspace
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
workspaceID: "<value>",
});
const res = await sdk.events.getWorkspaceTargets({});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceTargetsRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetWorkspaceTargetsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Sends an array of events to be stored for a particular workspace.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
import { GenerateBumpType, InteractionType, OpenapiDiffBumpType } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/shared";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
workspaceID: "<value>",
});
const res = await sdk.events.postWorkspaceEvents({
requestBody: [
{
createdAt: new Date("2024-11-21T06:58:42.120Z"),
executionId: "<value>",
id: "<id>",
interactionType: InteractionType.CliExec,
localStartedAt: new Date("2024-05-07T12:35:47.182Z"),
speakeasyApiKeyName: "<value>",
speakeasyVersion: "<value>",
success: false,
workspaceId: "<value>",
},
],
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.PostWorkspaceEventsRequest | ✔️ | The request object to use for the request. |
retries |
utils.RetryConfig | ➖ | Configuration to override the default retry behavior of the client. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.PostWorkspaceEventsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Search events for a particular workspace by any field
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
workspaceID: "<value>",
});
const res = await sdk.events.searchWorkspaceEvents({});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.SearchWorkspaceEventsRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.SearchWorkspaceEventsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |