diff --git a/config.json b/config.json index 2cc188a2..633c6b9a 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "licenseName": "MIT", "moduleName": "NotehubJs", "npmRepository": "https://registry.npmjs.org", - "projectVersion": "6.0.0", + "projectVersion": "6.0.0-beta.29", "sourceFolder": "src", "usePromises": true } diff --git a/openapi.yaml b/openapi.yaml index 866d9882..9bc5cbab 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -143,6 +143,90 @@ paths: - personalAccessToken: [] tags: - billing_account + '/v1/billing-accounts/{billingAccountUID}': + get: + operationId: GetBillingAccount + description: Get Billing Account Information + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + name: + type: string + owner: + type: string + plan: + type: object + properties: + current_balance: + type: integer + format: int64 + end_date: + type: string + format: date-time + event_capacity: + type: integer + format: int64 + start_date: + type: string + format: date-time + type: + type: string + enum: + - Enterprise + - Essentials + suspended: + type: boolean + uid: + type: string + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account + '/v1/billing-accounts/{billingAccountUID}/balance-history': + get: + operationId: GetBillingAccountBalanceHistory + description: 'Get Billing Account Balance history, only enterprise supported' + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + properties: + period: + type: string + format: date-time + remaining_event_capacity: + type: integer + format: int64 + required: + - remaining_event_capacity + - period + type: object + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account '/v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin': get: operationId: GetDeviceEnvironmentVariablesByPin @@ -375,6 +459,28 @@ paths: - personalAccessToken: [] tags: - alert + '/v1/projects/{projectOrProductUID}/aws-role-config': + get: + operationId: GetAWSRoleConfig + summary: Get AWS role configuration for role-based authentication + description: | + Returns the AWS Account ID and External ID needed to configure an IAM role + trust policy for role-based authentication on AWS routes. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + responses: + '200': + description: AWS role configuration + content: + application/json: + schema: + $ref: '#/components/schemas/AWSRoleConfig' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project '/v1/projects/{projectOrProductUID}/clone': post: operationId: CloneProject @@ -1108,6 +1214,7 @@ paths: - $ref: '#/components/parameters/pageNumParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/firstSyncParam' responses: '200': $ref: '#/components/responses/SessionResponse' @@ -1901,6 +2008,190 @@ paths: - personalAccessToken: [] tags: - project + '/v1/projects/{projectOrProductUID}/jobs': + get: + operationId: GetJobs + description: List all batch jobs for a project + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - name: status + in: query + description: Filter jobs by status + required: false + schema: + type: string + - name: dry_run + in: query + description: Filter jobs by dry run flag + required: false + schema: + type: boolean + responses: + '200': + $ref: '#/components/responses/GetJobsResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + post: + operationId: CreateJob + description: Create a new batch job with an optional name + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - name: name + in: query + description: Name for the job + required: true + schema: + type: string + requestBody: + description: The job definition as raw JSON + required: true + content: + application/json: + schema: + description: Job definition (structure varies by job type) + type: object + responses: + '201': + $ref: '#/components/responses/CreateJobResponse' + '400': + description: Missing required name parameter or invalid job definition + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/{jobUID}': + delete: + operationId: DeleteJob + description: Delete a batch job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + responses: + '200': + $ref: '#/components/responses/DeleteJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + get: + operationId: GetJob + description: Get a specific batch job definition + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + responses: + '200': + $ref: '#/components/responses/GetJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/{jobUID}/run': + post: + operationId: RunJob + description: Execute a batch job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + - name: dry_run + in: query + description: Run job in dry-run mode without making actual changes + required: false + schema: + type: boolean + default: false + responses: + '200': + $ref: '#/components/responses/RunJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs': + get: + operationId: GetJobRuns + description: List all runs for a specific job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + - name: status + in: query + description: Filter runs by status + required: false + schema: + type: string + - name: dry_run + in: query + description: Filter runs by dry run flag + required: false + schema: + type: boolean + nullable: true + responses: + '200': + $ref: '#/components/responses/GetJobRunsResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}': + get: + operationId: GetJobRun + description: Get the result of a job execution + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/reportUIDParam' + responses: + '200': + $ref: '#/components/responses/GetJobRunResponse' + '404': + description: Run not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel': + post: + operationId: CancelJobRun + description: Cancel a running job execution + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/reportUIDParam' + responses: + '200': + $ref: '#/components/responses/CancelJobRunResponse' + '404': + description: Run not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs '/v1/projects/{projectOrProductUID}/members': get: operationId: GetProjectMembers @@ -2703,6 +2994,13 @@ paths: - webhook components: parameters: + billingAccountUIDParam: + example: 00000000-0000-0000-000000000001 + in: path + name: billingAccountUID + required: true + schema: + type: string cursorParam: description: | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. @@ -2925,6 +3223,14 @@ components: required: false schema: type: string + firstSyncParam: + description: 'When true, filters results to only show first sync sessions' + in: query + name: firstSync + required: false + schema: + type: boolean + default: false fleetUIDFilterQueryParam: description: Filter by Fleet UID explode: true @@ -2986,6 +3292,14 @@ components: items: type: string style: form + jobUIDParam: + description: Unique identifier for a batch job + example: my-reconciliation-job + in: path + name: jobUID + required: true + schema: + type: string limitParam: in: query name: limit @@ -3102,6 +3416,14 @@ components: required: true schema: type: string + reportUIDParam: + description: Unique identifier for a job run report + example: my-reconciliation-job-1707654321000 + in: path + name: reportUID + required: true + schema: + type: string repositoryKey: description: The secret key used to access this repository in: header @@ -3323,6 +3645,19 @@ components: schema: type: string schemas: + AWSRoleConfig: + description: Configuration needed to set up an IAM role trust policy for role-based authentication on AWS routes + type: object + properties: + aws_account_id: + description: The Blues AWS Account ID to trust in your IAM role's trust policy + type: string + external_id: + description: The External ID to use in your IAM role's trust policy condition + type: string + required: + - aws_account_id + - external_id Alert: type: object properties: @@ -3446,6 +3781,9 @@ components: type: string region: type: string + role_arn: + description: IAM Role ARN for role-based authentication via STS AssumeRole + type: string throttle_ms: type: integer timeout: @@ -4622,6 +4960,84 @@ components: JSONata: type: object properties: {} + Job: + type: object + properties: + created: + description: Unix timestamp when job was created + type: integer + format: int64 + created_by: + description: User who created the job + type: string + definition: + description: Full job definition (only in detail view) + type: object + additionalProperties: true + job_uid: + description: Unique identifier for the job + type: string + name: + description: Human-readable job name + type: string + required: + - job_uid + - name + - created + - created_by + JobRun: + type: object + properties: + cancel: + description: Whether cancellation was requested + type: boolean + completed: + description: Unix timestamp when completed + type: integer + format: int64 + dry_run: + description: Whether this was a dry run + type: boolean + job_name: + description: Name of the job + type: string + job_uid: + description: Unique identifier for the job + type: string + report_uid: + description: Unique identifier for this run + type: string + results: + description: Full results (only in detail view) + type: object + additionalProperties: true + started: + description: Unix timestamp when started + type: integer + format: int64 + status: + description: 'Current status (submitted, running, completed, cancelled, failed)' + type: string + submitted: + description: Unix timestamp when submitted + type: integer + format: int64 + submitted_by: + description: User who submitted the run + type: string + updated: + description: Unix timestamp of last update + type: integer + format: int64 + required: + - report_uid + - job_uid + - job_name + - status + - dry_run + - submitted_by + - submitted + - updated Location: type: object properties: @@ -4684,6 +5100,7 @@ components: - less_than_or_equal_to - equal_to - not_equal_to + - count description: type: string disabled: @@ -5738,6 +6155,11 @@ components: device: type: string example: 'dev:123456789012345' + first_sync_sessions: + description: Number of first sync sessions in this period + type: integer + format: int64 + example: 2 fleet: type: string example: 'fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d' @@ -5760,6 +6182,7 @@ components: required: - period - sessions + - first_sync_sessions - total_bytes - total_devices UsageTruncatedField: @@ -5831,6 +6254,42 @@ components: required: - alerts - has_more + CancelJobRunResponse: + description: Cancel operation completed + content: + application/json: + schema: + type: object + properties: + successful: + description: True if cancellation was successful + type: boolean + required: + - successful + CreateJobResponse: + description: Job created successfully + content: + application/json: + schema: + type: object + properties: + job_uid: + description: The unique identifier for the created job + type: string + required: + - job_uid + DeleteJobResponse: + description: Job deleted successfully + content: + application/json: + schema: + type: object + properties: + success: + description: True if deletion was successful + type: boolean + required: + - success DevicePlansResponse: description: Response body for /plans content: @@ -6041,6 +6500,48 @@ components: required: - environment_variables - environment_variables_env_default + GetJobResponse: + description: Batch job details + content: + application/json: + schema: + type: '' + properties: {} + $ref: '#/components/schemas/Job' + GetJobRunResponse: + description: Job run details + content: + application/json: + schema: + type: '' + properties: {} + $ref: '#/components/schemas/JobRun' + GetJobRunsResponse: + description: List of job runs + content: + application/json: + schema: + type: object + properties: + runs: + type: array + items: + $ref: '#/components/schemas/JobRun' + required: + - runs + GetJobsResponse: + description: List of batch jobs + content: + application/json: + schema: + type: object + properties: + jobs: + type: array + items: + $ref: '#/components/schemas/Job' + required: + - jobs LatestResponse: description: The response body for a Latest Events request. content: @@ -6138,6 +6639,18 @@ components: total: description: The total number of notes active on the Notefile. type: integer + RunJobResponse: + description: Job execution started + content: + application/json: + schema: + type: object + properties: + report_uid: + description: Unique identifier for this job run + type: string + required: + - report_uid SessionResponse: description: The response body for a session request. content: @@ -6313,6 +6826,8 @@ tags: name: external devices - description: 'Project Usage information related to events, route logs, sessions, and data usage' name: usage + - description: Batch job operations + name: jobs externalDocs: description: Find out more about Blues url: 'https://blues.io'