diff --git a/.github/workflows/api-client-drift.yml b/.github/workflows/api-client-drift.yml index f85ea71de..227ad4ba2 100644 --- a/.github/workflows/api-client-drift.yml +++ b/.github/workflows/api-client-drift.yml @@ -1,11 +1,11 @@ name: API client drift # Regenerates the OpenAPI spec and the generated product clients -# (apps/libs/api-client, apps/api-client-go) and fails if the committed -# clients differ — the committed clients must always match apps/api source. +# (apps/libs/api-client, apps/api-client-go, apps/libs/analytics-api-client) +# and fails if the committed clients differ — the committed clients must +# always match their specs (apps/api source for the product clients, +# apps/libs/analytics-api-client/swagger.json for the analytics client). # Ported from daytonaio/daytona's `format-lint-api-clients` PR check. -# analytics-api-client is excluded: its input swagger comes from the external -# analytics service, not this repo. on: pull_request: @@ -68,12 +68,13 @@ jobs: run: | yarn nx run api-client:generate:api-client yarn nx run api-client-go:generate:api-client + yarn nx run analytics-api-client:generate:api-client - name: Fail on drift run: | - if [ -n "$(git status --porcelain -- libs/api-client api-client-go)" ]; then - git status --porcelain -- libs/api-client api-client-go - git diff -- libs/api-client api-client-go | head -200 - echo "::error::Generated API clients are stale. Run 'yarn nx run api-client:generate:api-client && yarn nx run api-client-go:generate:api-client' in apps/ and commit the result." + if [ -n "$(git status --porcelain -- libs/api-client api-client-go libs/analytics-api-client)" ]; then + git status --porcelain -- libs/api-client api-client-go libs/analytics-api-client + git diff -- libs/api-client api-client-go libs/analytics-api-client | head -200 + echo "::error::Generated API clients are stale. Run 'yarn nx run api-client:generate:api-client && yarn nx run api-client-go:generate:api-client && yarn nx run analytics-api-client:generate:api-client' in apps/ and commit the result." exit 1 fi diff --git a/apps/eslint.config.mjs b/apps/eslint.config.mjs index 60cc1e77b..44a8fc76a 100644 --- a/apps/eslint.config.mjs +++ b/apps/eslint.config.mjs @@ -14,6 +14,7 @@ export default [ ignores: [ '**/dist', '**/node_modules/**', + '**/.nx/**', '**/vite.config.*.timestamp*', '**/vitest.config.*.timestamp*', 'docs/**', diff --git a/apps/libs/analytics-api-client/project.json b/apps/libs/analytics-api-client/project.json index 08198567c..92093c1f8 100644 --- a/apps/libs/analytics-api-client/project.json +++ b/apps/libs/analytics-api-client/project.json @@ -17,12 +17,12 @@ }, "generate:api-client": { "executor": "nx:run-commands", - "inputs": ["apiClient"], + "inputs": ["{projectRoot}/swagger.json", { "env": "DEFAULT_PACKAGE_VERSION" }], "outputs": ["{projectRoot}/src"], "options": { "commands": [ "rm -rf {projectRoot}/src", - "yarn run openapi-generator-cli generate --git-repo-id=boxlite --git-user-id=boxlite-ai -i tmp/swagger.json -g typescript-axios --additional-properties=supportsES6=true,typescriptThreePlus=true,withSeparateModelsAndApi=true,apiPackage=api,modelPackage=models,useTags=true,enumPropertyNaming=UPPERCASE --type-mappings=DateTime=Date -o libs/analytics-api-client/src" + "yarn run openapi-generator-cli generate --git-repo-id=boxlite --git-user-id=boxlite-ai -i libs/analytics-api-client/swagger.json -g typescript-axios --additional-properties=supportsES6=true,typescriptThreePlus=true,withSeparateModelsAndApi=true,apiPackage=api,modelPackage=models,useTags=true,enumPropertyNaming=UPPERCASE --type-mappings=DateTime=Date -o libs/analytics-api-client/src" ], "parallel": false } diff --git a/apps/libs/analytics-api-client/src/.openapi-generator/FILES b/apps/libs/analytics-api-client/src/.openapi-generator/FILES index 935f1ab3c..56cf309ce 100644 --- a/apps/libs/analytics-api-client/src/.openapi-generator/FILES +++ b/apps/libs/analytics-api-client/src/.openapi-generator/FILES @@ -7,13 +7,23 @@ api/usage-api.ts base.ts common.ts configuration.ts +docs/ModelsAggregatedUsage.md +docs/ModelsBoxUsage.md +docs/ModelsLogEntry.md +docs/ModelsMetricPoint.md +docs/ModelsSpan.md +docs/ModelsTraceSummary.md +docs/ModelsUsageChartPoint.md +docs/ModelsUsagePeriod.md +docs/TelemetryApi.md +docs/UsageApi.md git_push.sh index.ts models/index.ts models/models-aggregated-usage.ts +models/models-box-usage.ts models/models-log-entry.ts models/models-metric-point.ts -models/models-sandbox-usage.ts models/models-span.ts models/models-trace-summary.ts models/models-usage-chart-point.ts diff --git a/apps/libs/analytics-api-client/src/.openapi-generator/VERSION b/apps/libs/analytics-api-client/src/.openapi-generator/VERSION index 5f84a81db..14d6b5dc3 100644 --- a/apps/libs/analytics-api-client/src/.openapi-generator/VERSION +++ b/apps/libs/analytics-api-client/src/.openapi-generator/VERSION @@ -1 +1 @@ -7.12.0 +7.23.0 diff --git a/apps/libs/analytics-api-client/src/api.ts b/apps/libs/analytics-api-client/src/api.ts index 884ff6347..834829544 100644 --- a/apps/libs/analytics-api-client/src/api.ts +++ b/apps/libs/analytics-api-client/src/api.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,3 +16,4 @@ export * from './api/telemetry-api'; export * from './api/usage-api'; + diff --git a/apps/libs/analytics-api-client/src/api/telemetry-api.ts b/apps/libs/analytics-api-client/src/api/telemetry-api.ts index 793027896..e867c68fa 100644 --- a/apps/libs/analytics-api-client/src/api/telemetry-api.ts +++ b/apps/libs/analytics-api-client/src/api/telemetry-api.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -18,7 +18,7 @@ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore @@ -31,36 +31,35 @@ import type { ModelsSpan } from '../models'; import type { ModelsTraceSummary } from '../models'; /** * TelemetryApi - axios parameter creator - * @export */ export const TelemetryApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Returns paginated log entries with optional severity and search filters - * @summary Get sandbox logs + * Retrieve OTEL logs for a box within a time range + * @summary Get box logs * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [severity] Comma-separated severity levels - * @param {string} [search] Search text (ILIKE) + * @param {string} [severity] Severity filter (comma-separated) + * @param {string} [search] Search filter * @param {number} [limit] Page size - * @param {number} [offset] Offset + * @param {number} [offset] Page offset * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet: async (organizationId: string, sandboxId: string, from: string, to: string, severity?: string, search?: string, limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise => { + organizationOrganizationIdBoxBoxIdTelemetryLogsGet: async (organizationId: string, boxId: string, from: string, to: string, severity?: string, search?: string, limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'organizationId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet', 'organizationId', organizationId) - // verify required parameter 'sandboxId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet', 'sandboxId', sandboxId) + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryLogsGet', 'organizationId', organizationId) + // verify required parameter 'boxId' is not null or undefined + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryLogsGet', 'boxId', boxId) // verify required parameter 'from' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet', 'from', from) + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryLogsGet', 'from', from) // verify required parameter 'to' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet', 'to', to) - const localVarPath = `/organization/{organizationId}/sandbox/{sandboxId}/telemetry/logs` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))) - .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId))); + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryLogsGet', 'to', to) + const localVarPath = `/organization/{organizationId}/box/{boxId}/telemetry/logs` + .replace('{organizationId}', encodeURIComponent(String(organizationId))) + .replace('{boxId}', encodeURIComponent(String(boxId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -99,7 +98,7 @@ export const TelemetryApiAxiosParamCreator = function (configuration?: Configura localVarQueryParameter['offset'] = offset; } - + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -111,28 +110,28 @@ export const TelemetryApiAxiosParamCreator = function (configuration?: Configura }; }, /** - * Returns gauge metrics aggregated in 1-minute intervals - * @summary Get sandbox metrics + * Retrieve OTEL metrics for a box within a time range + * @summary Get box metrics * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [metricNames] Comma-separated metric names + * @param {string} [metricNames] Metric names filter (comma-separated) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet: async (organizationId: string, sandboxId: string, from: string, to: string, metricNames?: string, options: RawAxiosRequestConfig = {}): Promise => { + organizationOrganizationIdBoxBoxIdTelemetryMetricsGet: async (organizationId: string, boxId: string, from: string, to: string, metricNames?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'organizationId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet', 'organizationId', organizationId) - // verify required parameter 'sandboxId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet', 'sandboxId', sandboxId) + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryMetricsGet', 'organizationId', organizationId) + // verify required parameter 'boxId' is not null or undefined + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryMetricsGet', 'boxId', boxId) // verify required parameter 'from' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet', 'from', from) + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryMetricsGet', 'from', from) // verify required parameter 'to' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet', 'to', to) - const localVarPath = `/organization/{organizationId}/sandbox/{sandboxId}/telemetry/metrics` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))) - .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId))); + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryMetricsGet', 'to', to) + const localVarPath = `/organization/{organizationId}/box/{boxId}/telemetry/metrics` + .replace('{organizationId}', encodeURIComponent(String(organizationId))) + .replace('{boxId}', encodeURIComponent(String(boxId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -159,7 +158,7 @@ export const TelemetryApiAxiosParamCreator = function (configuration?: Configura localVarQueryParameter['metricNames'] = metricNames; } - + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -171,29 +170,29 @@ export const TelemetryApiAxiosParamCreator = function (configuration?: Configura }; }, /** - * Returns paginated trace summaries with span counts and root span info - * @summary Get sandbox traces + * Retrieve OTEL trace summaries for a box within a time range + * @summary Get box traces * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {number} [limit] Page size - * @param {number} [offset] Offset + * @param {number} [offset] Page offset * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet: async (organizationId: string, sandboxId: string, from: string, to: string, limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise => { + organizationOrganizationIdBoxBoxIdTelemetryTracesGet: async (organizationId: string, boxId: string, from: string, to: string, limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'organizationId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet', 'organizationId', organizationId) - // verify required parameter 'sandboxId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet', 'sandboxId', sandboxId) + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryTracesGet', 'organizationId', organizationId) + // verify required parameter 'boxId' is not null or undefined + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryTracesGet', 'boxId', boxId) // verify required parameter 'from' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet', 'from', from) + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryTracesGet', 'from', from) // verify required parameter 'to' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet', 'to', to) - const localVarPath = `/organization/{organizationId}/sandbox/{sandboxId}/telemetry/traces` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))) - .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId))); + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryTracesGet', 'to', to) + const localVarPath = `/organization/{organizationId}/box/{boxId}/telemetry/traces` + .replace('{organizationId}', encodeURIComponent(String(organizationId))) + .replace('{boxId}', encodeURIComponent(String(boxId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -224,7 +223,7 @@ export const TelemetryApiAxiosParamCreator = function (configuration?: Configura localVarQueryParameter['offset'] = offset; } - + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -236,25 +235,25 @@ export const TelemetryApiAxiosParamCreator = function (configuration?: Configura }; }, /** - * Returns all spans belonging to a specific trace ID + * Retrieve all spans for a trace * @summary Get trace spans * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} traceId Trace ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet: async (organizationId: string, sandboxId: string, traceId: string, options: RawAxiosRequestConfig = {}): Promise => { + organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet: async (organizationId: string, boxId: string, traceId: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'organizationId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet', 'organizationId', organizationId) - // verify required parameter 'sandboxId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet', 'sandboxId', sandboxId) + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet', 'organizationId', organizationId) + // verify required parameter 'boxId' is not null or undefined + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet', 'boxId', boxId) // verify required parameter 'traceId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet', 'traceId', traceId) - const localVarPath = `/organization/{organizationId}/sandbox/{sandboxId}/telemetry/traces/{traceId}` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))) - .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId))) - .replace(`{${"traceId"}}`, encodeURIComponent(String(traceId))); + assertParamExists('organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet', 'traceId', traceId) + const localVarPath = `/organization/{organizationId}/box/{boxId}/telemetry/traces/{traceId}` + .replace('{organizationId}', encodeURIComponent(String(organizationId))) + .replace('{boxId}', encodeURIComponent(String(boxId))) + .replace('{traceId}', encodeURIComponent(String(traceId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -269,7 +268,7 @@ export const TelemetryApiAxiosParamCreator = function (configuration?: Configura // authentication Bearer required await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) - + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -285,79 +284,78 @@ export const TelemetryApiAxiosParamCreator = function (configuration?: Configura /** * TelemetryApi - functional programming interface - * @export */ export const TelemetryApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = TelemetryApiAxiosParamCreator(configuration) return { /** - * Returns paginated log entries with optional severity and search filters - * @summary Get sandbox logs + * Retrieve OTEL logs for a box within a time range + * @summary Get box logs * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [severity] Comma-separated severity levels - * @param {string} [search] Search text (ILIKE) + * @param {string} [severity] Severity filter (comma-separated) + * @param {string} [search] Search filter * @param {number} [limit] Page size - * @param {number} [offset] Offset + * @param {number} [offset] Page offset * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet(organizationId: string, sandboxId: string, from: string, to: string, severity?: string, search?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet(organizationId, sandboxId, from, to, severity, search, limit, offset, options); + async organizationOrganizationIdBoxBoxIdTelemetryLogsGet(organizationId: string, boxId: string, from: string, to: string, severity?: string, search?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdBoxBoxIdTelemetryLogsGet(organizationId, boxId, from, to, severity, search, limit, offset, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TelemetryApi.organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['TelemetryApi.organizationOrganizationIdBoxBoxIdTelemetryLogsGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns gauge metrics aggregated in 1-minute intervals - * @summary Get sandbox metrics + * Retrieve OTEL metrics for a box within a time range + * @summary Get box metrics * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [metricNames] Comma-separated metric names + * @param {string} [metricNames] Metric names filter (comma-separated) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet(organizationId: string, sandboxId: string, from: string, to: string, metricNames?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet(organizationId, sandboxId, from, to, metricNames, options); + async organizationOrganizationIdBoxBoxIdTelemetryMetricsGet(organizationId: string, boxId: string, from: string, to: string, metricNames?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdBoxBoxIdTelemetryMetricsGet(organizationId, boxId, from, to, metricNames, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TelemetryApi.organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['TelemetryApi.organizationOrganizationIdBoxBoxIdTelemetryMetricsGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns paginated trace summaries with span counts and root span info - * @summary Get sandbox traces + * Retrieve OTEL trace summaries for a box within a time range + * @summary Get box traces * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {number} [limit] Page size - * @param {number} [offset] Offset + * @param {number} [offset] Page offset * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet(organizationId: string, sandboxId: string, from: string, to: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet(organizationId, sandboxId, from, to, limit, offset, options); + async organizationOrganizationIdBoxBoxIdTelemetryTracesGet(organizationId: string, boxId: string, from: string, to: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdBoxBoxIdTelemetryTracesGet(organizationId, boxId, from, to, limit, offset, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TelemetryApi.organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['TelemetryApi.organizationOrganizationIdBoxBoxIdTelemetryTracesGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns all spans belonging to a specific trace ID + * Retrieve all spans for a trace * @summary Get trace spans * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} traceId Trace ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet(organizationId: string, sandboxId: string, traceId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet(organizationId, sandboxId, traceId, options); + async organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet(organizationId: string, boxId: string, traceId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet(organizationId, boxId, traceId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TelemetryApi.organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['TelemetryApi.organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -365,142 +363,135 @@ export const TelemetryApiFp = function(configuration?: Configuration) { /** * TelemetryApi - factory interface - * @export */ export const TelemetryApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = TelemetryApiFp(configuration) return { /** - * Returns paginated log entries with optional severity and search filters - * @summary Get sandbox logs + * Retrieve OTEL logs for a box within a time range + * @summary Get box logs * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [severity] Comma-separated severity levels - * @param {string} [search] Search text (ILIKE) + * @param {string} [severity] Severity filter (comma-separated) + * @param {string} [search] Search filter * @param {number} [limit] Page size - * @param {number} [offset] Offset + * @param {number} [offset] Page offset * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet(organizationId: string, sandboxId: string, from: string, to: string, severity?: string, search?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet(organizationId, sandboxId, from, to, severity, search, limit, offset, options).then((request) => request(axios, basePath)); + organizationOrganizationIdBoxBoxIdTelemetryLogsGet(organizationId: string, boxId: string, from: string, to: string, severity?: string, search?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.organizationOrganizationIdBoxBoxIdTelemetryLogsGet(organizationId, boxId, from, to, severity, search, limit, offset, options).then((request) => request(axios, basePath)); }, /** - * Returns gauge metrics aggregated in 1-minute intervals - * @summary Get sandbox metrics + * Retrieve OTEL metrics for a box within a time range + * @summary Get box metrics * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [metricNames] Comma-separated metric names + * @param {string} [metricNames] Metric names filter (comma-separated) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet(organizationId: string, sandboxId: string, from: string, to: string, metricNames?: string, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet(organizationId, sandboxId, from, to, metricNames, options).then((request) => request(axios, basePath)); + organizationOrganizationIdBoxBoxIdTelemetryMetricsGet(organizationId: string, boxId: string, from: string, to: string, metricNames?: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.organizationOrganizationIdBoxBoxIdTelemetryMetricsGet(organizationId, boxId, from, to, metricNames, options).then((request) => request(axios, basePath)); }, /** - * Returns paginated trace summaries with span counts and root span info - * @summary Get sandbox traces + * Retrieve OTEL trace summaries for a box within a time range + * @summary Get box traces * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {number} [limit] Page size - * @param {number} [offset] Offset + * @param {number} [offset] Page offset * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet(organizationId: string, sandboxId: string, from: string, to: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet(organizationId, sandboxId, from, to, limit, offset, options).then((request) => request(axios, basePath)); + organizationOrganizationIdBoxBoxIdTelemetryTracesGet(organizationId: string, boxId: string, from: string, to: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.organizationOrganizationIdBoxBoxIdTelemetryTracesGet(organizationId, boxId, from, to, limit, offset, options).then((request) => request(axios, basePath)); }, /** - * Returns all spans belonging to a specific trace ID + * Retrieve all spans for a trace * @summary Get trace spans * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} traceId Trace ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet(organizationId: string, sandboxId: string, traceId: string, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet(organizationId, sandboxId, traceId, options).then((request) => request(axios, basePath)); + organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet(organizationId: string, boxId: string, traceId: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet(organizationId, boxId, traceId, options).then((request) => request(axios, basePath)); }, }; }; /** * TelemetryApi - object-oriented interface - * @export - * @class TelemetryApi - * @extends {BaseAPI} */ export class TelemetryApi extends BaseAPI { /** - * Returns paginated log entries with optional severity and search filters - * @summary Get sandbox logs + * Retrieve OTEL logs for a box within a time range + * @summary Get box logs * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [severity] Comma-separated severity levels - * @param {string} [search] Search text (ILIKE) + * @param {string} [severity] Severity filter (comma-separated) + * @param {string} [search] Search filter * @param {number} [limit] Page size - * @param {number} [offset] Offset + * @param {number} [offset] Page offset * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof TelemetryApi */ - public organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet(organizationId: string, sandboxId: string, from: string, to: string, severity?: string, search?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig) { - return TelemetryApiFp(this.configuration).organizationOrganizationIdSandboxSandboxIdTelemetryLogsGet(organizationId, sandboxId, from, to, severity, search, limit, offset, options).then((request) => request(this.axios, this.basePath)); + public organizationOrganizationIdBoxBoxIdTelemetryLogsGet(organizationId: string, boxId: string, from: string, to: string, severity?: string, search?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig) { + return TelemetryApiFp(this.configuration).organizationOrganizationIdBoxBoxIdTelemetryLogsGet(organizationId, boxId, from, to, severity, search, limit, offset, options).then((request) => request(this.axios, this.basePath)); } /** - * Returns gauge metrics aggregated in 1-minute intervals - * @summary Get sandbox metrics + * Retrieve OTEL metrics for a box within a time range + * @summary Get box metrics * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [metricNames] Comma-separated metric names + * @param {string} [metricNames] Metric names filter (comma-separated) * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof TelemetryApi */ - public organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet(organizationId: string, sandboxId: string, from: string, to: string, metricNames?: string, options?: RawAxiosRequestConfig) { - return TelemetryApiFp(this.configuration).organizationOrganizationIdSandboxSandboxIdTelemetryMetricsGet(organizationId, sandboxId, from, to, metricNames, options).then((request) => request(this.axios, this.basePath)); + public organizationOrganizationIdBoxBoxIdTelemetryMetricsGet(organizationId: string, boxId: string, from: string, to: string, metricNames?: string, options?: RawAxiosRequestConfig) { + return TelemetryApiFp(this.configuration).organizationOrganizationIdBoxBoxIdTelemetryMetricsGet(organizationId, boxId, from, to, metricNames, options).then((request) => request(this.axios, this.basePath)); } /** - * Returns paginated trace summaries with span counts and root span info - * @summary Get sandbox traces + * Retrieve OTEL trace summaries for a box within a time range + * @summary Get box traces * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {number} [limit] Page size - * @param {number} [offset] Offset + * @param {number} [offset] Page offset * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof TelemetryApi */ - public organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet(organizationId: string, sandboxId: string, from: string, to: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig) { - return TelemetryApiFp(this.configuration).organizationOrganizationIdSandboxSandboxIdTelemetryTracesGet(organizationId, sandboxId, from, to, limit, offset, options).then((request) => request(this.axios, this.basePath)); + public organizationOrganizationIdBoxBoxIdTelemetryTracesGet(organizationId: string, boxId: string, from: string, to: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig) { + return TelemetryApiFp(this.configuration).organizationOrganizationIdBoxBoxIdTelemetryTracesGet(organizationId, boxId, from, to, limit, offset, options).then((request) => request(this.axios, this.basePath)); } /** - * Returns all spans belonging to a specific trace ID + * Retrieve all spans for a trace * @summary Get trace spans * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} traceId Trace ID * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof TelemetryApi */ - public organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet(organizationId: string, sandboxId: string, traceId: string, options?: RawAxiosRequestConfig) { - return TelemetryApiFp(this.configuration).organizationOrganizationIdSandboxSandboxIdTelemetryTracesTraceIdGet(organizationId, sandboxId, traceId, options).then((request) => request(this.axios, this.basePath)); + public organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet(organizationId: string, boxId: string, traceId: string, options?: RawAxiosRequestConfig) { + return TelemetryApiFp(this.configuration).organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet(organizationId, boxId, traceId, options).then((request) => request(this.axios, this.basePath)); } } + diff --git a/apps/libs/analytics-api-client/src/api/usage-api.ts b/apps/libs/analytics-api-client/src/api/usage-api.ts index d7df7b149..3a9ffd16b 100644 --- a/apps/libs/analytics-api-client/src/api/usage-api.ts +++ b/apps/libs/analytics-api-client/src/api/usage-api.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -18,45 +18,44 @@ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { ModelsAggregatedUsage } from '../models'; // @ts-ignore -import type { ModelsSandboxUsage } from '../models'; +import type { ModelsBoxUsage } from '../models'; // @ts-ignore import type { ModelsUsageChartPoint } from '../models'; // @ts-ignore import type { ModelsUsagePeriod } from '../models'; /** * UsageApi - axios parameter creator - * @export */ export const UsageApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Returns individual usage records for a specific sandbox within a time range - * @summary Get sandbox usage periods + * Retrieve usage periods for a specific box within a time range + * @summary Get box usage periods * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdUsageGet: async (organizationId: string, sandboxId: string, from: string, to: string, options: RawAxiosRequestConfig = {}): Promise => { + organizationOrganizationIdBoxBoxIdUsageGet: async (organizationId: string, boxId: string, from: string, to: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'organizationId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdUsageGet', 'organizationId', organizationId) - // verify required parameter 'sandboxId' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdUsageGet', 'sandboxId', sandboxId) + assertParamExists('organizationOrganizationIdBoxBoxIdUsageGet', 'organizationId', organizationId) + // verify required parameter 'boxId' is not null or undefined + assertParamExists('organizationOrganizationIdBoxBoxIdUsageGet', 'boxId', boxId) // verify required parameter 'from' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdUsageGet', 'from', from) + assertParamExists('organizationOrganizationIdBoxBoxIdUsageGet', 'from', from) // verify required parameter 'to' is not null or undefined - assertParamExists('organizationOrganizationIdSandboxSandboxIdUsageGet', 'to', to) - const localVarPath = `/organization/{organizationId}/sandbox/{sandboxId}/usage` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))) - .replace(`{${"sandboxId"}}`, encodeURIComponent(String(sandboxId))); + assertParamExists('organizationOrganizationIdBoxBoxIdUsageGet', 'to', to) + const localVarPath = `/organization/{organizationId}/box/{boxId}/usage` + .replace('{organizationId}', encodeURIComponent(String(organizationId))) + .replace('{boxId}', encodeURIComponent(String(boxId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -79,7 +78,7 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['to'] = to; } - + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -91,7 +90,7 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Returns organization-level resource usage totals for a given time period + * Retrieve aggregated usage for an organization within a time range * @summary Get aggregated usage * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) @@ -107,7 +106,7 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration // verify required parameter 'to' is not null or undefined assertParamExists('organizationOrganizationIdUsageAggregatedGet', 'to', to) const localVarPath = `/organization/{organizationId}/usage/aggregated` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))); + .replace('{organizationId}', encodeURIComponent(String(organizationId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -130,7 +129,7 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['to'] = to; } - + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -142,24 +141,23 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Returns per-minute resource usage data points for a given time period - * @summary Get usage chart data + * Retrieve per-box usage for an organization within a time range + * @summary Get per-box usage * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [region] Region filter * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdUsageChartGet: async (organizationId: string, from: string, to: string, region?: string, options: RawAxiosRequestConfig = {}): Promise => { + organizationOrganizationIdUsageBoxGet: async (organizationId: string, from: string, to: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'organizationId' is not null or undefined - assertParamExists('organizationOrganizationIdUsageChartGet', 'organizationId', organizationId) + assertParamExists('organizationOrganizationIdUsageBoxGet', 'organizationId', organizationId) // verify required parameter 'from' is not null or undefined - assertParamExists('organizationOrganizationIdUsageChartGet', 'from', from) + assertParamExists('organizationOrganizationIdUsageBoxGet', 'from', from) // verify required parameter 'to' is not null or undefined - assertParamExists('organizationOrganizationIdUsageChartGet', 'to', to) - const localVarPath = `/organization/{organizationId}/usage/chart` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))); + assertParamExists('organizationOrganizationIdUsageBoxGet', 'to', to) + const localVarPath = `/organization/{organizationId}/usage/box` + .replace('{organizationId}', encodeURIComponent(String(organizationId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -182,11 +180,7 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['to'] = to; } - if (region !== undefined) { - localVarQueryParameter['region'] = region; - } - - + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -198,23 +192,24 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Returns resource usage aggregated per sandbox for a given time period - * @summary Get per-sandbox usage + * Retrieve usage chart data points for an organization within a time range + * @summary Get usage chart data * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) + * @param {string} [region] Region filter * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdUsageSandboxGet: async (organizationId: string, from: string, to: string, options: RawAxiosRequestConfig = {}): Promise => { + organizationOrganizationIdUsageChartGet: async (organizationId: string, from: string, to: string, region?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'organizationId' is not null or undefined - assertParamExists('organizationOrganizationIdUsageSandboxGet', 'organizationId', organizationId) + assertParamExists('organizationOrganizationIdUsageChartGet', 'organizationId', organizationId) // verify required parameter 'from' is not null or undefined - assertParamExists('organizationOrganizationIdUsageSandboxGet', 'from', from) + assertParamExists('organizationOrganizationIdUsageChartGet', 'from', from) // verify required parameter 'to' is not null or undefined - assertParamExists('organizationOrganizationIdUsageSandboxGet', 'to', to) - const localVarPath = `/organization/{organizationId}/usage/sandbox` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))); + assertParamExists('organizationOrganizationIdUsageChartGet', 'to', to) + const localVarPath = `/organization/{organizationId}/usage/chart` + .replace('{organizationId}', encodeURIComponent(String(organizationId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -237,7 +232,11 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['to'] = to; } + if (region !== undefined) { + localVarQueryParameter['region'] = region; + } + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -253,29 +252,28 @@ export const UsageApiAxiosParamCreator = function (configuration?: Configuration /** * UsageApi - functional programming interface - * @export */ export const UsageApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = UsageApiAxiosParamCreator(configuration) return { /** - * Returns individual usage records for a specific sandbox within a time range - * @summary Get sandbox usage periods + * Retrieve usage periods for a specific box within a time range + * @summary Get box usage periods * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async organizationOrganizationIdSandboxSandboxIdUsageGet(organizationId: string, sandboxId: string, from: string, to: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdSandboxSandboxIdUsageGet(organizationId, sandboxId, from, to, options); + async organizationOrganizationIdBoxBoxIdUsageGet(organizationId: string, boxId: string, from: string, to: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdBoxBoxIdUsageGet(organizationId, boxId, from, to, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UsageApi.organizationOrganizationIdSandboxSandboxIdUsageGet']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UsageApi.organizationOrganizationIdBoxBoxIdUsageGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns organization-level resource usage totals for a given time period + * Retrieve aggregated usage for an organization within a time range * @summary Get aggregated usage * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) @@ -290,34 +288,34 @@ export const UsageApiFp = function(configuration?: Configuration) { return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns per-minute resource usage data points for a given time period - * @summary Get usage chart data + * Retrieve per-box usage for an organization within a time range + * @summary Get per-box usage * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [region] Region filter * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async organizationOrganizationIdUsageChartGet(organizationId: string, from: string, to: string, region?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdUsageChartGet(organizationId, from, to, region, options); + async organizationOrganizationIdUsageBoxGet(organizationId: string, from: string, to: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdUsageBoxGet(organizationId, from, to, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UsageApi.organizationOrganizationIdUsageChartGet']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UsageApi.organizationOrganizationIdUsageBoxGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns resource usage aggregated per sandbox for a given time period - * @summary Get per-sandbox usage + * Retrieve usage chart data points for an organization within a time range + * @summary Get usage chart data * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) + * @param {string} [region] Region filter * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async organizationOrganizationIdUsageSandboxGet(organizationId: string, from: string, to: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdUsageSandboxGet(organizationId, from, to, options); + async organizationOrganizationIdUsageChartGet(organizationId: string, from: string, to: string, region?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.organizationOrganizationIdUsageChartGet(organizationId, from, to, region, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UsageApi.organizationOrganizationIdUsageSandboxGet']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UsageApi.organizationOrganizationIdUsageChartGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -325,26 +323,25 @@ export const UsageApiFp = function(configuration?: Configuration) { /** * UsageApi - factory interface - * @export */ export const UsageApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = UsageApiFp(configuration) return { /** - * Returns individual usage records for a specific sandbox within a time range - * @summary Get sandbox usage periods + * Retrieve usage periods for a specific box within a time range + * @summary Get box usage periods * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdSandboxSandboxIdUsageGet(organizationId: string, sandboxId: string, from: string, to: string, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.organizationOrganizationIdSandboxSandboxIdUsageGet(organizationId, sandboxId, from, to, options).then((request) => request(axios, basePath)); + organizationOrganizationIdBoxBoxIdUsageGet(organizationId: string, boxId: string, from: string, to: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.organizationOrganizationIdBoxBoxIdUsageGet(organizationId, boxId, from, to, options).then((request) => request(axios, basePath)); }, /** - * Returns organization-level resource usage totals for a given time period + * Retrieve aggregated usage for an organization within a time range * @summary Get aggregated usage * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) @@ -356,95 +353,89 @@ export const UsageApiFactory = function (configuration?: Configuration, basePath return localVarFp.organizationOrganizationIdUsageAggregatedGet(organizationId, from, to, options).then((request) => request(axios, basePath)); }, /** - * Returns per-minute resource usage data points for a given time period - * @summary Get usage chart data + * Retrieve per-box usage for an organization within a time range + * @summary Get per-box usage * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [region] Region filter * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdUsageChartGet(organizationId: string, from: string, to: string, region?: string, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.organizationOrganizationIdUsageChartGet(organizationId, from, to, region, options).then((request) => request(axios, basePath)); + organizationOrganizationIdUsageBoxGet(organizationId: string, from: string, to: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.organizationOrganizationIdUsageBoxGet(organizationId, from, to, options).then((request) => request(axios, basePath)); }, /** - * Returns resource usage aggregated per sandbox for a given time period - * @summary Get per-sandbox usage + * Retrieve usage chart data points for an organization within a time range + * @summary Get usage chart data * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) + * @param {string} [region] Region filter * @param {*} [options] Override http request option. * @throws {RequiredError} */ - organizationOrganizationIdUsageSandboxGet(organizationId: string, from: string, to: string, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.organizationOrganizationIdUsageSandboxGet(organizationId, from, to, options).then((request) => request(axios, basePath)); + organizationOrganizationIdUsageChartGet(organizationId: string, from: string, to: string, region?: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.organizationOrganizationIdUsageChartGet(organizationId, from, to, region, options).then((request) => request(axios, basePath)); }, }; }; /** * UsageApi - object-oriented interface - * @export - * @class UsageApi - * @extends {BaseAPI} */ export class UsageApi extends BaseAPI { /** - * Returns individual usage records for a specific sandbox within a time range - * @summary Get sandbox usage periods + * Retrieve usage periods for a specific box within a time range + * @summary Get box usage periods * @param {string} organizationId Organization ID - * @param {string} sandboxId Sandbox ID + * @param {string} boxId Box ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UsageApi */ - public organizationOrganizationIdSandboxSandboxIdUsageGet(organizationId: string, sandboxId: string, from: string, to: string, options?: RawAxiosRequestConfig) { - return UsageApiFp(this.configuration).organizationOrganizationIdSandboxSandboxIdUsageGet(organizationId, sandboxId, from, to, options).then((request) => request(this.axios, this.basePath)); + public organizationOrganizationIdBoxBoxIdUsageGet(organizationId: string, boxId: string, from: string, to: string, options?: RawAxiosRequestConfig) { + return UsageApiFp(this.configuration).organizationOrganizationIdBoxBoxIdUsageGet(organizationId, boxId, from, to, options).then((request) => request(this.axios, this.basePath)); } /** - * Returns organization-level resource usage totals for a given time period + * Retrieve aggregated usage for an organization within a time range * @summary Get aggregated usage * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UsageApi */ public organizationOrganizationIdUsageAggregatedGet(organizationId: string, from: string, to: string, options?: RawAxiosRequestConfig) { return UsageApiFp(this.configuration).organizationOrganizationIdUsageAggregatedGet(organizationId, from, to, options).then((request) => request(this.axios, this.basePath)); } /** - * Returns per-minute resource usage data points for a given time period - * @summary Get usage chart data + * Retrieve per-box usage for an organization within a time range + * @summary Get per-box usage * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) - * @param {string} [region] Region filter * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UsageApi */ - public organizationOrganizationIdUsageChartGet(organizationId: string, from: string, to: string, region?: string, options?: RawAxiosRequestConfig) { - return UsageApiFp(this.configuration).organizationOrganizationIdUsageChartGet(organizationId, from, to, region, options).then((request) => request(this.axios, this.basePath)); + public organizationOrganizationIdUsageBoxGet(organizationId: string, from: string, to: string, options?: RawAxiosRequestConfig) { + return UsageApiFp(this.configuration).organizationOrganizationIdUsageBoxGet(organizationId, from, to, options).then((request) => request(this.axios, this.basePath)); } /** - * Returns resource usage aggregated per sandbox for a given time period - * @summary Get per-sandbox usage + * Retrieve usage chart data points for an organization within a time range + * @summary Get usage chart data * @param {string} organizationId Organization ID * @param {string} from Start time (RFC3339) * @param {string} to End time (RFC3339) + * @param {string} [region] Region filter * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UsageApi */ - public organizationOrganizationIdUsageSandboxGet(organizationId: string, from: string, to: string, options?: RawAxiosRequestConfig) { - return UsageApiFp(this.configuration).organizationOrganizationIdUsageSandboxGet(organizationId, from, to, options).then((request) => request(this.axios, this.basePath)); + public organizationOrganizationIdUsageChartGet(organizationId: string, from: string, to: string, region?: string, options?: RawAxiosRequestConfig) { + return UsageApiFp(this.configuration).organizationOrganizationIdUsageChartGet(organizationId, from, to, region, options).then((request) => request(this.axios, this.basePath)); } } + diff --git a/apps/libs/analytics-api-client/src/base.ts b/apps/libs/analytics-api-client/src/base.ts index 847db2d2d..a1b565dd8 100644 --- a/apps/libs/analytics-api-client/src/base.ts +++ b/apps/libs/analytics-api-client/src/base.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -21,10 +21,6 @@ import globalAxios from 'axios'; export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, ""); -/** - * - * @export - */ export const COLLECTION_FORMATS = { csv: ",", ssv: " ", @@ -32,21 +28,11 @@ export const COLLECTION_FORMATS = { pipes: "|", }; -/** - * - * @export - * @interface RequestArgs - */ export interface RequestArgs { url: string; options: RawAxiosRequestConfig; } -/** - * - * @export - * @class BaseAPI - */ export class BaseAPI { protected configuration: Configuration | undefined; @@ -58,12 +44,6 @@ export class BaseAPI { } }; -/** - * - * @export - * @class RequiredError - * @extends {Error} - */ export class RequiredError extends Error { constructor(public field: string, msg?: string) { super(msg); @@ -78,9 +58,5 @@ interface ServerMap { }[]; } -/** - * - * @export - */ export const operationServerMap: ServerMap = { } diff --git a/apps/libs/analytics-api-client/src/common.ts b/apps/libs/analytics-api-client/src/common.ts index 0c224f15d..d2344cfb2 100644 --- a/apps/libs/analytics-api-client/src/common.ts +++ b/apps/libs/analytics-api-client/src/common.ts @@ -5,29 +5,23 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - import type { Configuration } from "./configuration"; import type { RequestArgs } from "./base"; import type { AxiosInstance, AxiosResponse } from 'axios'; import { RequiredError } from "./base"; -/** - * - * @export - */ export const DUMMY_BASE_URL = 'https://example.com' /** * * @throws {RequiredError} - * @export */ export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { if (paramValue === null || paramValue === undefined) { @@ -35,10 +29,6 @@ export const assertParamExists = function (functionName: string, paramName: stri } } -/** - * - * @export - */ export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' @@ -48,20 +38,12 @@ export const setApiKeyToObject = async function (object: any, keyParamName: stri } } -/** - * - * @export - */ export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { if (configuration && (configuration.username || configuration.password)) { object["auth"] = { username: configuration.username, password: configuration.password }; } } -/** - * - * @export - */ export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { if (configuration && configuration.accessToken) { const accessToken = typeof configuration.accessToken === 'function' @@ -71,10 +53,6 @@ export const setBearerAuthToObject = async function (object: any, configuration? } } -/** - * - * @export - */ export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' @@ -84,10 +62,11 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } + function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { if (parameter == null) return; if (typeof parameter === "object") { - if (Array.isArray(parameter)) { + if (Array.isArray(parameter) || parameter instanceof Set) { (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); } else { @@ -106,10 +85,6 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an } } -/** - * - * @export - */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); setFlattenedQueryParams(searchParams, objects); @@ -117,31 +92,33 @@ export const setSearchParams = function (url: URL, ...objects: any[]) { } /** - * - * @export + * JSON serialization helper function which replaces instances of unserializable types with serializable ones. + * This function will run for every key-value pair encountered by JSON.stringify while traversing an object. + * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required. */ +// @ts-ignore +export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) { + if (value instanceof Set) { + return Array.from(value); + } else { + return value; + } +} + export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { const nonString = typeof value !== 'string'; const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) + ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded) : (value || ""); } -/** - * - * @export - */ export const toPathString = function (url: URL) { return url.pathname + url.search + url.hash } -/** - * - * @export - */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; diff --git a/apps/libs/analytics-api-client/src/configuration.ts b/apps/libs/analytics-api-client/src/configuration.ts index 9a0bbc5b8..c35f9aede 100644 --- a/apps/libs/analytics-api-client/src/configuration.ts +++ b/apps/libs/analytics-api-client/src/configuration.ts @@ -1,23 +1,34 @@ /* tslint:disable */ -/* eslint-disable */ /** * BoxLite Analytics API * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ +interface AWSv4Configuration { + options?: { + region?: string + service?: string + } + credentials?: { + accessKeyId?: string + secretAccessKey?: string, + sessionToken?: string + } +} export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + awsv4?: AWSv4Configuration; basePath?: string; serverIndex?: number; baseOptions?: any; @@ -28,49 +39,43 @@ export class Configuration { /** * parameter for apiKey security * @param name security name - * @memberof Configuration */ apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * - * @type {string} - * @memberof Configuration */ username?: string; /** * parameter for basic security - * - * @type {string} - * @memberof Configuration */ password?: string; /** * parameter for oauth2 security * @param name security name * @param scopes oauth2 scope - * @memberof Configuration */ accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** - * override base path - * - * @type {string} + * parameter for aws4 signature security + * @param {Object} AWS4Signature - AWS4 Signature security + * @param {string} options.region - aws region + * @param {string} options.service - name of the service. + * @param {string} credentials.accessKeyId - aws access key id + * @param {string} credentials.secretAccessKey - aws access key + * @param {string} credentials.sessionToken - aws session token * @memberof Configuration */ + awsv4?: AWSv4Configuration; + /** + * override base path + */ basePath?: string; /** * override server index - * - * @type {number} - * @memberof Configuration */ serverIndex?: number; /** * base options for axios calls - * - * @type {any} - * @memberof Configuration */ baseOptions?: any; /** @@ -87,6 +92,7 @@ export class Configuration { this.username = param.username; this.password = param.password; this.accessToken = param.accessToken; + this.awsv4 = param.awsv4; this.basePath = param.basePath; this.serverIndex = param.serverIndex; this.baseOptions = { @@ -109,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/apps/libs/analytics-api-client/src/docs/ModelsAggregatedUsage.md b/apps/libs/analytics-api-client/src/docs/ModelsAggregatedUsage.md new file mode 100644 index 000000000..1bc142169 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/ModelsAggregatedUsage.md @@ -0,0 +1,34 @@ +# ModelsAggregatedUsage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**boxCount** | **number** | | [optional] [default to undefined] +**firstStart** | **string** | | [optional] [default to undefined] +**lastEnd** | **string** | | [optional] [default to undefined] +**totalCPUSeconds** | **number** | | [optional] [default to undefined] +**totalDiskGBSeconds** | **number** | | [optional] [default to undefined] +**totalGPUSeconds** | **number** | | [optional] [default to undefined] +**totalPrice** | **number** | | [optional] [default to undefined] +**totalRAMGBSeconds** | **number** | | [optional] [default to undefined] + +## Example + +```typescript +import { ModelsAggregatedUsage } from './api'; + +const instance: ModelsAggregatedUsage = { + boxCount, + firstStart, + lastEnd, + totalCPUSeconds, + totalDiskGBSeconds, + totalGPUSeconds, + totalPrice, + totalRAMGBSeconds, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/apps/libs/analytics-api-client/src/docs/ModelsBoxUsage.md b/apps/libs/analytics-api-client/src/docs/ModelsBoxUsage.md new file mode 100644 index 000000000..74e24ecb5 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/ModelsBoxUsage.md @@ -0,0 +1,34 @@ +# ModelsBoxUsage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**boxId** | **string** | | [optional] [default to undefined] +**firstStart** | **string** | | [optional] [default to undefined] +**lastEnd** | **string** | | [optional] [default to undefined] +**totalCPUSeconds** | **number** | | [optional] [default to undefined] +**totalDiskGBSeconds** | **number** | | [optional] [default to undefined] +**totalGPUSeconds** | **number** | | [optional] [default to undefined] +**totalPrice** | **number** | | [optional] [default to undefined] +**totalRAMGBSeconds** | **number** | | [optional] [default to undefined] + +## Example + +```typescript +import { ModelsBoxUsage } from './api'; + +const instance: ModelsBoxUsage = { + boxId, + firstStart, + lastEnd, + totalCPUSeconds, + totalDiskGBSeconds, + totalGPUSeconds, + totalPrice, + totalRAMGBSeconds, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/apps/libs/analytics-api-client/src/docs/ModelsLogEntry.md b/apps/libs/analytics-api-client/src/docs/ModelsLogEntry.md new file mode 100644 index 000000000..94f7a64c7 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/ModelsLogEntry.md @@ -0,0 +1,36 @@ +# ModelsLogEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **string** | | [optional] [default to undefined] +**logAttributes** | **{ [key: string]: string; }** | | [optional] [default to undefined] +**resourceAttributes** | **{ [key: string]: string; }** | | [optional] [default to undefined] +**serviceName** | **string** | | [optional] [default to undefined] +**severityNumber** | **number** | | [optional] [default to undefined] +**severityText** | **string** | | [optional] [default to undefined] +**spanId** | **string** | | [optional] [default to undefined] +**timestamp** | **string** | | [optional] [default to undefined] +**traceId** | **string** | | [optional] [default to undefined] + +## Example + +```typescript +import { ModelsLogEntry } from './api'; + +const instance: ModelsLogEntry = { + body, + logAttributes, + resourceAttributes, + serviceName, + severityNumber, + severityText, + spanId, + timestamp, + traceId, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/apps/libs/analytics-api-client/src/docs/ModelsMetricPoint.md b/apps/libs/analytics-api-client/src/docs/ModelsMetricPoint.md new file mode 100644 index 000000000..700d9025f --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/ModelsMetricPoint.md @@ -0,0 +1,24 @@ +# ModelsMetricPoint + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metricName** | **string** | | [optional] [default to undefined] +**timestamp** | **string** | | [optional] [default to undefined] +**value** | **number** | | [optional] [default to undefined] + +## Example + +```typescript +import { ModelsMetricPoint } from './api'; + +const instance: ModelsMetricPoint = { + metricName, + timestamp, + value, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/apps/libs/analytics-api-client/src/docs/ModelsSpan.md b/apps/libs/analytics-api-client/src/docs/ModelsSpan.md new file mode 100644 index 000000000..11fffe2f2 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/ModelsSpan.md @@ -0,0 +1,36 @@ +# ModelsSpan + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**durationMs** | **number** | | [optional] [default to undefined] +**parentSpanId** | **string** | | [optional] [default to undefined] +**spanAttributes** | **{ [key: string]: string; }** | | [optional] [default to undefined] +**spanId** | **string** | | [optional] [default to undefined] +**spanName** | **string** | | [optional] [default to undefined] +**statusCode** | **string** | | [optional] [default to undefined] +**statusMessage** | **string** | | [optional] [default to undefined] +**timestamp** | **string** | | [optional] [default to undefined] +**traceId** | **string** | | [optional] [default to undefined] + +## Example + +```typescript +import { ModelsSpan } from './api'; + +const instance: ModelsSpan = { + durationMs, + parentSpanId, + spanAttributes, + spanId, + spanName, + statusCode, + statusMessage, + timestamp, + traceId, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/apps/libs/analytics-api-client/src/docs/ModelsTraceSummary.md b/apps/libs/analytics-api-client/src/docs/ModelsTraceSummary.md new file mode 100644 index 000000000..c1cae5f99 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/ModelsTraceSummary.md @@ -0,0 +1,32 @@ +# ModelsTraceSummary + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endTime** | **string** | | [optional] [default to undefined] +**rootSpanName** | **string** | | [optional] [default to undefined] +**spanCount** | **number** | | [optional] [default to undefined] +**startTime** | **string** | | [optional] [default to undefined] +**statusCode** | **string** | | [optional] [default to undefined] +**totalDurationMs** | **number** | | [optional] [default to undefined] +**traceId** | **string** | | [optional] [default to undefined] + +## Example + +```typescript +import { ModelsTraceSummary } from './api'; + +const instance: ModelsTraceSummary = { + endTime, + rootSpanName, + spanCount, + startTime, + statusCode, + totalDurationMs, + traceId, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/apps/libs/analytics-api-client/src/docs/ModelsUsageChartPoint.md b/apps/libs/analytics-api-client/src/docs/ModelsUsageChartPoint.md new file mode 100644 index 000000000..ed3561553 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/ModelsUsageChartPoint.md @@ -0,0 +1,32 @@ +# ModelsUsageChartPoint + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cpu** | **number** | | [optional] [default to undefined] +**cpuPrice** | **number** | | [optional] [default to undefined] +**diskGB** | **number** | | [optional] [default to undefined] +**diskPrice** | **number** | | [optional] [default to undefined] +**ramGB** | **number** | | [optional] [default to undefined] +**ramPrice** | **number** | | [optional] [default to undefined] +**time** | **string** | | [optional] [default to undefined] + +## Example + +```typescript +import { ModelsUsageChartPoint } from './api'; + +const instance: ModelsUsageChartPoint = { + cpu, + cpuPrice, + diskGB, + diskPrice, + ramGB, + ramPrice, + time, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/apps/libs/analytics-api-client/src/docs/ModelsUsagePeriod.md b/apps/libs/analytics-api-client/src/docs/ModelsUsagePeriod.md new file mode 100644 index 000000000..5cb486ca9 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/ModelsUsagePeriod.md @@ -0,0 +1,32 @@ +# ModelsUsagePeriod + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cpu** | **number** | | [optional] [default to undefined] +**diskGB** | **number** | | [optional] [default to undefined] +**endAt** | **string** | | [optional] [default to undefined] +**gpu** | **number** | | [optional] [default to undefined] +**price** | **number** | | [optional] [default to undefined] +**ramGB** | **number** | | [optional] [default to undefined] +**startAt** | **string** | | [optional] [default to undefined] + +## Example + +```typescript +import { ModelsUsagePeriod } from './api'; + +const instance: ModelsUsagePeriod = { + cpu, + diskGB, + endAt, + gpu, + price, + ramGB, + startAt, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/apps/libs/analytics-api-client/src/docs/TelemetryApi.md b/apps/libs/analytics-api-client/src/docs/TelemetryApi.md new file mode 100644 index 000000000..41a51bf78 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/TelemetryApi.md @@ -0,0 +1,269 @@ +# TelemetryApi + +All URIs are relative to *http://localhost:8080* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**organizationOrganizationIdBoxBoxIdTelemetryLogsGet**](#organizationorganizationidboxboxidtelemetrylogsget) | **GET** /organization/{organizationId}/box/{boxId}/telemetry/logs | Get box logs| +|[**organizationOrganizationIdBoxBoxIdTelemetryMetricsGet**](#organizationorganizationidboxboxidtelemetrymetricsget) | **GET** /organization/{organizationId}/box/{boxId}/telemetry/metrics | Get box metrics| +|[**organizationOrganizationIdBoxBoxIdTelemetryTracesGet**](#organizationorganizationidboxboxidtelemetrytracesget) | **GET** /organization/{organizationId}/box/{boxId}/telemetry/traces | Get box traces| +|[**organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet**](#organizationorganizationidboxboxidtelemetrytracestraceidget) | **GET** /organization/{organizationId}/box/{boxId}/telemetry/traces/{traceId} | Get trace spans| + +# **organizationOrganizationIdBoxBoxIdTelemetryLogsGet** +> Array organizationOrganizationIdBoxBoxIdTelemetryLogsGet() + +Retrieve OTEL logs for a box within a time range + +### Example + +```typescript +import { + TelemetryApi, + Configuration +} from './api'; + +const configuration = new Configuration(); +const apiInstance = new TelemetryApi(configuration); + +let organizationId: string; //Organization ID (default to undefined) +let boxId: string; //Box ID (default to undefined) +let from: string; //Start time (RFC3339) (default to undefined) +let to: string; //End time (RFC3339) (default to undefined) +let severity: string; //Severity filter (comma-separated) (optional) (default to undefined) +let search: string; //Search filter (optional) (default to undefined) +let limit: number; //Page size (optional) (default to undefined) +let offset: number; //Page offset (optional) (default to undefined) + +const { status, data } = await apiInstance.organizationOrganizationIdBoxBoxIdTelemetryLogsGet( + organizationId, + boxId, + from, + to, + severity, + search, + limit, + offset +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **organizationId** | [**string**] | Organization ID | defaults to undefined| +| **boxId** | [**string**] | Box ID | defaults to undefined| +| **from** | [**string**] | Start time (RFC3339) | defaults to undefined| +| **to** | [**string**] | End time (RFC3339) | defaults to undefined| +| **severity** | [**string**] | Severity filter (comma-separated) | (optional) defaults to undefined| +| **search** | [**string**] | Search filter | (optional) defaults to undefined| +| **limit** | [**number**] | Page size | (optional) defaults to undefined| +| **offset** | [**number**] | Page offset | (optional) defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organizationOrganizationIdBoxBoxIdTelemetryMetricsGet** +> Array organizationOrganizationIdBoxBoxIdTelemetryMetricsGet() + +Retrieve OTEL metrics for a box within a time range + +### Example + +```typescript +import { + TelemetryApi, + Configuration +} from './api'; + +const configuration = new Configuration(); +const apiInstance = new TelemetryApi(configuration); + +let organizationId: string; //Organization ID (default to undefined) +let boxId: string; //Box ID (default to undefined) +let from: string; //Start time (RFC3339) (default to undefined) +let to: string; //End time (RFC3339) (default to undefined) +let metricNames: string; //Metric names filter (comma-separated) (optional) (default to undefined) + +const { status, data } = await apiInstance.organizationOrganizationIdBoxBoxIdTelemetryMetricsGet( + organizationId, + boxId, + from, + to, + metricNames +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **organizationId** | [**string**] | Organization ID | defaults to undefined| +| **boxId** | [**string**] | Box ID | defaults to undefined| +| **from** | [**string**] | Start time (RFC3339) | defaults to undefined| +| **to** | [**string**] | End time (RFC3339) | defaults to undefined| +| **metricNames** | [**string**] | Metric names filter (comma-separated) | (optional) defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organizationOrganizationIdBoxBoxIdTelemetryTracesGet** +> Array organizationOrganizationIdBoxBoxIdTelemetryTracesGet() + +Retrieve OTEL trace summaries for a box within a time range + +### Example + +```typescript +import { + TelemetryApi, + Configuration +} from './api'; + +const configuration = new Configuration(); +const apiInstance = new TelemetryApi(configuration); + +let organizationId: string; //Organization ID (default to undefined) +let boxId: string; //Box ID (default to undefined) +let from: string; //Start time (RFC3339) (default to undefined) +let to: string; //End time (RFC3339) (default to undefined) +let limit: number; //Page size (optional) (default to undefined) +let offset: number; //Page offset (optional) (default to undefined) + +const { status, data } = await apiInstance.organizationOrganizationIdBoxBoxIdTelemetryTracesGet( + organizationId, + boxId, + from, + to, + limit, + offset +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **organizationId** | [**string**] | Organization ID | defaults to undefined| +| **boxId** | [**string**] | Box ID | defaults to undefined| +| **from** | [**string**] | Start time (RFC3339) | defaults to undefined| +| **to** | [**string**] | End time (RFC3339) | defaults to undefined| +| **limit** | [**number**] | Page size | (optional) defaults to undefined| +| **offset** | [**number**] | Page offset | (optional) defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet** +> Array organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet() + +Retrieve all spans for a trace + +### Example + +```typescript +import { + TelemetryApi, + Configuration +} from './api'; + +const configuration = new Configuration(); +const apiInstance = new TelemetryApi(configuration); + +let organizationId: string; //Organization ID (default to undefined) +let boxId: string; //Box ID (default to undefined) +let traceId: string; //Trace ID (default to undefined) + +const { status, data } = await apiInstance.organizationOrganizationIdBoxBoxIdTelemetryTracesTraceIdGet( + organizationId, + boxId, + traceId +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **organizationId** | [**string**] | Organization ID | defaults to undefined| +| **boxId** | [**string**] | Box ID | defaults to undefined| +| **traceId** | [**string**] | Trace ID | defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/apps/libs/analytics-api-client/src/docs/UsageApi.md b/apps/libs/analytics-api-client/src/docs/UsageApi.md new file mode 100644 index 000000000..791da42e9 --- /dev/null +++ b/apps/libs/analytics-api-client/src/docs/UsageApi.md @@ -0,0 +1,245 @@ +# UsageApi + +All URIs are relative to *http://localhost:8080* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**organizationOrganizationIdBoxBoxIdUsageGet**](#organizationorganizationidboxboxidusageget) | **GET** /organization/{organizationId}/box/{boxId}/usage | Get box usage periods| +|[**organizationOrganizationIdUsageAggregatedGet**](#organizationorganizationidusageaggregatedget) | **GET** /organization/{organizationId}/usage/aggregated | Get aggregated usage| +|[**organizationOrganizationIdUsageBoxGet**](#organizationorganizationidusageboxget) | **GET** /organization/{organizationId}/usage/box | Get per-box usage| +|[**organizationOrganizationIdUsageChartGet**](#organizationorganizationidusagechartget) | **GET** /organization/{organizationId}/usage/chart | Get usage chart data| + +# **organizationOrganizationIdBoxBoxIdUsageGet** +> Array organizationOrganizationIdBoxBoxIdUsageGet() + +Retrieve usage periods for a specific box within a time range + +### Example + +```typescript +import { + UsageApi, + Configuration +} from './api'; + +const configuration = new Configuration(); +const apiInstance = new UsageApi(configuration); + +let organizationId: string; //Organization ID (default to undefined) +let boxId: string; //Box ID (default to undefined) +let from: string; //Start time (RFC3339) (default to undefined) +let to: string; //End time (RFC3339) (default to undefined) + +const { status, data } = await apiInstance.organizationOrganizationIdBoxBoxIdUsageGet( + organizationId, + boxId, + from, + to +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **organizationId** | [**string**] | Organization ID | defaults to undefined| +| **boxId** | [**string**] | Box ID | defaults to undefined| +| **from** | [**string**] | Start time (RFC3339) | defaults to undefined| +| **to** | [**string**] | End time (RFC3339) | defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organizationOrganizationIdUsageAggregatedGet** +> ModelsAggregatedUsage organizationOrganizationIdUsageAggregatedGet() + +Retrieve aggregated usage for an organization within a time range + +### Example + +```typescript +import { + UsageApi, + Configuration +} from './api'; + +const configuration = new Configuration(); +const apiInstance = new UsageApi(configuration); + +let organizationId: string; //Organization ID (default to undefined) +let from: string; //Start time (RFC3339) (default to undefined) +let to: string; //End time (RFC3339) (default to undefined) + +const { status, data } = await apiInstance.organizationOrganizationIdUsageAggregatedGet( + organizationId, + from, + to +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **organizationId** | [**string**] | Organization ID | defaults to undefined| +| **from** | [**string**] | Start time (RFC3339) | defaults to undefined| +| **to** | [**string**] | End time (RFC3339) | defaults to undefined| + + +### Return type + +**ModelsAggregatedUsage** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organizationOrganizationIdUsageBoxGet** +> Array organizationOrganizationIdUsageBoxGet() + +Retrieve per-box usage for an organization within a time range + +### Example + +```typescript +import { + UsageApi, + Configuration +} from './api'; + +const configuration = new Configuration(); +const apiInstance = new UsageApi(configuration); + +let organizationId: string; //Organization ID (default to undefined) +let from: string; //Start time (RFC3339) (default to undefined) +let to: string; //End time (RFC3339) (default to undefined) + +const { status, data } = await apiInstance.organizationOrganizationIdUsageBoxGet( + organizationId, + from, + to +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **organizationId** | [**string**] | Organization ID | defaults to undefined| +| **from** | [**string**] | Start time (RFC3339) | defaults to undefined| +| **to** | [**string**] | End time (RFC3339) | defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organizationOrganizationIdUsageChartGet** +> Array organizationOrganizationIdUsageChartGet() + +Retrieve usage chart data points for an organization within a time range + +### Example + +```typescript +import { + UsageApi, + Configuration +} from './api'; + +const configuration = new Configuration(); +const apiInstance = new UsageApi(configuration); + +let organizationId: string; //Organization ID (default to undefined) +let from: string; //Start time (RFC3339) (default to undefined) +let to: string; //End time (RFC3339) (default to undefined) +let region: string; //Region filter (optional) (default to undefined) + +const { status, data } = await apiInstance.organizationOrganizationIdUsageChartGet( + organizationId, + from, + to, + region +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **organizationId** | [**string**] | Organization ID | defaults to undefined| +| **from** | [**string**] | Start time (RFC3339) | defaults to undefined| +| **to** | [**string**] | End time (RFC3339) | defaults to undefined| +| **region** | [**string**] | Region filter | (optional) defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/apps/libs/analytics-api-client/src/index.ts b/apps/libs/analytics-api-client/src/index.ts index 6f2b98905..3cfc35b09 100644 --- a/apps/libs/analytics-api-client/src/index.ts +++ b/apps/libs/analytics-api-client/src/index.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/apps/libs/analytics-api-client/src/models/index.ts b/apps/libs/analytics-api-client/src/models/index.ts index 773a476d7..27901f5e6 100644 --- a/apps/libs/analytics-api-client/src/models/index.ts +++ b/apps/libs/analytics-api-client/src/models/index.ts @@ -1,7 +1,7 @@ export * from './models-aggregated-usage'; +export * from './models-box-usage'; export * from './models-log-entry'; export * from './models-metric-point'; -export * from './models-sandbox-usage'; export * from './models-span'; export * from './models-trace-summary'; export * from './models-usage-chart-point'; diff --git a/apps/libs/analytics-api-client/src/models/models-aggregated-usage.ts b/apps/libs/analytics-api-client/src/models/models-aggregated-usage.ts index 132a2777e..8710f83e9 100644 --- a/apps/libs/analytics-api-client/src/models/models-aggregated-usage.ts +++ b/apps/libs/analytics-api-client/src/models/models-aggregated-usage.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,58 +14,14 @@ -/** - * - * @export - * @interface ModelsAggregatedUsage - */ export interface ModelsAggregatedUsage { - /** - * - * @type {string} - * @memberof ModelsAggregatedUsage - */ + 'boxCount'?: number; 'firstStart'?: string; - /** - * - * @type {string} - * @memberof ModelsAggregatedUsage - */ 'lastEnd'?: string; - /** - * - * @type {number} - * @memberof ModelsAggregatedUsage - */ - 'sandboxCount'?: number; - /** - * - * @type {number} - * @memberof ModelsAggregatedUsage - */ 'totalCPUSeconds'?: number; - /** - * - * @type {number} - * @memberof ModelsAggregatedUsage - */ 'totalDiskGBSeconds'?: number; - /** - * - * @type {number} - * @memberof ModelsAggregatedUsage - */ 'totalGPUSeconds'?: number; - /** - * - * @type {number} - * @memberof ModelsAggregatedUsage - */ 'totalPrice'?: number; - /** - * - * @type {number} - * @memberof ModelsAggregatedUsage - */ 'totalRAMGBSeconds'?: number; } + diff --git a/apps/libs/analytics-api-client/src/models/models-box-usage.ts b/apps/libs/analytics-api-client/src/models/models-box-usage.ts new file mode 100644 index 000000000..42da81965 --- /dev/null +++ b/apps/libs/analytics-api-client/src/models/models-box-usage.ts @@ -0,0 +1,27 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * BoxLite Analytics API + * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +export interface ModelsBoxUsage { + 'boxId'?: string; + 'firstStart'?: string; + 'lastEnd'?: string; + 'totalCPUSeconds'?: number; + 'totalDiskGBSeconds'?: number; + 'totalGPUSeconds'?: number; + 'totalPrice'?: number; + 'totalRAMGBSeconds'?: number; +} + diff --git a/apps/libs/analytics-api-client/src/models/models-log-entry.ts b/apps/libs/analytics-api-client/src/models/models-log-entry.ts index 8a55d1a5d..79c9ae591 100644 --- a/apps/libs/analytics-api-client/src/models/models-log-entry.ts +++ b/apps/libs/analytics-api-client/src/models/models-log-entry.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,64 +14,15 @@ -/** - * - * @export - * @interface ModelsLogEntry - */ export interface ModelsLogEntry { - /** - * - * @type {string} - * @memberof ModelsLogEntry - */ 'body'?: string; - /** - * - * @type {{ [key: string]: string; }} - * @memberof ModelsLogEntry - */ 'logAttributes'?: { [key: string]: string; }; - /** - * - * @type {{ [key: string]: string; }} - * @memberof ModelsLogEntry - */ 'resourceAttributes'?: { [key: string]: string; }; - /** - * - * @type {string} - * @memberof ModelsLogEntry - */ 'serviceName'?: string; - /** - * - * @type {number} - * @memberof ModelsLogEntry - */ 'severityNumber'?: number; - /** - * - * @type {string} - * @memberof ModelsLogEntry - */ 'severityText'?: string; - /** - * - * @type {string} - * @memberof ModelsLogEntry - */ 'spanId'?: string; - /** - * - * @type {string} - * @memberof ModelsLogEntry - */ 'timestamp'?: string; - /** - * - * @type {string} - * @memberof ModelsLogEntry - */ 'traceId'?: string; } + diff --git a/apps/libs/analytics-api-client/src/models/models-metric-point.ts b/apps/libs/analytics-api-client/src/models/models-metric-point.ts index 5af279e3d..ad527b64f 100644 --- a/apps/libs/analytics-api-client/src/models/models-metric-point.ts +++ b/apps/libs/analytics-api-client/src/models/models-metric-point.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,28 +14,9 @@ -/** - * - * @export - * @interface ModelsMetricPoint - */ export interface ModelsMetricPoint { - /** - * - * @type {string} - * @memberof ModelsMetricPoint - */ 'metricName'?: string; - /** - * - * @type {string} - * @memberof ModelsMetricPoint - */ 'timestamp'?: string; - /** - * - * @type {number} - * @memberof ModelsMetricPoint - */ 'value'?: number; } + diff --git a/apps/libs/analytics-api-client/src/models/models-sandbox-usage.ts b/apps/libs/analytics-api-client/src/models/models-sandbox-usage.ts deleted file mode 100644 index 21acf9af3..000000000 --- a/apps/libs/analytics-api-client/src/models/models-sandbox-usage.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * BoxLite Analytics API - * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. - * - * The version of the OpenAPI document: v0.0.0-dev - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -/** - * - * @export - * @interface ModelsSandboxUsage - */ -export interface ModelsSandboxUsage { - /** - * - * @type {string} - * @memberof ModelsSandboxUsage - */ - 'firstStart'?: string; - /** - * - * @type {string} - * @memberof ModelsSandboxUsage - */ - 'lastEnd'?: string; - /** - * - * @type {string} - * @memberof ModelsSandboxUsage - */ - 'sandboxId'?: string; - /** - * - * @type {number} - * @memberof ModelsSandboxUsage - */ - 'totalCPUSeconds'?: number; - /** - * - * @type {number} - * @memberof ModelsSandboxUsage - */ - 'totalDiskGBSeconds'?: number; - /** - * - * @type {number} - * @memberof ModelsSandboxUsage - */ - 'totalGPUSeconds'?: number; - /** - * - * @type {number} - * @memberof ModelsSandboxUsage - */ - 'totalPrice'?: number; - /** - * - * @type {number} - * @memberof ModelsSandboxUsage - */ - 'totalRAMGBSeconds'?: number; -} diff --git a/apps/libs/analytics-api-client/src/models/models-span.ts b/apps/libs/analytics-api-client/src/models/models-span.ts index 096e078c3..1c36d9083 100644 --- a/apps/libs/analytics-api-client/src/models/models-span.ts +++ b/apps/libs/analytics-api-client/src/models/models-span.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,64 +14,15 @@ -/** - * - * @export - * @interface ModelsSpan - */ export interface ModelsSpan { - /** - * - * @type {number} - * @memberof ModelsSpan - */ 'durationMs'?: number; - /** - * - * @type {string} - * @memberof ModelsSpan - */ 'parentSpanId'?: string; - /** - * - * @type {{ [key: string]: string; }} - * @memberof ModelsSpan - */ 'spanAttributes'?: { [key: string]: string; }; - /** - * - * @type {string} - * @memberof ModelsSpan - */ 'spanId'?: string; - /** - * - * @type {string} - * @memberof ModelsSpan - */ 'spanName'?: string; - /** - * - * @type {string} - * @memberof ModelsSpan - */ 'statusCode'?: string; - /** - * - * @type {string} - * @memberof ModelsSpan - */ 'statusMessage'?: string; - /** - * - * @type {string} - * @memberof ModelsSpan - */ 'timestamp'?: string; - /** - * - * @type {string} - * @memberof ModelsSpan - */ 'traceId'?: string; } + diff --git a/apps/libs/analytics-api-client/src/models/models-trace-summary.ts b/apps/libs/analytics-api-client/src/models/models-trace-summary.ts index cc1991479..10991b30d 100644 --- a/apps/libs/analytics-api-client/src/models/models-trace-summary.ts +++ b/apps/libs/analytics-api-client/src/models/models-trace-summary.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,52 +14,13 @@ -/** - * - * @export - * @interface ModelsTraceSummary - */ export interface ModelsTraceSummary { - /** - * - * @type {string} - * @memberof ModelsTraceSummary - */ 'endTime'?: string; - /** - * - * @type {string} - * @memberof ModelsTraceSummary - */ 'rootSpanName'?: string; - /** - * - * @type {number} - * @memberof ModelsTraceSummary - */ 'spanCount'?: number; - /** - * - * @type {string} - * @memberof ModelsTraceSummary - */ 'startTime'?: string; - /** - * - * @type {string} - * @memberof ModelsTraceSummary - */ 'statusCode'?: string; - /** - * - * @type {number} - * @memberof ModelsTraceSummary - */ 'totalDurationMs'?: number; - /** - * - * @type {string} - * @memberof ModelsTraceSummary - */ 'traceId'?: string; } + diff --git a/apps/libs/analytics-api-client/src/models/models-usage-chart-point.ts b/apps/libs/analytics-api-client/src/models/models-usage-chart-point.ts index 1d2e33b3c..1b05589fb 100644 --- a/apps/libs/analytics-api-client/src/models/models-usage-chart-point.ts +++ b/apps/libs/analytics-api-client/src/models/models-usage-chart-point.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,52 +14,13 @@ -/** - * - * @export - * @interface ModelsUsageChartPoint - */ export interface ModelsUsageChartPoint { - /** - * - * @type {number} - * @memberof ModelsUsageChartPoint - */ 'cpu'?: number; - /** - * - * @type {number} - * @memberof ModelsUsageChartPoint - */ 'cpuPrice'?: number; - /** - * - * @type {number} - * @memberof ModelsUsageChartPoint - */ 'diskGB'?: number; - /** - * - * @type {number} - * @memberof ModelsUsageChartPoint - */ 'diskPrice'?: number; - /** - * - * @type {number} - * @memberof ModelsUsageChartPoint - */ 'ramGB'?: number; - /** - * - * @type {number} - * @memberof ModelsUsageChartPoint - */ 'ramPrice'?: number; - /** - * - * @type {string} - * @memberof ModelsUsageChartPoint - */ 'time'?: string; } + diff --git a/apps/libs/analytics-api-client/src/models/models-usage-period.ts b/apps/libs/analytics-api-client/src/models/models-usage-period.ts index 750c60407..945206a38 100644 --- a/apps/libs/analytics-api-client/src/models/models-usage-period.ts +++ b/apps/libs/analytics-api-client/src/models/models-usage-period.ts @@ -5,7 +5,7 @@ * BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens. * * The version of the OpenAPI document: v0.0.0-dev - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,52 +14,13 @@ -/** - * - * @export - * @interface ModelsUsagePeriod - */ export interface ModelsUsagePeriod { - /** - * - * @type {number} - * @memberof ModelsUsagePeriod - */ 'cpu'?: number; - /** - * - * @type {number} - * @memberof ModelsUsagePeriod - */ 'diskGB'?: number; - /** - * - * @type {string} - * @memberof ModelsUsagePeriod - */ 'endAt'?: string; - /** - * - * @type {number} - * @memberof ModelsUsagePeriod - */ 'gpu'?: number; - /** - * - * @type {number} - * @memberof ModelsUsagePeriod - */ 'price'?: number; - /** - * - * @type {number} - * @memberof ModelsUsagePeriod - */ 'ramGB'?: number; - /** - * - * @type {string} - * @memberof ModelsUsagePeriod - */ 'startAt'?: string; } + diff --git a/apps/libs/analytics-api-client/swagger.json b/apps/libs/analytics-api-client/swagger.json new file mode 100644 index 000000000..47eb31a27 --- /dev/null +++ b/apps/libs/analytics-api-client/swagger.json @@ -0,0 +1,536 @@ +{ + "swagger": "2.0", + "info": { + "title": "BoxLite Analytics API", + "description": "BoxLite Analytics API - Read-only telemetry and usage data. Authenticated via BoxLite API keys or JWT tokens.", + "version": "v0.0.0-dev" + }, + "host": "localhost:8080", + "securityDefinitions": { + "Bearer": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "paths": { + "/organization/{organizationId}/box/{boxId}/usage": { + "get": { + "summary": "Get box usage periods", + "description": "Retrieve usage periods for a specific box within a time range", + "tags": ["Usage"], + "produces": ["application/json"], + "security": [{ "Bearer": [] }], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "description": "Organization ID", + "required": true, + "type": "string" + }, + { + "name": "boxId", + "in": "path", + "description": "Box ID", + "required": true, + "type": "string" + }, + { + "name": "from", + "in": "query", + "description": "Start time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "to", + "in": "query", + "description": "End time (RFC3339)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { "$ref": "#/definitions/models.UsagePeriod" } + } + } + } + } + }, + "/organization/{organizationId}/usage/aggregated": { + "get": { + "summary": "Get aggregated usage", + "description": "Retrieve aggregated usage for an organization within a time range", + "tags": ["Usage"], + "produces": ["application/json"], + "security": [{ "Bearer": [] }], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "description": "Organization ID", + "required": true, + "type": "string" + }, + { + "name": "from", + "in": "query", + "description": "Start time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "to", + "in": "query", + "description": "End time (RFC3339)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { "$ref": "#/definitions/models.AggregatedUsage" } + } + } + } + }, + "/organization/{organizationId}/usage/chart": { + "get": { + "summary": "Get usage chart data", + "description": "Retrieve usage chart data points for an organization within a time range", + "tags": ["Usage"], + "produces": ["application/json"], + "security": [{ "Bearer": [] }], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "description": "Organization ID", + "required": true, + "type": "string" + }, + { + "name": "from", + "in": "query", + "description": "Start time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "to", + "in": "query", + "description": "End time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "region", + "in": "query", + "description": "Region filter", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { "$ref": "#/definitions/models.UsageChartPoint" } + } + } + } + } + }, + "/organization/{organizationId}/usage/box": { + "get": { + "summary": "Get per-box usage", + "description": "Retrieve per-box usage for an organization within a time range", + "tags": ["Usage"], + "produces": ["application/json"], + "security": [{ "Bearer": [] }], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "description": "Organization ID", + "required": true, + "type": "string" + }, + { + "name": "from", + "in": "query", + "description": "Start time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "to", + "in": "query", + "description": "End time (RFC3339)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { "$ref": "#/definitions/models.BoxUsage" } + } + } + } + } + }, + "/organization/{organizationId}/box/{boxId}/telemetry/logs": { + "get": { + "summary": "Get box logs", + "description": "Retrieve OTEL logs for a box within a time range", + "tags": ["Telemetry"], + "produces": ["application/json"], + "security": [{ "Bearer": [] }], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "description": "Organization ID", + "required": true, + "type": "string" + }, + { + "name": "boxId", + "in": "path", + "description": "Box ID", + "required": true, + "type": "string" + }, + { + "name": "from", + "in": "query", + "description": "Start time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "to", + "in": "query", + "description": "End time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "severity", + "in": "query", + "description": "Severity filter (comma-separated)", + "required": false, + "type": "string" + }, + { + "name": "search", + "in": "query", + "description": "Search filter", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Page size", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "Page offset", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { "$ref": "#/definitions/models.LogEntry" } + } + } + } + } + }, + "/organization/{organizationId}/box/{boxId}/telemetry/metrics": { + "get": { + "summary": "Get box metrics", + "description": "Retrieve OTEL metrics for a box within a time range", + "tags": ["Telemetry"], + "produces": ["application/json"], + "security": [{ "Bearer": [] }], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "description": "Organization ID", + "required": true, + "type": "string" + }, + { + "name": "boxId", + "in": "path", + "description": "Box ID", + "required": true, + "type": "string" + }, + { + "name": "from", + "in": "query", + "description": "Start time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "to", + "in": "query", + "description": "End time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "metricNames", + "in": "query", + "description": "Metric names filter (comma-separated)", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { "$ref": "#/definitions/models.MetricPoint" } + } + } + } + } + }, + "/organization/{organizationId}/box/{boxId}/telemetry/traces": { + "get": { + "summary": "Get box traces", + "description": "Retrieve OTEL trace summaries for a box within a time range", + "tags": ["Telemetry"], + "produces": ["application/json"], + "security": [{ "Bearer": [] }], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "description": "Organization ID", + "required": true, + "type": "string" + }, + { + "name": "boxId", + "in": "path", + "description": "Box ID", + "required": true, + "type": "string" + }, + { + "name": "from", + "in": "query", + "description": "Start time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "to", + "in": "query", + "description": "End time (RFC3339)", + "required": true, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Page size", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "Page offset", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { "$ref": "#/definitions/models.TraceSummary" } + } + } + } + } + }, + "/organization/{organizationId}/box/{boxId}/telemetry/traces/{traceId}": { + "get": { + "summary": "Get trace spans", + "description": "Retrieve all spans for a trace", + "tags": ["Telemetry"], + "produces": ["application/json"], + "security": [{ "Bearer": [] }], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "description": "Organization ID", + "required": true, + "type": "string" + }, + { + "name": "boxId", + "in": "path", + "description": "Box ID", + "required": true, + "type": "string" + }, + { + "name": "traceId", + "in": "path", + "description": "Trace ID", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { "$ref": "#/definitions/models.Span" } + } + } + } + } + } + }, + "definitions": { + "models.AggregatedUsage": { + "type": "object", + "properties": { + "boxCount": { "type": "integer" }, + "firstStart": { "type": "string" }, + "lastEnd": { "type": "string" }, + "totalCPUSeconds": { "type": "number" }, + "totalDiskGBSeconds": { "type": "number" }, + "totalGPUSeconds": { "type": "number" }, + "totalPrice": { "type": "number" }, + "totalRAMGBSeconds": { "type": "number" } + } + }, + "models.BoxUsage": { + "type": "object", + "properties": { + "boxId": { "type": "string" }, + "firstStart": { "type": "string" }, + "lastEnd": { "type": "string" }, + "totalCPUSeconds": { "type": "number" }, + "totalDiskGBSeconds": { "type": "number" }, + "totalGPUSeconds": { "type": "number" }, + "totalPrice": { "type": "number" }, + "totalRAMGBSeconds": { "type": "number" } + } + }, + "models.UsageChartPoint": { + "type": "object", + "properties": { + "cpu": { "type": "number" }, + "cpuPrice": { "type": "number" }, + "diskGB": { "type": "number" }, + "diskPrice": { "type": "number" }, + "ramGB": { "type": "number" }, + "ramPrice": { "type": "number" }, + "time": { "type": "string" } + } + }, + "models.UsagePeriod": { + "type": "object", + "properties": { + "cpu": { "type": "number" }, + "diskGB": { "type": "number" }, + "endAt": { "type": "string" }, + "gpu": { "type": "number" }, + "price": { "type": "number" }, + "ramGB": { "type": "number" }, + "startAt": { "type": "string" } + } + }, + "models.LogEntry": { + "type": "object", + "properties": { + "body": { "type": "string" }, + "logAttributes": { + "type": "object", + "additionalProperties": { "type": "string" } + }, + "resourceAttributes": { + "type": "object", + "additionalProperties": { "type": "string" } + }, + "serviceName": { "type": "string" }, + "severityNumber": { "type": "integer" }, + "severityText": { "type": "string" }, + "spanId": { "type": "string" }, + "timestamp": { "type": "string" }, + "traceId": { "type": "string" } + } + }, + "models.MetricPoint": { + "type": "object", + "properties": { + "metricName": { "type": "string" }, + "timestamp": { "type": "string" }, + "value": { "type": "number" } + } + }, + "models.Span": { + "type": "object", + "properties": { + "durationMs": { "type": "number" }, + "parentSpanId": { "type": "string" }, + "spanAttributes": { + "type": "object", + "additionalProperties": { "type": "string" } + }, + "spanId": { "type": "string" }, + "spanName": { "type": "string" }, + "statusCode": { "type": "string" }, + "statusMessage": { "type": "string" }, + "timestamp": { "type": "string" }, + "traceId": { "type": "string" } + } + }, + "models.TraceSummary": { + "type": "object", + "properties": { + "endTime": { "type": "string" }, + "rootSpanName": { "type": "string" }, + "spanCount": { "type": "integer" }, + "startTime": { "type": "string" }, + "statusCode": { "type": "string" }, + "totalDurationMs": { "type": "number" }, + "traceId": { "type": "string" } + } + } + } +}