Skip to content

Commit

Permalink
Api for new stream centric UX (#8919)
Browse files Browse the repository at this point in the history
  • Loading branch information
malikdiarra committed Oct 18, 2023
1 parent 62cb0c0 commit 9e12bc0
Show file tree
Hide file tree
Showing 3 changed files with 259 additions and 1 deletion.
215 changes: 215 additions & 0 deletions airbyte-api/src/main/openapi/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,98 @@ paths:
$ref: "#/components/responses/NotFoundResponse"
"422":
$ref: "#/components/responses/InvalidInputResponse"
/v1/connections/sync_progress:
post:
tags:
- connection
summary: Get progress information of the current sync of a connection
operationId: getConnectionSyncProgress
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ConnectionIdRequestBody"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/ConnectionSyncProgressRead"
"404":
$ref: "#/components/responses/NotFoundResponse"
"422":
$ref: "#/components/responses/InvalidInputResponse"
/v1/connections/history/uptime:
post:
tags:
- connection
summary: Get the uptime history of a connection
operationId: getConnectionUptimeHistory
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ConnectionUptimeHistoryRequestBody"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/ConnectionUptimeHistoryRead"
"404":
$ref: "#/components/responses/NotFoundResponse"
"422":
$ref: "#/components/responses/InvalidInputResponse"
/v1/connections/history/data:
post:
tags:
- connection
summary: Get the data history of a connection
operationId: getConnectionDataHistory
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ConnectionDataHistoryRequestBody"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/ConnectionDataHistoryRead"
"404":
$ref: "#/components/responses/NotFoundResponse"
"422":
$ref: "#/components/responses/InvalidInputResponse"
/v1/connections/stream_history:
post:
tags:
- connection
summary: Get the history of a connection
operationId: getConnectionStreamHistory
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ConnectionStreamHistoryRequestBody"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/ConnectionStreamHistoryRead"
"404":
$ref: "#/components/responses/NotFoundResponse"
"422":
$ref: "#/components/responses/InvalidInputResponse"
/v1/connections/get:
post:
tags:
Expand Down Expand Up @@ -5438,6 +5530,36 @@ components:
properties:
connectionId:
$ref: "#/components/schemas/ConnectionId"
ConnectionUptimeHistoryRequestBody:
type: object
required:
- connectionId
- timezone
properties:
connectionId:
$ref: "#/components/schemas/ConnectionId"
timezone:
type: string
ConnectionDataHistoryRequestBody:
type: object
required:
- connectionId
- timezone
properties:
connectionId:
$ref: "#/components/schemas/ConnectionId"
timezone:
type: string
ConnectionStreamHistoryRequestBody:
type: object
required:
- connectionId
- timezone
properties:
connectionId:
$ref: "#/components/schemas/ConnectionId"
timezone:
type: string
ConnectionStream:
type: object
required:
Expand Down Expand Up @@ -5787,6 +5909,99 @@ components:
type: boolean
failureType:
$ref: "#/components/schemas/FailureType"
ConnectionSyncProgressRead:
type: array
items:
$ref: "#/components/schemas/ConnectionSyncProgressReadItem"
ConnectionSyncProgressReadItem:
type: object
required:
- streamName
- streamNamespace
- recordsExtracted
- recordsLoaded
- syncTimeElapsed
- progressPercentage
- lastCommittedTimestamp
- lastCursorValue
properties:
streamName:
type: string
streamNamespace:
type: string
recordsExtracted:
type: integer
format: int64
recordsLoaded:
type: integer
format: int64
syncTimeElapsed:
type: integer
format: int64
progressPercentage:
type: integer
format: int32
lastCommittedTimestamp:
type: integer
format: int64
lastCursorValue:
type: string
ConnectionUptimeHistoryRead:
type: array
items:
$ref: "#/components/schemas/ConnectionSyncResultRead"
ConnectionSyncResultRead:
type: object
required:
- timestamp
- status
- stream
properties:
timestamp:
type: integer
format: int64
status:
$ref: "#/components/schemas/JobStatus"
stream:
type: string
ConnectionDataHistoryRead:
type: array
items:
$ref: "#/components/schemas/ConnectionDataHistoryReadItem"
ConnectionDataHistoryReadItem:
type: object
required:
- timestamp
- bytes
properties:
timestamp:
type: integer
format: int
bytes:
type: integer
format: int
ConnectionStreamHistoryRead:
type: array
items:
$ref: "#/components/schemas/ConnectionStreamHistoryReadItem"
ConnectionStreamHistoryReadItem:
type: object
required:
- timestamp
- stream
- namespace
- volume
properties:
timestamp:
type: integer
format: int
stream:
type: string
namespace:
type: string
volume:
type: integer
format: int
SchemaChange:
enum:
- no_change
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@
import io.airbyte.api.model.generated.ConnectionAutoPropagateResult;
import io.airbyte.api.model.generated.ConnectionAutoPropagateSchemaChange;
import io.airbyte.api.model.generated.ConnectionCreate;
import io.airbyte.api.model.generated.ConnectionDataHistoryReadItem;
import io.airbyte.api.model.generated.ConnectionDataHistoryRequestBody;
import io.airbyte.api.model.generated.ConnectionIdRequestBody;
import io.airbyte.api.model.generated.ConnectionRead;
import io.airbyte.api.model.generated.ConnectionReadList;
import io.airbyte.api.model.generated.ConnectionSearch;
import io.airbyte.api.model.generated.ConnectionStatusRead;
import io.airbyte.api.model.generated.ConnectionStatusesRequestBody;
import io.airbyte.api.model.generated.ConnectionStreamHistoryReadItem;
import io.airbyte.api.model.generated.ConnectionStreamHistoryRequestBody;
import io.airbyte.api.model.generated.ConnectionStreamRequestBody;
import io.airbyte.api.model.generated.ConnectionSyncProgressReadItem;
import io.airbyte.api.model.generated.ConnectionSyncResultRead;
import io.airbyte.api.model.generated.ConnectionUpdate;
import io.airbyte.api.model.generated.ConnectionUptimeHistoryRequestBody;
import io.airbyte.api.model.generated.GetTaskQueueNameRequest;
import io.airbyte.api.model.generated.InternalOperationResult;
import io.airbyte.api.model.generated.JobInfoRead;
Expand Down Expand Up @@ -145,6 +152,15 @@ public ConnectionRead getConnection(@Body final ConnectionIdRequestBody connecti
return ApiHelper.execute(() -> connectionsHandler.getConnection(connectionIdRequestBody.getConnectionId()));
}

@Override
@Post(uri = "/history/data")
@Secured({READER})
@SecuredWorkspace
@ExecuteOn(AirbyteTaskExecutors.IO)
public List<ConnectionDataHistoryReadItem> getConnectionDataHistory(ConnectionDataHistoryRequestBody connectionDataHistoryRequestBody) {
return null;
}

@Override
@Post(uri = "/connections/status")
@Secured({READER})
Expand All @@ -154,6 +170,33 @@ public List<ConnectionStatusRead> getConnectionStatuses(@Body final ConnectionSt
return ApiHelper.execute(() -> connectionsHandler.getConnectionStatuses(connectionStatusesRequestBody));
}

@Override
@Post(uri = "/stream_history")
@Secured({READER})
@SecuredWorkspace
@ExecuteOn(AirbyteTaskExecutors.IO)
public List<ConnectionStreamHistoryReadItem> getConnectionStreamHistory(ConnectionStreamHistoryRequestBody connectionStreamHistoryRequestBody) {
return null;
}

@Override
@Post(uri = "/sync_progress")
@Secured({READER})
@SecuredWorkspace
@ExecuteOn(AirbyteTaskExecutors.IO)
public List<ConnectionSyncProgressReadItem> getConnectionSyncProgress(ConnectionIdRequestBody connectionIdRequestBody) {
return null;
}

@Override
@Post(uri = "/history/uptime")
@Secured({READER})
@SecuredWorkspace
@ExecuteOn(AirbyteTaskExecutors.IO)
public List<ConnectionSyncResultRead> getConnectionUptimeHistory(ConnectionUptimeHistoryRequestBody connectionUptimeHistoryRequestBody) {
return null;
}

@Override
@Post(uri = "/delete")
@Status(HttpStatus.NO_CONTENT)
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/hooks/theme/useAirbyteTheme.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
colors.$grey-300
colors.$grey-400
colors.$grey-900

colors.$dark-blue
colors.$dark-blue-40
colors.$dark-blue-50
Expand Down

0 comments on commit 9e12bc0

Please sign in to comment.