ServicesAddon
Create an Addon
POST
header
AuthorizationBearer <token>A credential of funcd's config, sent as Authorization: Bearer followed by its token.
dryRun?booleanAdmit the write and store nothing.
application/json- body
apiVersion*stringkind*stringmetadata*spec*status?OK
application/json- response
apiVersion*stringkind*stringmetadata*spec*status?curl -X POST 'https://example.com/apis/funcd.io/v1alpha1/addons' \ -H 'Content-Type: application/json' \ -d '{ "apiVersion": "string", "kind": "string", "metadata": {}, "spec": { "runtimes": [ { "name": "string", "workloads": [ "Function" ] } ] }}'Example Response
{ "apiVersion": "string", "kind": "string", "metadata": { "creationTimestamp": "2019-08-24T14:15:22Z", "deletionTimestamp": "2019-08-24T14:15:22Z", "finalizers": [ "string" ], "generateName": "string", "generation": 0, "name": "string", "namespace": "string", "ownerReferences": [ { "blockOwnerDeletion": true, "controller": true, "kind": "string", "name": "string", "namespace": "string", "uid": "string" } ], "resourceGroup": "string", "resourceVersion": "string", "tags": { "property1": "string", "property2": "string" }, "uid": "string" }, "spec": { "runtimes": [ { "attributes": { "basePath": "string", "config": null, "env": { "property1": "string", "property2": "string" }, "function": { "image": "string", "ref": "string" }, "kind": "string", "port": 1, "privatePaths": [ "string" ], "readiness": { "path": "string" }, "restore": { "env": { "property1": "string", "property2": "string" }, "path": "string", "timeout": "string" }, "resync": "string", "secretKeys": [ "string" ], "settings": [ { "constraints": { "count": { "perNamespace": 0, "perTarget": 0 }, "immutable": [ "string" ], "rules": [ { "message": "string", "rule": "string" } ], "unique": [ "string" ] }, "function": { "image": "string", "ref": "string" }, "kind": "string", "resync": "string", "target": "string" } ], "snapshot": { "path": "string" }, "storage": { "gid": 0, "path": "string", "uid": 0 } }, "image": "string", "name": "string", "workloads": [ "Function" ] } ] }, "status": { "conditions": [ { "lastTransitionTime": "2019-08-24T14:15:22Z", "message": "string", "observedGeneration": 0, "reason": "string", "status": "string", "type": "string" } ], "currentRevision": "string", "observedGeneration": 0, "phase": "Pending" }}Answers
| Status | Problem type | When | What to do |
|---|---|---|---|
| 200 | OK | ||
| 400 | urn:funcd:problem:invalid | A field breaks a rule that the schema cannot hold, which the detail names. | Correct the field that the detail names. |
| 400 | about:blank | The body is missing or is not JSON. | Send a JSON body. |
| 400 | urn:funcd:problem:invalid | The Addon's kind or a settings kind is a kind of funcd's, another kind of the Addon or a path that funcd serves, whatever the case; a replace changes or drops the kind, or changes a settings kind's target; or a runtime's name is one of funcd's runtimes or a key of runtime.containerd.imageOverride. | Choose another kind or runtime name. A new kind needs a new Addon, and a new target a new settings kind. |
| 400 | urn:funcd:problem:invalid | The registry of a runtime's image, or of a kind's function.image, is not one that addons.registries lists. | Use an image from a listed registry, or ask the operator to list its registry. |
| 400 | urn:funcd:problem:invalid | The kind entry's config is not a JSON Schema in funcd's contract profile, or an env value is not a literal or a single ${{ }} expression that the schema types. | Correct the field that the detail names. |
| 401 | urn:funcd:problem:unauthorized | The request carries no bearer token or API key, or one that funcd does not know. | Send a credential of funcd's config as a bearer token in the Authorization header, or in X-Api-Key. |
| 403 | urn:funcd:problem:forbidden | The credential's role does not allow it to create an Addon. | Use an admin's credential. |
| 409 | urn:funcd:problem:conflict | An Addon of that name already exists. | Choose another name, or replace the existing Addon. |
| 409 | urn:funcd:problem:conflict | Another Addon registers the same kind or the same plural, whatever the case, or ships a runtime of the same name. | Choose another kind or runtime name, or change the other Addon. |
| 413 | urn:funcd:problem:payload-too-large | The body is larger than 1 MiB. | Send a smaller body. |
| 415 | about:blank | The Content-Type of the body is not JSON. | Send the body as application/json. |
| 422 | about:blank | The query holds a parameter that the operation does not take. | Send only the parameters that the operation lists. |
| 422 | about:blank | The dryRun parameter is neither true nor false. | Send dryRun=true, or leave it out. |
| 422 | about:blank | The body breaks the schema: a field that it does not know, of the wrong type or past its limits. | Correct the field at the location that the detail gives. |