Apoxy
Extensions API

Edge Functions

API reference for Edge Functions (extensions.apoxy.dev/v1alpha2)

API Group: extensions.apoxy.dev/v1alpha2

Operations

List Edge Functions

GET/apis/extensions.apoxy.dev/v1alpha2/edgefunctions

List EdgeFunction

Response

  • 200: OK

Create Edge Function

POST/apis/extensions.apoxy.dev/v1alpha2/edgefunctions

create an EdgeFunction

Request Body

Spec fields (EdgeFunctionSpec):

FieldTypeDescription
revisionHistoryLimitinteger (int32)RevisionHistoryLimit is the number of old revisions to keep. Defaults to 10.
templateEdgeFunctionRevisionSpecTemplate is the template of the function. (required)

Response

  • 200: OK
  • 201: Created
  • 202: Accepted

Delete All Edge Functions

DELETE/apis/extensions.apoxy.dev/v1alpha2/edgefunctions

Delete collection of EdgeFunction

Response

  • 200: OK

Get Edge Function

GET/apis/extensions.apoxy.dev/v1alpha2/edgefunctions/{name}

Get the specified EdgeFunction

Response

  • 200: OK

Replace Edge Function

PUT/apis/extensions.apoxy.dev/v1alpha2/edgefunctions/{name}

Replace the specified EdgeFunction

Request Body

Spec fields (EdgeFunctionSpec):

FieldTypeDescription
revisionHistoryLimitinteger (int32)RevisionHistoryLimit is the number of old revisions to keep. Defaults to 10.
templateEdgeFunctionRevisionSpecTemplate is the template of the function. (required)

Response

  • 200: OK
  • 201: Created

Update Edge Function

PATCH/apis/extensions.apoxy.dev/v1alpha2/edgefunctions/{name}

Partially update the specified EdgeFunction

Response

  • 200: OK
  • 201: Created

Delete Edge Function

DELETE/apis/extensions.apoxy.dev/v1alpha2/edgefunctions/{name}

delete an EdgeFunction

Response

  • 200: OK
  • 202: Accepted

Schema Reference

EdgeFunctionRevisionSpec

FieldTypeDescription
codeEdgeFunctionCodeSourceCode is the source of the function code/binary. (required)
envEnvVar[]Env is a list of environment variables to set in the function runtime. These will be available via WASIp1 environ* routines as well as Apoxy Runtime SDK APIs.
modestringMode is runtime mode of the function. (required)
runtimeEdgeFunctionRuntimeConfiguration for the function runtime.

EdgeFunctionCodeSource

FieldTypeDescription
goPluginSourceGoPluginSourceGoSource specifies sources for the Go filter plugin. This option is only available for non-cloud (kubernets, unmanaged, etc) Proxy providers.
jsSourceJavaScriptSourceJsSource specifies sources for the JavaScript function runtime. If set/modified, a function will undergo a build step to compile the JavaScript source into a WebAssembly binary before it is deployed.
wasmSourceWasmSourceWasmSource specifies sources for the WebAssembly function runtime.

GoPluginSource

FieldTypeDescription
ociOCIImageRefOCI is the OCI image reference to the Go plugin.
pluginConfigstringPluginConfig is the configuration passed to the Go plugin as JSON-encoded structpb.Struct message. Plugin will receive it as anypb.Any message.
urlstringURL is the URL to the Go plugin .so

OCIImageRef

FieldTypeDescription
credentialsOCICredentialsCredentials is the credentials for pulling the OCI image. Only one of Credentials or CredentialsRef may be specified.
credentialsRefOCICredentialsObjectReferenceCredentialsRef is the reference to the secret containing the credentials for pulling the OCI image. Only one of Credentials or CredentialsRef may be specified.
repostringRepo is the repository of the OCI image. (required)
tagstringTag is the tag of the OCI image.

OCICredentials

FieldTypeDescription
passwordstringPassword is the password for the OCI registry. This field is write-only and is not returned in the response.
passwordDatastringPasswordData is the base64 encoded password for the OCI registry.
usernamestringUsername is the username for the OCI registry.

OCICredentialsObjectReference

FieldTypeDescription
groupstringGroup is the group of the target resource. (required)
namestringName is the name of the target resource. (required)
namespacestringNamespace is the namespace of the target resource. (required)

JavaScriptSource

FieldTypeDescription
assetsJavaScriptAssetsSourceAsset accepts a list of source files to be included in the function. Only one of Assets, Git, or Npm may be specified.
entrypointstringEntrypoint is the entrypoint path to the function. (required)
gitJavaScriptGitSourceGit is the git source for the function. Only one of Assets, Git, or Npm may be specified.
npmJavaScriptNpmSourceNpm is the npm source for the function. Only one of Assets, Git, or Npm may be specified.

JavaScriptAssetsSource

FieldTypeDescription
filesSourceFile[](required)

JavaScriptGitSource

FieldTypeDescription
branchstringBranch is the git branch.
commitstringCommit is the git commit.
repositorystringRepository is the git repository URL. (required)

JavaScriptNpmSource

FieldTypeDescription
packagestringPackage is the npm package name. (required)
versionstringVersion is the npm package version.

WasmSource

FieldTypeDescription
urlstringURL is the URL to the WebAssembly binary. (required)

EdgeFunctionRuntime

FieldTypeDescription
capabilitiesRuntimeCapabilitiesCapabilities is the list of capabilities granted to the function.
portinteger (int32)Port is the port the function listens on. Defaults to 8080.
timeoutDurationTimeout is the maximum time the function is allowed to run. Defaults to 30 seconds but can be increased depending on your plan.

RuntimeCapabilities

FieldTypeDescription
fetchAPIbooleanFetchAPI is the capability to fetch data from the internet. Defaults to true.
kvbooleanK/V is the capability to access the key/value store. Defaults to true.

On this page