Skip to content

Commit 6f842ff

Browse files
committed
Add missing attr /system/function/{functionName}
1. Update swagger file to include attributes present in the POST endpoint but missing in the GET Relates to: openfaas#848 Signed-off-by: Edward Wilde <[email protected]>
1 parent af0ccc9 commit 6f842ff

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

api-docs/swagger.yml

+45
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,9 @@ definitions:
402402
cpu:
403403
type: string
404404
example: "0.01"
405+
readOnlyRootFilesystem:
406+
type: string
407+
description: if true, removes write-access from the root filesystem
405408
required:
406409
- service
407410
- image
@@ -444,6 +447,48 @@ definitions:
444447
type: object
445448
additionalProperties:
446449
type: string
450+
network:
451+
type: string
452+
description: Docker swarm network, usually func_functions
453+
example: func_functions
454+
envVars:
455+
type: object
456+
additionalProperties:
457+
type: string
458+
description: Overrides to environmental variables
459+
constraints:
460+
type: array
461+
items:
462+
type: string
463+
description: Constraints are specific to OpenFaaS Provider
464+
example: "node.platform.os == linux"
465+
secrets:
466+
type: array
467+
items:
468+
type: string
469+
description: An array of names of secrets that are required to be loaded from the Docker Swarm.
470+
example: "secret-name-1"
471+
limits:
472+
type: object
473+
properties:
474+
memory:
475+
type: string
476+
example: "128M"
477+
cpu:
478+
type: string
479+
example: "0.01"
480+
requests:
481+
type: object
482+
properties:
483+
memory:
484+
type: string
485+
example: "128M"
486+
cpu:
487+
type: string
488+
example: "0.01"
489+
readOnlyRootFilesystem:
490+
type: string
491+
description: if true, removes write-access from the root filesystem
447492
required:
448493
- name
449494
- image

gateway/requests/requests.go

+19-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,25 @@ type Function struct {
7474

7575
// Annotations are metadata for functions which may be used by the
7676
// back-end for management, orchestration, events and build tasks
77-
Annotations *map[string]string `json:"annotations"`
77+
Annotations *map[string]string `json:"annotations,omitempty"`
78+
79+
// Network is specific to Docker Swarm - default overlay network is: func_functions
80+
Network string `json:"network,omitempty"`
81+
82+
// EnvVars provides overrides for functions.
83+
EnvVars map[string]string `json:"envVars,omitempty"`
84+
85+
// Constraints are specific to back-end orchestration platform
86+
Constraints []string `json:"constraints,omitempty"`
87+
88+
// Secrets list of secrets to be made available to function
89+
Secrets []string `json:"secrets,omitempty"`
90+
91+
// Limits for function
92+
Limits *FunctionResources `json:"limits"`
93+
94+
// Requests of resources requested by function
95+
Requests *FunctionResources `json:"requests"`
7896
}
7997

8098
// AsyncReport is the report from a function executed on a queue worker.

0 commit comments

Comments
 (0)