-
Notifications
You must be signed in to change notification settings - Fork 17
Labels
FlinkRelated to Flink support and interactions (SQL documents, language server, views, etc)Related to Flink support and interactions (SQL documents, language server, views, etc)
Description
To fetch workspaces data, core logic. Probably just need:
func to check
- that we have a signed-in CCloud session
- if we don't, we sign in
- check to make sure we have resource matching envid, cc region, org id, catalog+db if possible
- make the GET request
- return JSON blob
Request snippet example:
GET https://flink/.{region}.{provider}.confluent.cloud/ws/v1/organizations/{orgId}/environments/{envId}/workspaces/{workspaceId}
Example JSON blob:
{
"api_version": "ws/v1",
"environment_id": "env-05wg89",
"kind": "Workspace",
"metadata": {
"created_at": "2025-08-19T20:04:56.123395Z",
"created_by": "u-yxpqrp",
"resource_version": "55",
"self": "https://flink.us-east1.gcp.confluent.cloud/ws/v1/organizations/f551c50b-0397-4f31-802d-d5371a49d3bf/environments/env-05wg89/workspaces/workspace-2025-08-19-200455",
"uid": "be062761-8a38-4086-9354-bf4724d28e9d",
"updated_at": "2025-11-21T18:41:41.634702Z"
},
"name": "workspace-2025-08-19-200455",
"organization_id": "f551c50b-0397-4f31-802d-d5371a49d3bf",
"spec": {
"blocks": [
{
"code_options": {
"source": [
"SELECT",
" genre,",
" COUNT(*) AS genre_count",
"FROM `spotify-listening-data`",
"CROSS JOIN UNNEST(genres) AS g(genre)",
"GROUP BY genre"
]
},
"properties": {
"app_id": "b07527ad-c2b1-4d2f-b072-111968094586",
"history": "[{\"timestamp\":\"2025-11-21T18:34:30.475Z\",\"statementsNames\":[\"workspace-2025-08-19-200455-e2f81ebe-a6ed-4fd4-b070-f8a589a61e29\"]}]"
},
"type": "CODE"
},
{
"code_options": {
"source": [
"SELECT",
" track.album.name AS album_name,",
" track.name AS track_name,",
" LISTAGG(a.name, ', ') AS artist_names",
"FROM `spotify-listening-data` as sld",
"CROSS JOIN UNNEST(artists) AS a",
"WHERE array_contains(sld.genres, 'baroque pop')",
"GROUP BY track.album.name, track.name;"
]
},
"properties": {
"app_id": "de1cab5e-dea0-49e2-abd0-5d6960298b87",
"history": "[{\"timestamp\":\"2025-11-21T18:41:40.112Z\",\"statementsNames\":[\"workspace-2025-08-19-200455-04e23ca1-5f38-43cc-b3b9-4229805c8034\"]}]"
},
"type": "CODE"
}
],
"compute_pool": {
"environment": "env-05wg89",
"id": "lfcp-jy8ppq",
"related": "https://flink.us-east1.gcp.confluent.cloud/fcpm/v2/compute-pools/lfcp-jy8ppq",
"resource_name": "crn://confluent.cloud/organization=f551c50b-0397-4f31-802d-d5371a49d3bf/environment=env-05wg89/flink-region=GCP.us-east1/compute-pool=lfcp-jy8ppq"
},
"display_name": "workspace-2025-08-19-200455",
"properties": {
"sql-catalog": "env-05wg89",
"sql-database": "lkc-5vmjd8"
}
},
"status": {
"network_kind": "PUBLIC"
}
}
Once we get this back, we can create .flink.sql docs, do a for loop through for an MVP. Consider: set a limit of 10 statements? for follow on
Metadata
Metadata
Assignees
Labels
FlinkRelated to Flink support and interactions (SQL documents, language server, views, etc)Related to Flink support and interactions (SQL documents, language server, views, etc)