The new spec includes the following changes from v1:
the API paths now include a version prefix, /v2. The goal is to allow a compatabiliy period where both APIs are deployed.
the path structures try to emphasize a nested REST-ful struture. Specifically, the logs and scale endpoints are now sub-paths of the function
Reference to service are now replaced with Function, request and response objects, fields, and parameters should always use function and not service. The one exception is the PrometheusAlertRequest object, where we can not control this schema.
There should only be one path for each action. For example creating a function is now a PUT on system/functions/{functionName} instead of supporting both POST on /system/functions and PUT on the named path.
To bring consistency between the invoke and system endpoints, the name parameters are defined as a regex pattern with an optional .namespace suffix. Specifically, to create a function echo in the default namespace you PUT to system/functions/echo. To create the echo function in the internal namespace, you would use system/functions/echo.internal. Both functions and secrets support this pattern now.
To ensure consistency, there is a NamespacedNameParameter object in the spec. It defines the following regexp pattern using named groups. ^(?<name>[a-zA-Z][a-zA-Z0-9-_]*)(.(?<namespace>[a-zA-Z][a-zA-Z0-9-_]*)?)$ This is valid for the OpenAPI spec, but the named groups might not be supported in all languages. If we want to support code generation, we should consider removing the named groups, this is the equivalent pattern ^([a-zA-Z][a-zA-Z0-9-_]*)(.[a-zA-Z][a-zA-Z0-9-_]*)?$
Note that the list endpoints still support a GET query parameter for namespace.
Motivation and Context
[ ] I have raised an issue to propose this change (required)
[ ] My issue has received approval from the maintainers or lead with the design/approved label
This was discussed several times in community calls, so I am posting this here so that some kind of consensus can be made. A PR allows comments on specific lines, which is much easier to follow vs an issue.
How Has This Been Tested?
NA
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[ ] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
This is a proposal for a new standardized v2 API.
The new spec includes the following changes from v1:
/v2
. The goal is to allow a compatabiliy period where both APIs are deployed.logs
andscale
endpoints are now sub-paths of the functionfunction
and notservice
. The one exception is the PrometheusAlertRequest object, where we can not control this schema.PUT
onsystem/functions/{functionName}
instead of supporting bothPOST
on/system/functions
andPUT
on the named path.To bring consistency between the invoke and system endpoints, the
name
parameters are defined as a regex pattern with an optional.namespace
suffix. Specifically, to create a functionecho
in the default namespace youPUT
tosystem/functions/echo
. To create theecho
function in theinternal
namespace, you would usesystem/functions/echo.internal
. Both functions and secrets support this pattern now.To ensure consistency, there is a
NamespacedNameParameter
object in the spec. It defines the following regexp pattern using named groups.^(?<name>[a-zA-Z][a-zA-Z0-9-_]*)(.(?<namespace>[a-zA-Z][a-zA-Z0-9-_]*)?)$
This is valid for the OpenAPI spec, but the named groups might not be supported in all languages. If we want to support code generation, we should consider removing the named groups, this is the equivalent pattern^([a-zA-Z][a-zA-Z0-9-_]*)(.[a-zA-Z][a-zA-Z0-9-_]*)?$
GET
query parameter fornamespace
.Motivation and Context
design/approved
label This was discussed several times in community calls, so I am posting this here so that some kind of consensus can be made. A PR allows comments on specific lines, which is much easier to follow vs an issue.How Has This Been Tested?
NA
Types of changes
Checklist:
git commit -s