-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Transform Admin APIs #13293
Merged
rockwotj
merged 2 commits into
redpanda-data:dev
from
rockwotj:rockwood/admin-api-stubs
Sep 14, 2023
Merged
Data Transform Admin APIs #13293
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
{ | ||
"apiVersion": "0.0.1", | ||
"swaggerVersion": "1.2", | ||
"basePath": "/v1", | ||
"apis": [ | ||
{ | ||
"path": "/v1/transform/deploy", | ||
"operations": [ | ||
{ | ||
"method": "POST", | ||
"summary": "Deploy a transform based on the provided metadata and wasm binary in the request payload. The payload should be the transform metadata in JSON format immediately followed by the WebAssembly binary without any delimiters.", | ||
"nickname": "deploy_transform", | ||
"consumes": [ | ||
"application/json+wasm" | ||
], | ||
"type": "void", | ||
"produces": [ | ||
"application/json" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"path": "/v1/transform/{name}", | ||
"operations": [ | ||
{ | ||
"method": "DELETE", | ||
rockwotj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"summary": "Delete a transform.", | ||
"type": "void", | ||
"nickname": "delete_transform", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "name", | ||
"in": "path", | ||
"required": true, | ||
"type": "string" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"path": "/v1/transform", | ||
"operations": [ | ||
{ | ||
"method": "GET", | ||
"type": "array", | ||
"items": { | ||
"type": "transform_metadata" | ||
}, | ||
"summary": "List all transforms, the status report contains a cluster wide aggregated view of the live transform execution state.", | ||
"nickname": "list_transforms", | ||
"produces": [ | ||
"application/json" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"models": { | ||
"deploy_transform_request": { | ||
"id": "deploy_transform_request", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"input_topic": { | ||
"type": "string" | ||
}, | ||
"output_topics": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"environment": { | ||
"type": "array", | ||
"items": { | ||
"type": "environment_variable" | ||
NyaliaLui marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"description": "The environment variable configuration for a transform" | ||
} | ||
} | ||
}, | ||
"transform_metadata": { | ||
NyaliaLui marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"id": "transform_metadata", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"input_topic": { | ||
"type": "string" | ||
}, | ||
"output_topics": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"status": { | ||
"type": "array", | ||
"items": { | ||
"type": "partition_transform_status" | ||
} | ||
}, | ||
"environment": { | ||
"type": "array", | ||
"items": { | ||
"type": "environment_variable" | ||
}, | ||
"description": "The environment variable configuration for a transform" | ||
} | ||
} | ||
}, | ||
"partition_transform_status": { | ||
"id": "partition_transform_status", | ||
"description": "The status of a single partition's transform", | ||
"properties": { | ||
"node_id": { | ||
"type": "int", | ||
"description": "id of a node" | ||
}, | ||
"partition": { | ||
"type": "int", | ||
"description": "partition in the input topic" | ||
}, | ||
"core": { | ||
"type": "int", | ||
"description": "id of a core on a given node" | ||
}, | ||
"status": { | ||
"type": "string", | ||
"enum": [ | ||
"running", | ||
"inactive", | ||
"errored", | ||
"unknown" | ||
], | ||
"description": "the status of a transform" | ||
} | ||
} | ||
}, | ||
"environment_variable": { | ||
"id": "environment_variable", | ||
"description": "Single key value pair for an environment", | ||
"properties": { | ||
"key": { | ||
"type": "string" | ||
}, | ||
"value": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The swagger on the admin API doesn't really work and isn't consistent, but I think we would generally have better luck with tooling when we do get to fixing it, if it was 2.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry is the suggestion here to make this one use the 2.0 format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing the swagger for the admin API is a huge project, I think it would be less burdensome if we use v2.0 for new stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I will update the transform doc to be v2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seastar does not actually support the v2 format even if seastar2code.py says that it does. Here's the patch, but the code generator explodes. @BenPope do you think we should fix it now? To be honest I would love a better format than swagger for these APIs anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenPope do we have some information on how to make new API files? I think people are copy-pasting without knowing of a better way (i myself am clueless). Given the existence of a multiple (2, 3?) different styles, do we gain much from selecting one over the other if the transition ends up being mechanical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ben and I had a conversation in DM about this (probably should have had this in a core channel) but there are no examples of adding models in the admin endpoints for swagger v2.
Honestly I like v2 much more, but would rather prefer a better codegen mechanism here instead of invalid json files :/