Function
Operations
| Method | Endpoint | Description |
|---|---|---|
GET |
/function |
List retrieves a map of Functions across the Organization |
GET |
/space/{space_id}/function |
List retrieves a map of Functions |
POST |
/function/invoke |
Invoke Functions across Org |
POST |
/function/reduce |
Reduce what functions return across Units in the Organization |
POST |
/space/{space_id}/function/invoke |
Invoke Functions |
POST |
/space/{space_id}/function/reduce |
Reduce what functions return across Units |
List retrieves a map of Functions across the Organization
GET /function
List retrieves a map of Functions across the Organization
Operation ID: ListOrgFunctions
Parameters
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
executor_space |
string | Space ID or slug whose executor to use for listing or invoking builtin functions | |
where |
string | The specified string is an expression for the purpose of filtering the list of FunctionSignatures returned. The expression syntax was inspired by SQL. It supports conjunctions using AND of relational expressions of the form attribute operator attribute_or_literal. The attribute names are case-sensitive and PascalCase, as in the JSON encoding. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, NOT LIKE and !~~ for negated pattern matching. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. UUIDs and boolean attributes support equality and inequality only. UUID and time literals must be quoted as string literals. String literals are quoted with single quotes, such as 'string'. Time literals use the same form as when serialized as JSON, such as: CreatedAt > '2025-02-18T23:16:34'. Integer and boolean literals are also supported for attributes of those types. Arrays support the ? operator to to match any element of the array, as in FromLinkID ? '7c61626f-ddbe-41af-93f6-b69f4ab6d308'. Arrays can perform LEN() to check for length, as in LEN(FromLinkID) > 0. An attribute naming a list of other entities can be filtered on their attributes with a * segment, as in FromLink.*.Slug = 'upgrade-app', which holds when any element satisfies it. Without the * such a reference is an error, since it names no single value to compare. Map support the dot notation to specify a particular map key, as in Labels.tier = 'Backend'. Maps support IS NULL and IS NOT NULL with dot notation to check for key absence or presence, as in Labels.tier IS NULL (key doesn't exist) or Labels.tier IS NOT NULL (key exists). Comparison results can be tested with IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE. These are useful for nullable columns: MergeSourceID = '<uuid>' IS NOT FALSE matches rows where MergeSourceID equals the value OR is NULL. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as Slug IN ('slugone', 'slugtwo') or Labels.environment IN ('prod', 'staging'). Conjunctions are supported using the AND operator. An example conjunction is: CreatedAt >= '2025-01-07' AND Slug = 'test' AND Labels.mykey = 'myvalue'. Supported attributes for filtering on FunctionSignature: AttributeName, Description, FunctionName, FunctionType, Hermetic, Idempotent, Mutating, OutputInfo.Description, OutputInfo.OutputType, OutputInfo.ResultName, Replayable, RequiredParameters, ToolchainType, Validating, VarArgs. The whole string must be query-encoded. |
Responses
| Status | Description | Content-Type | Schema |
|---|---|---|---|
| 200 | OK | application/json |
object |
| 400 | Function request is invalid (Bad Request). | application/json |
StandardErrorResponse |
| 401 | Unauthorized access. | application/json |
StandardErrorResponse |
| 403 | Forbidden access. | application/json |
StandardErrorResponse |
| 404 | Function not found. | application/json |
StandardErrorResponse |
| 500 | Something went wrong while processing Function. | application/json |
StandardErrorResponse |
| 503 | Something Function needs is not available now, such as a client holding a Channel a function runs on. Retry later. | application/json |
StandardErrorResponse |
| 504 | Something Function waited on did not answer in time, such as a function run on a Channel. | application/json |
StandardErrorResponse |
| default | Unexpected error. | application/json |
StandardErrorResponse |
List retrieves a map of Functions
GET /space/{space_id}/function
List retrieves a map of Functions
Operation ID: ListFunctions
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
space_id |
string | ✓ | Unique identifier for a space_id |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entity |
string | Type of entity whose functions should be listed: channel | |
id |
string | ID of the channel whose functions should be listed | |
where |
string | The specified string is an expression for the purpose of filtering the list of FunctionSignatures returned. The expression syntax was inspired by SQL. It supports conjunctions using AND of relational expressions of the form attribute operator attribute_or_literal. The attribute names are case-sensitive and PascalCase, as in the JSON encoding. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, NOT LIKE and !~~ for negated pattern matching. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. UUIDs and boolean attributes support equality and inequality only. UUID and time literals must be quoted as string literals. String literals are quoted with single quotes, such as 'string'. Time literals use the same form as when serialized as JSON, such as: CreatedAt > '2025-02-18T23:16:34'. Integer and boolean literals are also supported for attributes of those types. Arrays support the ? operator to to match any element of the array, as in FromLinkID ? '7c61626f-ddbe-41af-93f6-b69f4ab6d308'. Arrays can perform LEN() to check for length, as in LEN(FromLinkID) > 0. An attribute naming a list of other entities can be filtered on their attributes with a * segment, as in FromLink.*.Slug = 'upgrade-app', which holds when any element satisfies it. Without the * such a reference is an error, since it names no single value to compare. Map support the dot notation to specify a particular map key, as in Labels.tier = 'Backend'. Maps support IS NULL and IS NOT NULL with dot notation to check for key absence or presence, as in Labels.tier IS NULL (key doesn't exist) or Labels.tier IS NOT NULL (key exists). Comparison results can be tested with IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE. These are useful for nullable columns: MergeSourceID = '<uuid>' IS NOT FALSE matches rows where MergeSourceID equals the value OR is NULL. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as Slug IN ('slugone', 'slugtwo') or Labels.environment IN ('prod', 'staging'). Conjunctions are supported using the AND operator. An example conjunction is: CreatedAt >= '2025-01-07' AND Slug = 'test' AND Labels.mykey = 'myvalue'. Supported attributes for filtering on FunctionSignature: AttributeName, Description, FunctionName, FunctionType, Hermetic, Idempotent, Mutating, OutputInfo.Description, OutputInfo.OutputType, OutputInfo.ResultName, Replayable, RequiredParameters, ToolchainType, Validating, VarArgs. The whole string must be query-encoded. |
Responses
| Status | Description | Content-Type | Schema |
|---|---|---|---|
| 200 | OK | application/json |
object |
| 400 | Function request is invalid (Bad Request). | application/json |
StandardErrorResponse |
| 401 | Unauthorized access. | application/json |
StandardErrorResponse |
| 403 | Forbidden access. | application/json |
StandardErrorResponse |
| 404 | Function not found. | application/json |
StandardErrorResponse |
| 500 | Something went wrong while processing Function. | application/json |
StandardErrorResponse |
| 503 | Something Function needs is not available now, such as a client holding a Channel a function runs on. Retry later. | application/json |
StandardErrorResponse |
| 504 | Something Function waited on did not answer in time, such as a function run on a Channel. | application/json |
StandardErrorResponse |
| default | Unexpected error. | application/json |
StandardErrorResponse |
Invoke Functions across Org
POST /function/invoke
Invoke Functions across Units in the Organization
Operation ID: InvokeFunctionsOnOrg
Parameters
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
executor_space |
string | Space ID or slug whose executor to use for listing or invoking builtin functions | |
dry_run |
string | Dry run mode: when true, skip updating configuration data even if it changed | |
protect |
boolean | Deprecated: use guards, as {"Override":"Upstream"} or {"Override":"External"}. Records the paths this operation writes as local overrides a merge must not overwrite: each Unit's Override guard -- Override=Upstream for a Unit with an upstream Unit, Override=External for one without -- with the clearance to write over one. A guard this request names under Override wins. | |
clearance |
string | The classes of guarded reason this operation is cleared for, as a JSON Clearance -- a list of {Key, Operator, Values} requirements, where Operator is Exists, In, NotIn, or DoesNotExist. A path whose guards this does not cover is not written, and the withheld change is reported as a Guarded conflict. An absent or empty clearance clears nothing, which only matters for a Unit that has guards. | |
guards |
string | The guards this operation records on the paths it writes, as a JSON object of guard key to value -- the reasons those paths hold what they hold, so a later operation must be cleared for them before overwriting. The guard analogue of protect: protect claims the paths, this says why. It only ever adds and overwrites the keys it names -- retiring a guard is the /guard API (cub unit set-guard --remove-guard). | |
inherited_guards |
string | The guards this operation records on the paths it writes as inherited guards, in the form guards takes: a clone of the Unit receives them, and a merge carries them, and any later change to them, to the Units downstream of it. Guards set through guards stay with the Unit they are on. A key may not be in both. The clearance has to cover these as it covers guards. | |
change_set_id |
string | Must match ChangeSetID of affected Units unless in dry run mode; not valid when invoked on Revisions | |
change_order |
string | ChangeOrder to promote, which must have UpdateType Invoke. What runs then comes from the ChangeOrder rather than from the request body, which may not carry functions, triggers or invocations of its own; that is what holds every Space in scope to the same change. Only the Units the ChangeOrder covers are reached, a Unit that has already taken it is passed over, and every Unit reached is marked with the ChangeOrder's start and end Tags -- both on the head, with no Revision made, where the invocation changed nothing. Not valid when invoked on Revisions. | |
subgroup |
string | User-defined category for the Mutation. Must be alphanumeric, at most 64 characters. The prefix 'ConfigHub' is reserved. | |
other_data_source |
string | Additional configuration data to pass as OtherData to the functions the request names, and to the invocations that name none of their own; triggers pass what they name. Either a revision of each Unit, named LastReleasedRevisionNum or HeadRevisionNum, optionally prefixed with 'Before:' (e.g., Before:HeadRevisionNum), which the functions read under that name, or another Unit, as Unit: |
|
where |
string | The specified string is an expression for the purpose of filtering the list of Units returned. The expression syntax was inspired by SQL. It supports conjunctions using AND of relational expressions of the form attribute operator attribute_or_literal. The attribute names are case-sensitive and PascalCase, as in the JSON encoding. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, NOT LIKE and !~~ for negated pattern matching. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. UUIDs and boolean attributes support equality and inequality only. UUID and time literals must be quoted as string literals. String literals are quoted with single quotes, such as 'string'. Time literals use the same form as when serialized as JSON, such as: CreatedAt > '2025-02-18T23:16:34'. Integer and boolean literals are also supported for attributes of those types. Arrays support the ? operator to to match any element of the array, as in FromLinkID ? '7c61626f-ddbe-41af-93f6-b69f4ab6d308'. Arrays can perform LEN() to check for length, as in LEN(FromLinkID) > 0. An attribute naming a list of other entities can be filtered on their attributes with a * segment, as in FromLink.*.Slug = 'upgrade-app', which holds when any element satisfies it. Without the * such a reference is an error, since it names no single value to compare. Map support the dot notation to specify a particular map key, as in Labels.tier = 'Backend'. Maps support IS NULL and IS NOT NULL with dot notation to check for key absence or presence, as in Labels.tier IS NULL (key doesn't exist) or Labels.tier IS NOT NULL (key exists). Comparison results can be tested with IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE. These are useful for nullable columns: MergeSourceID = '<uuid>' IS NOT FALSE matches rows where MergeSourceID equals the value OR is NULL. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as Slug IN ('slugone', 'slugtwo') or Labels.environment IN ('prod', 'staging'). Conjunctions are supported using the AND operator. An example conjunction is: CreatedAt >= '2025-01-07' AND Slug = 'test' AND Labels.mykey = 'myvalue'. Supported attributes for filtering on Unit: Annotations, ApplyGates, ApplyWarnings, ChangeSetID, Conflicts, CreatedAt, DataHash, DeleteGates, DestroyGates, DisplayName, FromLinkID, HeadRevisionID, HeadRevisionNum, HiddenReason, Labels, LastChangeDescription, LastReleasedRevisionNum, LinkFindings, MutationSources, NeededPaths, OrganizationID, PathAnnotations, Permissions, ProvidedPaths, Slug, SpaceID, TargetID, ToolchainType, UnitID, Unreleasable, UpdatedAt, UpstreamRevisionNum, UpstreamSpaceID, UpstreamUnitID, ValidationErrors, ValidationPassed, ValidationResults, ValidationSkipped, ValidationTriggerIDs, ValidationWarnings, ValueTriggerIDs, Values. Finding all units created by cloning can be done using the expression UpstreamRevisionNum > 0. Clones of a specific unit can be found by additionally filtering based on UpstreamUnitID. Units never released can be found using LastReleasedRevisionNum = 0. Units with unreleased changes can be found with HeadRevisionNum > LastReleasedRevisionNum AND ReleaseTargetID IS NOT NULL AND Unreleasable = false. The whole string must be query-encoded. |
|
filter |
string | UUID of a Filter entity to apply to the Unit list. The Filter must be in the same Organization as the user credentials. The Filter's From field must match the entity type being filtered (Unit). For Space-resident entities, if the Filter has a FromSpaceID, it must match the operation's SpaceID. The Filter's Where clause will be combined with any explicit 'where' parameter using AND logic. If both 'filter' and 'where' parameters are specified, they are combined with AND logic. | |
include_hidden |
string | Hidden Unit entities, those with a HiddenReason, are left out of the results, or of what a bulk operation acts on, unless this names their HiddenReason. It is a comma-separated list of HiddenReasons, or * for all of them but Archived. A where clause naming the entities, by their Slug or ID with = or IN, or naming HiddenReason at all, also returns hidden entities it selects. Archived entities, which a delete with archive=true archives, are selected only when this names Archived, as in Archived or *,Archived; a where clause naming them returns them from a List or Search, but not from a bulk operation. ConfigHub/YAML Units, which hold the configuration of entities, are hidden with the HiddenReason BackingUnit. |
|
include |
string | Comma-separated parts of the result to return in addition to the default: ConfigData for the configuration the invocation produced, carried whether or not the invocation changed it. Without it, the configuration is present only when the invocation changed it, and an unchanged result is reported by DataHash alone. Diff for what the invocation changed in each Unit, path by path with the values on both sides. Supported values: ConfigData, Diff. | |
resource_type |
string | Resource type: Resource type to match for the desired ToolchainType, for example apps/v1/Deployment | |
where_data |
string | Where data: The specified string is an expression for the purpose of evaluating whether the configuration data matches the filter. It supports conjunctions using AND of relational expressions of the form path operator literal. The path specifications are dot-separated, for both map fields and array indices, as in spec.template.spec.containers.0.image = 'ghcr.io/headlamp-k8s/headlamp:latest' AND spec.replicas > 1. Path expressions support * for wildcard array or map segments and ?key=value syntax for associative matches of array elements containing objects with a key attribute. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, ILIKE, ~~, !~~, ~, !~, ~*, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, !~~ for NOT LIKE. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. Boolean values support equality and inequality only. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as spec.template.spec.containers.0.image#reference IN (':latest', ':arm64-latest'). The syntax .\| splits the path: the left side selects, and the right side is a property of what was selected. On the right side of a .\|, and only there, != is true when the property is absent: spec.containers.*.\|image != 'nginx' selects the containers and asks that none of their images be nginx, which a container with no image satisfies. Everywhere else a path that is not present is not a match, != included. String literals are quoted with single quotes, such as 'string'. Integer and boolean literals are also supported for attributes of those types. The whole string must be query-encoded. |
|
where_data_engine |
string | Which engine answers where_data and resource_type: sql (the default) evaluates the expression against the stored resource projection in a single query, falling back to the function engine for the expressions it cannot translate; function invokes the where-filter function on each candidate Unit, reading every one's configuration; shadow runs both, answers with function, and logs any disagreement. Temporary: function is the escape hatch for one release, after which this parameter goes away. |
|
where_trigger |
string | Where expression to match Triggers. Matched triggers are invoked on each unit to filter by validation results. Use with triggers_passed to control whether passing or failing units are returned (default: failing). | |
trigger_filter |
string | Filter UUID (with From=Trigger). The filter's matching triggers are invoked on units to filter by validation results. Can be combined with where_trigger. | |
triggers_passed |
boolean | When true, return units that pass trigger validation; when false (default), return units that fail. Only applies when where_trigger or trigger_filter is specified. | |
view |
string | UUID of a View of Unit. Its Filter selects the Units as the filter parameter does, so the two may not both be specified. |
Request Body
Content-Type: application/json
Schema: FunctionInvocationsRequest
Responses
| Status | Description | Content-Type | Schema |
|---|---|---|---|
| 200 | OK | application/json |
Array of FunctionInvocationsResponse |
| 207 | Multi-Status: Mixed success and failure results | application/json |
Array of FunctionInvocationsResponse |
| 400 | Function request is invalid (Bad Request). | application/json |
StandardErrorResponse |
| 401 | Unauthorized access. | application/json |
StandardErrorResponse |
| 403 | Forbidden access. | application/json |
StandardErrorResponse |
| 404 | Function not found. | application/json |
StandardErrorResponse |
| 409 | Function data conflict. Data has changed since last read. | application/json |
StandardErrorResponse |
| 422 | Unable to process configuration data | application/json |
StandardErrorResponse |
| 500 | Something went wrong while processing Function. | application/json |
StandardErrorResponse |
| 503 | A Channel's client is unavailable; one or more function sources were not executed | application/json |
StandardErrorResponse |
| 504 | Timed out waiting for a Channel's client to return a function result | application/json |
StandardErrorResponse |
| default | Unexpected error. | application/json |
StandardErrorResponse |
Reduce what functions return across Units in the Organization
POST /function/reduce
Runs the map, functions that read configuration and return an AttributeValueList, on each Unit selected, puts each value they return, a row, into groups by GroupBy, and runs the reducer, such as reduce-starlark, once per group on the group's rows. Nothing is written. The reducer runs on the executor of the Space, or with executor_space across the Organization; each Unit's map runs on the executor of its own Space.
Operation ID: ReduceFunctionsOnOrg
Parameters
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
executor_space |
string | Space ID or slug whose executor to use for listing or invoking builtin functions | |
where |
string | The specified string is an expression for the purpose of filtering the list of Units returned. The expression syntax was inspired by SQL. It supports conjunctions using AND of relational expressions of the form attribute operator attribute_or_literal. The attribute names are case-sensitive and PascalCase, as in the JSON encoding. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, NOT LIKE and !~~ for negated pattern matching. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. UUIDs and boolean attributes support equality and inequality only. UUID and time literals must be quoted as string literals. String literals are quoted with single quotes, such as 'string'. Time literals use the same form as when serialized as JSON, such as: CreatedAt > '2025-02-18T23:16:34'. Integer and boolean literals are also supported for attributes of those types. Arrays support the ? operator to to match any element of the array, as in FromLinkID ? '7c61626f-ddbe-41af-93f6-b69f4ab6d308'. Arrays can perform LEN() to check for length, as in LEN(FromLinkID) > 0. An attribute naming a list of other entities can be filtered on their attributes with a * segment, as in FromLink.*.Slug = 'upgrade-app', which holds when any element satisfies it. Without the * such a reference is an error, since it names no single value to compare. Map support the dot notation to specify a particular map key, as in Labels.tier = 'Backend'. Maps support IS NULL and IS NOT NULL with dot notation to check for key absence or presence, as in Labels.tier IS NULL (key doesn't exist) or Labels.tier IS NOT NULL (key exists). Comparison results can be tested with IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE. These are useful for nullable columns: MergeSourceID = '<uuid>' IS NOT FALSE matches rows where MergeSourceID equals the value OR is NULL. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as Slug IN ('slugone', 'slugtwo') or Labels.environment IN ('prod', 'staging'). Conjunctions are supported using the AND operator. An example conjunction is: CreatedAt >= '2025-01-07' AND Slug = 'test' AND Labels.mykey = 'myvalue'. Supported attributes for filtering on Unit: Annotations, ApplyGates, ApplyWarnings, ChangeSetID, Conflicts, CreatedAt, DataHash, DeleteGates, DestroyGates, DisplayName, FromLinkID, HeadRevisionID, HeadRevisionNum, HiddenReason, Labels, LastChangeDescription, LastReleasedRevisionNum, LinkFindings, MutationSources, NeededPaths, OrganizationID, PathAnnotations, Permissions, ProvidedPaths, Slug, SpaceID, TargetID, ToolchainType, UnitID, Unreleasable, UpdatedAt, UpstreamRevisionNum, UpstreamSpaceID, UpstreamUnitID, ValidationErrors, ValidationPassed, ValidationResults, ValidationSkipped, ValidationTriggerIDs, ValidationWarnings, ValueTriggerIDs, Values. Finding all units created by cloning can be done using the expression UpstreamRevisionNum > 0. Clones of a specific unit can be found by additionally filtering based on UpstreamUnitID. Units never released can be found using LastReleasedRevisionNum = 0. Units with unreleased changes can be found with HeadRevisionNum > LastReleasedRevisionNum AND ReleaseTargetID IS NOT NULL AND Unreleasable = false. The whole string must be query-encoded. |
|
filter |
string | UUID of a Filter entity to apply to the Unit list. The Filter must be in the same Organization as the user credentials. The Filter's From field must match the entity type being filtered (Unit). For Space-resident entities, if the Filter has a FromSpaceID, it must match the operation's SpaceID. The Filter's Where clause will be combined with any explicit 'where' parameter using AND logic. If both 'filter' and 'where' parameters are specified, they are combined with AND logic. | |
include_hidden |
string | Hidden Unit entities, those with a HiddenReason, are left out of the results, or of what a bulk operation acts on, unless this names their HiddenReason. It is a comma-separated list of HiddenReasons, or * for all of them but Archived. A where clause naming the entities, by their Slug or ID with = or IN, or naming HiddenReason at all, also returns hidden entities it selects. Archived entities, which a delete with archive=true archives, are selected only when this names Archived, as in Archived or *,Archived; a where clause naming them returns them from a List or Search, but not from a bulk operation. ConfigHub/YAML Units, which hold the configuration of entities, are hidden with the HiddenReason BackingUnit. |
|
resource_type |
string | Resource type: Resource type to match for the desired ToolchainType, for example apps/v1/Deployment | |
where_data |
string | Where data: The specified string is an expression for the purpose of evaluating whether the configuration data matches the filter. It supports conjunctions using AND of relational expressions of the form path operator literal. The path specifications are dot-separated, for both map fields and array indices, as in spec.template.spec.containers.0.image = 'ghcr.io/headlamp-k8s/headlamp:latest' AND spec.replicas > 1. Path expressions support * for wildcard array or map segments and ?key=value syntax for associative matches of array elements containing objects with a key attribute. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, ILIKE, ~~, !~~, ~, !~, ~*, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, !~~ for NOT LIKE. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. Boolean values support equality and inequality only. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as spec.template.spec.containers.0.image#reference IN (':latest', ':arm64-latest'). The syntax .\| splits the path: the left side selects, and the right side is a property of what was selected. On the right side of a .\|, and only there, != is true when the property is absent: spec.containers.*.\|image != 'nginx' selects the containers and asks that none of their images be nginx, which a container with no image satisfies. Everywhere else a path that is not present is not a match, != included. String literals are quoted with single quotes, such as 'string'. Integer and boolean literals are also supported for attributes of those types. The whole string must be query-encoded. |
|
where_data_engine |
string | Which engine answers where_data and resource_type: sql (the default) evaluates the expression against the stored resource projection in a single query, falling back to the function engine for the expressions it cannot translate; function invokes the where-filter function on each candidate Unit, reading every one's configuration; shadow runs both, answers with function, and logs any disagreement. Temporary: function is the escape hatch for one release, after which this parameter goes away. |
|
where_trigger |
string | Where expression to match Triggers. Matched triggers are invoked on each unit to filter by validation results. Use with triggers_passed to control whether passing or failing units are returned (default: failing). | |
trigger_filter |
string | Filter UUID (with From=Trigger). The filter's matching triggers are invoked on units to filter by validation results. Can be combined with where_trigger. | |
triggers_passed |
boolean | When true, return units that pass trigger validation; when false (default), return units that fail. Only applies when where_trigger or trigger_filter is specified. | |
view |
string | UUID of a View of Unit. Its Filter selects the Units as the filter parameter does, so the two may not both be specified. |
Request Body
Content-Type: application/json
Schema: FunctionReduceRequest
Responses
| Status | Description | Content-Type | Schema |
|---|---|---|---|
| 200 | OK | application/json |
FunctionReduceResponse |
| 400 | Function request is invalid (Bad Request). | application/json |
StandardErrorResponse |
| 401 | Unauthorized access. | application/json |
StandardErrorResponse |
| 403 | Forbidden access. | application/json |
StandardErrorResponse |
| 404 | Function not found. | application/json |
StandardErrorResponse |
| 409 | Function data conflict. Data has changed since last read. | application/json |
StandardErrorResponse |
| 500 | Something went wrong while processing Function. | application/json |
StandardErrorResponse |
| 503 | Something Function needs is not available now, such as a client holding a Channel a function runs on. Retry later. | application/json |
StandardErrorResponse |
| 504 | Something Function waited on did not answer in time, such as a function run on a Channel. | application/json |
StandardErrorResponse |
| default | Unexpected error. | application/json |
StandardErrorResponse |
Invoke Functions
POST /space/{space_id}/function/invoke
Invoke Functions
Operation ID: InvokeFunctions
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
space_id |
string | ✓ | Unique identifier for a space_id |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
unit_id |
string | Unit ID of the Revision to invoke functions on | |
revision_id |
string | Revision ID to invoke functions on instead of units | |
dry_run |
string | Dry run mode: when true, skip updating configuration data even if it changed | |
protect |
boolean | Deprecated: use guards, as {"Override":"Upstream"} or {"Override":"External"}. Records the paths this operation writes as local overrides a merge must not overwrite: each Unit's Override guard -- Override=Upstream for a Unit with an upstream Unit, Override=External for one without -- with the clearance to write over one. A guard this request names under Override wins. | |
clearance |
string | The classes of guarded reason this operation is cleared for, as a JSON Clearance -- a list of {Key, Operator, Values} requirements, where Operator is Exists, In, NotIn, or DoesNotExist. A path whose guards this does not cover is not written, and the withheld change is reported as a Guarded conflict. An absent or empty clearance clears nothing, which only matters for a Unit that has guards. | |
guards |
string | The guards this operation records on the paths it writes, as a JSON object of guard key to value -- the reasons those paths hold what they hold, so a later operation must be cleared for them before overwriting. The guard analogue of protect: protect claims the paths, this says why. It only ever adds and overwrites the keys it names -- retiring a guard is the /guard API (cub unit set-guard --remove-guard). | |
inherited_guards |
string | The guards this operation records on the paths it writes as inherited guards, in the form guards takes: a clone of the Unit receives them, and a merge carries them, and any later change to them, to the Units downstream of it. Guards set through guards stay with the Unit they are on. A key may not be in both. The clearance has to cover these as it covers guards. | |
change_set_id |
string | Must match ChangeSetID of affected Units unless in dry run mode; not valid when invoked on Revisions | |
change_order |
string | ChangeOrder to promote, which must have UpdateType Invoke. What runs then comes from the ChangeOrder rather than from the request body, which may not carry functions, triggers or invocations of its own; that is what holds every Space in scope to the same change. Only the Units the ChangeOrder covers are reached, a Unit that has already taken it is passed over, and every Unit reached is marked with the ChangeOrder's start and end Tags -- both on the head, with no Revision made, where the invocation changed nothing. Not valid when invoked on Revisions. | |
subgroup |
string | User-defined category for the Mutation. Must be alphanumeric, at most 64 characters. The prefix 'ConfigHub' is reserved. | |
other_data_source |
string | Additional configuration data to pass as OtherData to the functions the request names, and to the invocations that name none of their own; triggers pass what they name. Either a revision of each Unit, named LastReleasedRevisionNum or HeadRevisionNum, optionally prefixed with 'Before:' (e.g., Before:HeadRevisionNum), which the functions read under that name, or another Unit, as Unit: |
|
where |
string | The specified string is an expression for the purpose of filtering the list of Units returned. The expression syntax was inspired by SQL. It supports conjunctions using AND of relational expressions of the form attribute operator attribute_or_literal. The attribute names are case-sensitive and PascalCase, as in the JSON encoding. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, NOT LIKE and !~~ for negated pattern matching. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. UUIDs and boolean attributes support equality and inequality only. UUID and time literals must be quoted as string literals. String literals are quoted with single quotes, such as 'string'. Time literals use the same form as when serialized as JSON, such as: CreatedAt > '2025-02-18T23:16:34'. Integer and boolean literals are also supported for attributes of those types. Arrays support the ? operator to to match any element of the array, as in FromLinkID ? '7c61626f-ddbe-41af-93f6-b69f4ab6d308'. Arrays can perform LEN() to check for length, as in LEN(FromLinkID) > 0. An attribute naming a list of other entities can be filtered on their attributes with a * segment, as in FromLink.*.Slug = 'upgrade-app', which holds when any element satisfies it. Without the * such a reference is an error, since it names no single value to compare. Map support the dot notation to specify a particular map key, as in Labels.tier = 'Backend'. Maps support IS NULL and IS NOT NULL with dot notation to check for key absence or presence, as in Labels.tier IS NULL (key doesn't exist) or Labels.tier IS NOT NULL (key exists). Comparison results can be tested with IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE. These are useful for nullable columns: MergeSourceID = '<uuid>' IS NOT FALSE matches rows where MergeSourceID equals the value OR is NULL. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as Slug IN ('slugone', 'slugtwo') or Labels.environment IN ('prod', 'staging'). Conjunctions are supported using the AND operator. An example conjunction is: CreatedAt >= '2025-01-07' AND Slug = 'test' AND Labels.mykey = 'myvalue'. Supported attributes for filtering on Unit: Annotations, ApplyGates, ApplyWarnings, ChangeSetID, Conflicts, CreatedAt, DataHash, DeleteGates, DestroyGates, DisplayName, FromLinkID, HeadRevisionID, HeadRevisionNum, HiddenReason, Labels, LastChangeDescription, LastReleasedRevisionNum, LinkFindings, MutationSources, NeededPaths, OrganizationID, PathAnnotations, Permissions, ProvidedPaths, Slug, SpaceID, TargetID, ToolchainType, UnitID, Unreleasable, UpdatedAt, UpstreamRevisionNum, UpstreamSpaceID, UpstreamUnitID, ValidationErrors, ValidationPassed, ValidationResults, ValidationSkipped, ValidationTriggerIDs, ValidationWarnings, ValueTriggerIDs, Values. Finding all units created by cloning can be done using the expression UpstreamRevisionNum > 0. Clones of a specific unit can be found by additionally filtering based on UpstreamUnitID. Units never released can be found using LastReleasedRevisionNum = 0. Units with unreleased changes can be found with HeadRevisionNum > LastReleasedRevisionNum AND ReleaseTargetID IS NOT NULL AND Unreleasable = false. The whole string must be query-encoded. |
|
filter |
string | UUID of a Filter entity to apply to the Unit list. The Filter must be in the same Organization as the user credentials. The Filter's From field must match the entity type being filtered (Unit). For Space-resident entities, if the Filter has a FromSpaceID, it must match the operation's SpaceID. The Filter's Where clause will be combined with any explicit 'where' parameter using AND logic. If both 'filter' and 'where' parameters are specified, they are combined with AND logic. | |
include_hidden |
string | Hidden Unit entities, those with a HiddenReason, are left out of the results, or of what a bulk operation acts on, unless this names their HiddenReason. It is a comma-separated list of HiddenReasons, or * for all of them but Archived. A where clause naming the entities, by their Slug or ID with = or IN, or naming HiddenReason at all, also returns hidden entities it selects. Archived entities, which a delete with archive=true archives, are selected only when this names Archived, as in Archived or *,Archived; a where clause naming them returns them from a List or Search, but not from a bulk operation. ConfigHub/YAML Units, which hold the configuration of entities, are hidden with the HiddenReason BackingUnit. |
|
include |
string | Comma-separated parts of the result to return in addition to the default: ConfigData for the configuration the invocation produced, carried whether or not the invocation changed it. Without it, the configuration is present only when the invocation changed it, and an unchanged result is reported by DataHash alone. Diff for what the invocation changed in each Unit, path by path with the values on both sides. Supported values: ConfigData, Diff. | |
resource_type |
string | Resource type: Resource type to match for the desired ToolchainType, for example apps/v1/Deployment | |
where_data |
string | Where data: The specified string is an expression for the purpose of evaluating whether the configuration data matches the filter. It supports conjunctions using AND of relational expressions of the form path operator literal. The path specifications are dot-separated, for both map fields and array indices, as in spec.template.spec.containers.0.image = 'ghcr.io/headlamp-k8s/headlamp:latest' AND spec.replicas > 1. Path expressions support * for wildcard array or map segments and ?key=value syntax for associative matches of array elements containing objects with a key attribute. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, ILIKE, ~~, !~~, ~, !~, ~*, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, !~~ for NOT LIKE. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. Boolean values support equality and inequality only. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as spec.template.spec.containers.0.image#reference IN (':latest', ':arm64-latest'). The syntax .\| splits the path: the left side selects, and the right side is a property of what was selected. On the right side of a .\|, and only there, != is true when the property is absent: spec.containers.*.\|image != 'nginx' selects the containers and asks that none of their images be nginx, which a container with no image satisfies. Everywhere else a path that is not present is not a match, != included. String literals are quoted with single quotes, such as 'string'. Integer and boolean literals are also supported for attributes of those types. The whole string must be query-encoded. |
|
where_data_engine |
string | Which engine answers where_data and resource_type: sql (the default) evaluates the expression against the stored resource projection in a single query, falling back to the function engine for the expressions it cannot translate; function invokes the where-filter function on each candidate Unit, reading every one's configuration; shadow runs both, answers with function, and logs any disagreement. Temporary: function is the escape hatch for one release, after which this parameter goes away. |
|
where_trigger |
string | Where expression to match Triggers. Matched triggers are invoked on each unit to filter by validation results. Use with triggers_passed to control whether passing or failing units are returned (default: failing). | |
trigger_filter |
string | Filter UUID (with From=Trigger). The filter's matching triggers are invoked on units to filter by validation results. Can be combined with where_trigger. | |
triggers_passed |
boolean | When true, return units that pass trigger validation; when false (default), return units that fail. Only applies when where_trigger or trigger_filter is specified. | |
view |
string | UUID of a View of Unit. Its Filter selects the Units as the filter parameter does, so the two may not both be specified. |
Request Body
Content-Type: application/json
Schema: FunctionInvocationsRequest
Responses
| Status | Description | Content-Type | Schema |
|---|---|---|---|
| 200 | OK | application/json |
Array of FunctionInvocationsResponse |
| 207 | Multi-Status: Mixed success and failure results | application/json |
Array of FunctionInvocationsResponse |
| 400 | Function request is invalid (Bad Request). | application/json |
StandardErrorResponse |
| 401 | Unauthorized access. | application/json |
StandardErrorResponse |
| 403 | Forbidden access. | application/json |
StandardErrorResponse |
| 404 | Function not found. | application/json |
StandardErrorResponse |
| 409 | Function data conflict. Data has changed since last read. | application/json |
StandardErrorResponse |
| 422 | Unable to process configuration data | application/json |
StandardErrorResponse |
| 500 | Something went wrong while processing Function. | application/json |
StandardErrorResponse |
| 503 | A Channel's client is unavailable; one or more function sources were not executed | application/json |
StandardErrorResponse |
| 504 | Timed out waiting for a Channel's client to return a function result | application/json |
StandardErrorResponse |
| default | Unexpected error. | application/json |
StandardErrorResponse |
Reduce what functions return across Units
POST /space/{space_id}/function/reduce
Runs the map, functions that read configuration and return an AttributeValueList, on each Unit selected, puts each value they return, a row, into groups by GroupBy, and runs the reducer, such as reduce-starlark, once per group on the group's rows. Nothing is written. The reducer runs on the executor of the Space, or with executor_space across the Organization; each Unit's map runs on the executor of its own Space.
Operation ID: ReduceFunctions
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
space_id |
string | ✓ | Unique identifier for a space_id |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
where |
string | The specified string is an expression for the purpose of filtering the list of Units returned. The expression syntax was inspired by SQL. It supports conjunctions using AND of relational expressions of the form attribute operator attribute_or_literal. The attribute names are case-sensitive and PascalCase, as in the JSON encoding. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, NOT LIKE and !~~ for negated pattern matching. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. UUIDs and boolean attributes support equality and inequality only. UUID and time literals must be quoted as string literals. String literals are quoted with single quotes, such as 'string'. Time literals use the same form as when serialized as JSON, such as: CreatedAt > '2025-02-18T23:16:34'. Integer and boolean literals are also supported for attributes of those types. Arrays support the ? operator to to match any element of the array, as in FromLinkID ? '7c61626f-ddbe-41af-93f6-b69f4ab6d308'. Arrays can perform LEN() to check for length, as in LEN(FromLinkID) > 0. An attribute naming a list of other entities can be filtered on their attributes with a * segment, as in FromLink.*.Slug = 'upgrade-app', which holds when any element satisfies it. Without the * such a reference is an error, since it names no single value to compare. Map support the dot notation to specify a particular map key, as in Labels.tier = 'Backend'. Maps support IS NULL and IS NOT NULL with dot notation to check for key absence or presence, as in Labels.tier IS NULL (key doesn't exist) or Labels.tier IS NOT NULL (key exists). Comparison results can be tested with IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE. These are useful for nullable columns: MergeSourceID = '<uuid>' IS NOT FALSE matches rows where MergeSourceID equals the value OR is NULL. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as Slug IN ('slugone', 'slugtwo') or Labels.environment IN ('prod', 'staging'). Conjunctions are supported using the AND operator. An example conjunction is: CreatedAt >= '2025-01-07' AND Slug = 'test' AND Labels.mykey = 'myvalue'. Supported attributes for filtering on Unit: Annotations, ApplyGates, ApplyWarnings, ChangeSetID, Conflicts, CreatedAt, DataHash, DeleteGates, DestroyGates, DisplayName, FromLinkID, HeadRevisionID, HeadRevisionNum, HiddenReason, Labels, LastChangeDescription, LastReleasedRevisionNum, LinkFindings, MutationSources, NeededPaths, OrganizationID, PathAnnotations, Permissions, ProvidedPaths, Slug, SpaceID, TargetID, ToolchainType, UnitID, Unreleasable, UpdatedAt, UpstreamRevisionNum, UpstreamSpaceID, UpstreamUnitID, ValidationErrors, ValidationPassed, ValidationResults, ValidationSkipped, ValidationTriggerIDs, ValidationWarnings, ValueTriggerIDs, Values. Finding all units created by cloning can be done using the expression UpstreamRevisionNum > 0. Clones of a specific unit can be found by additionally filtering based on UpstreamUnitID. Units never released can be found using LastReleasedRevisionNum = 0. Units with unreleased changes can be found with HeadRevisionNum > LastReleasedRevisionNum AND ReleaseTargetID IS NOT NULL AND Unreleasable = false. The whole string must be query-encoded. |
|
filter |
string | UUID of a Filter entity to apply to the Unit list. The Filter must be in the same Organization as the user credentials. The Filter's From field must match the entity type being filtered (Unit). For Space-resident entities, if the Filter has a FromSpaceID, it must match the operation's SpaceID. The Filter's Where clause will be combined with any explicit 'where' parameter using AND logic. If both 'filter' and 'where' parameters are specified, they are combined with AND logic. | |
include_hidden |
string | Hidden Unit entities, those with a HiddenReason, are left out of the results, or of what a bulk operation acts on, unless this names their HiddenReason. It is a comma-separated list of HiddenReasons, or * for all of them but Archived. A where clause naming the entities, by their Slug or ID with = or IN, or naming HiddenReason at all, also returns hidden entities it selects. Archived entities, which a delete with archive=true archives, are selected only when this names Archived, as in Archived or *,Archived; a where clause naming them returns them from a List or Search, but not from a bulk operation. ConfigHub/YAML Units, which hold the configuration of entities, are hidden with the HiddenReason BackingUnit. |
|
resource_type |
string | Resource type: Resource type to match for the desired ToolchainType, for example apps/v1/Deployment | |
where_data |
string | Where data: The specified string is an expression for the purpose of evaluating whether the configuration data matches the filter. It supports conjunctions using AND of relational expressions of the form path operator literal. The path specifications are dot-separated, for both map fields and array indices, as in spec.template.spec.containers.0.image = 'ghcr.io/headlamp-k8s/headlamp:latest' AND spec.replicas > 1. Path expressions support * for wildcard array or map segments and ?key=value syntax for associative matches of array elements containing objects with a key attribute. Strings support the following operators: <, >, <=, >=, =, !=, LIKE, ILIKE, ~~, !~~, ~, !~, ~*, !~*, IN, NOT IN. String pattern operators: LIKE and ~~ for pattern matching with % and _ wildcards, ILIKE for case-insensitive pattern matching, !~~ for NOT LIKE. String regex operators: ~ for regex matching, ~* for case-insensitive regex, !~ and !~* for regex not matching (case-sensitive and insensitive). Integers support the following operators: <, >, <=, >=, =, !=, IN, NOT IN. Boolean values support equality and inequality only. The IN and NOT IN operators accept a comma-separated list of values in parentheses, such as spec.template.spec.containers.0.image#reference IN (':latest', ':arm64-latest'). The syntax .\| splits the path: the left side selects, and the right side is a property of what was selected. On the right side of a .\|, and only there, != is true when the property is absent: spec.containers.*.\|image != 'nginx' selects the containers and asks that none of their images be nginx, which a container with no image satisfies. Everywhere else a path that is not present is not a match, != included. String literals are quoted with single quotes, such as 'string'. Integer and boolean literals are also supported for attributes of those types. The whole string must be query-encoded. |
|
where_data_engine |
string | Which engine answers where_data and resource_type: sql (the default) evaluates the expression against the stored resource projection in a single query, falling back to the function engine for the expressions it cannot translate; function invokes the where-filter function on each candidate Unit, reading every one's configuration; shadow runs both, answers with function, and logs any disagreement. Temporary: function is the escape hatch for one release, after which this parameter goes away. |
|
where_trigger |
string | Where expression to match Triggers. Matched triggers are invoked on each unit to filter by validation results. Use with triggers_passed to control whether passing or failing units are returned (default: failing). | |
trigger_filter |
string | Filter UUID (with From=Trigger). The filter's matching triggers are invoked on units to filter by validation results. Can be combined with where_trigger. | |
triggers_passed |
boolean | When true, return units that pass trigger validation; when false (default), return units that fail. Only applies when where_trigger or trigger_filter is specified. | |
view |
string | UUID of a View of Unit. Its Filter selects the Units as the filter parameter does, so the two may not both be specified. |
Request Body
Content-Type: application/json
Schema: FunctionReduceRequest
Responses
| Status | Description | Content-Type | Schema |
|---|---|---|---|
| 200 | OK | application/json |
FunctionReduceResponse |
| 400 | Function request is invalid (Bad Request). | application/json |
StandardErrorResponse |
| 401 | Unauthorized access. | application/json |
StandardErrorResponse |
| 403 | Forbidden access. | application/json |
StandardErrorResponse |
| 404 | Function not found. | application/json |
StandardErrorResponse |
| 409 | Function data conflict. Data has changed since last read. | application/json |
StandardErrorResponse |
| 500 | Something went wrong while processing Function. | application/json |
StandardErrorResponse |
| 503 | Something Function needs is not available now, such as a client holding a Channel a function runs on. Retry later. | application/json |
StandardErrorResponse |
| 504 | Something Function waited on did not answer in time, such as a function run on a Channel. | application/json |
StandardErrorResponse |
| default | Unexpected error. | application/json |
StandardErrorResponse |
Schemas
FunctionInvocationsRequest
FunctionInvocationsRequest represents a request to invoke a list of functions on the configuration data of the matching Units or Revision.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
ChangeDescription |
string | ChangeDescription is a description of the change being made, if any. | |
ChannelID |
string (uuid) | ||
FunctionInvocations |
FunctionInvocationList |
||
Invocations |
Array of UUID |
Invocations is a list of Invocation IDs to execute. The invocations must be within the same Organization. Invocations will be executed after the FunctionInvocations list. Functions are grouped by executor (built-in or Channel) and executed in phases: general mutating functions first, then final mutating functions (like ensure-context), then validating functions. Functions that don't match the unit's toolchain type are ignored. | |
NumFilters |
integer | NumFilters is the number of validating functions from the FunctionInvocations to treat as filters for the remaining functions in the list. In the case that the validation function does not pass, stop and don't execute the remaining functions, but don't report an error. | |
ParameterizedInvocations |
Array of ParameterizedInvocationRef |
||
StopOnError |
boolean | StopOnError indicates whether to stop executing functions from the FunctionInvocations list on the first error, or to execute all of the functions and return all of the errors. Note that this applies to each Unit or Revision individually rather than all of the entities on which the functions are being invoked. | |
ToolchainType |
string | ToolchainType specifies the type of toolchain for these function invocations. This determines which configuration formats the functions can process. It must match the ToolchainType of the Units. | |
Triggers |
Array of UUID |
Triggers is a list of Trigger IDs to execute. The triggers must be within the same Organization. Triggers will be executed after the FunctionInvocations list. Functions are grouped by executor (built-in or Channel) and executed in phases: general mutating functions first, then final mutating functions (like ensure-context), then validating functions. Functions that don't match the unit's toolchain type are ignored. | |
UpdateApplyGates |
boolean | Deprecated: use UpdateValidationResults, which this means the same thing as. Setting either has the same effect. | |
UpdateValidationResults |
boolean | UpdateValidationResults indicates that the results of Trigger execution should be used to update ValidationErrors and ValidationWarnings on the affected Units, and the ValidationResults that say why each gate failed. Requires Triggers to be specified. | |
WhereResource |
string | WhereResource restricts which resources functions operate on using ConfigHub metadata path expressions (ConfigHub.ResourceName, ConfigHub.ResourceNameWithoutScope, ConfigHub.ResourceType, ConfigHub.ResourceCategory). |
FunctionInvocationsResponse
Properties
| Property | Type | Required | Description |
|---|---|---|---|
ConfigData |
string | The resulting configuration data; present only when the invocation changed it | |
Conflicts |
MutationConflictList |
Mutation conflicts produced by writing the invocation's result, such as a path a guard withheld. Empty when nothing was withheld. | |
DataHash |
string | SHA256 of the resulting configuration data, whether or not ConfigData is present | |
Diff |
ConfigDiff |
What the invocation changed, or on a dry run would change, path by path with the values on both sides; returned when include names Diff. | |
Error |
ResponseError |
Error information if the function invocation failed | |
HasNewMutations |
boolean | Functions produced new mutations (of type other than None) | |
Mutations |
ResourceMutationList |
List of mutations in the same order as the resources in ConfigData | |
Mutators |
Array of integer | List of function invocation indices that resulted in mutations | |
OrganizationID |
string (uuid) | ID of the Unit's Organization | |
Outputs |
object | Map of output types to their corresponding output data as embedded JSON | |
RevisionID |
string (uuid) | ID of the Revision the configuration data is associated with | |
SpaceID |
string (uuid) | ID of the Unit's Space | |
SpaceSlug |
string | Slug of the Unit's Space | |
Success |
boolean | True if all functions executed successfully | |
TargetID |
string (uuid) | ID of the Unit's Target; optional | |
UnitID |
string (uuid) | ID of the Unit the configuration data is associated with | |
UnitSlug |
string | Slug of the Unit |
FunctionReduceRequest
Properties
| Property | Type | Required | Description |
|---|---|---|---|
FunctionInvocations |
FunctionInvocationList |
||
GroupBy |
string | CEL expression evaluated on each row, as row, returning the key of the row's group as a string, or a list of keys for a row that belongs to several groups, such as an Ingress row in the group of each of its hosts. row has the fields of the value returned (ResourceName, ResourceType, Path, Value, AttributeName, DataType, FunctionName) and Origin (UnitID, UnitSlug, UnitLabels, SpaceID, SpaceSlug, SpaceLabels, TargetID, TargetSlug, TargetSpaceSlug, RevisionNum), every one of which is present: the label maps are empty when there are none, and TargetID is null and the Target's slugs empty for a Unit with no Target. A Target's slug is unique only within its Space. For example row.Origin.TargetSpaceSlug + "/" + row.Origin.TargetSlug, or row.Origin.SpaceLabels[?"Environment"].orValue(""), which reads a label a Space may not have. A Unit with a row the expression fails on, such as one reading a missing label without ?, is reported in UnitErrors, and none of its rows is grouped. Empty puts every row in one group, whose key is empty. | |
Reduce |
FunctionInvocation |
The reducer, run once per group on the group's rows: a function whose InputType is AttributeValueList, such as reduce-starlark | |
ToolchainType |
string | The ToolchainType of the Units to run the map on, and whose reducer is run. Units of other ToolchainTypes are not selected. Defaults to Kubernetes/YAML. | |
WhereResource |
string | Restricts which resources the map's functions read, using ConfigHub metadata path expressions (ConfigHub.ResourceName, ConfigHub.ResourceNameWithoutScope, ConfigHub.ResourceType, ConfigHub.ResourceCategory) and resource paths. The map runs only on the Units selected that the Resource index says hold such a resource, without reading each Unit's configuration, and on any whose resources the index has not recorded. |
FunctionReduceResponse
Properties
| Property | Type | Required | Description |
|---|---|---|---|
Groups |
Array of FunctionReduceGroup |
✓ | The reducer's output for each group, in order of key |
NumRows |
integer | ✓ | The number of rows the map returned |
NumUnits |
integer | ✓ | The number of Units the map was run on |
Success |
boolean | ✓ | True when no Unit was left out and the reducer succeeded on every group |
UnitErrors |
Array of FunctionReduceUnitError |
The Units left out because the map or GroupBy failed on them, whose rows are in no group |
StandardErrorResponse
The body of an error response: the error as data (Error), and as one string (message) for clients written before Error.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
Error |
ResponseError |
The error: its message, category (Type), HTTP status, details, and structured items. | |
message |
string | The error as one string: its message, with any details, items, and individual errors appended. Kept for clients written before Error; new clients read Error. |