RESTAction
API Group: templates.krateo.io
Kind: RESTAction
Version: v1
Scope: Namespaced
Overviewβ
The RESTAction is a Krateo PlatformOps resource that enables users to declaratively define one or more REST API calls within Kubernetes.
It allows you to chain HTTP requests, handle dependencies between them, extract data, and use filters to process results β all through a Kubernetes-native manifest.
This approach is particularly useful for integrating external systems or Kubernetes APIs into workflows managed by Krateo PlatformOps.
RESTActiondefines one or more declarative HTTP (REST) calls that can optionally depend on other calls.
It allows you to orchestrate a chain of API requests across multiple endpoints using Kubernetes resources.
A RESTAction resource declaratively defines one or more HTTP calls (spec.api) that can depend on each other.
Each call can produce a JSON response that becomes part of a shared global context, enabling subsequent calls to reference previous results using JQ expressions, iterators, and filters.
To fully leverage these advanced capabilities β such as resolving JQ expressions, using custom JQ functions or modules, and managing interdependent API calls β the RESTAction must be executed through the snowplow service endpoint (/call).
Only this endpoint implements the orchestration logic that:
- Executes all HTTP requests defined under
spec.api, respecting their declared dependencies (dependsOn). - Stores all API responses in a global JSON context.
- Evaluates and resolves any JQ expressions or iterators defined within the resource.
- Returns the computed output in the resourceβs
statusfield.
When a RESTAction is retrieved directly via Kubernetes (e.g. kubectl get restaction <name>), the resource is shown as-is, without JQ resolution or execution of any API calls.
specβ
The spec field defines the configuration for the REST action workflow.
| Field | Type | Description | Required |
|---|---|---|---|
api | array | List of API requests to execute. Each item defines one HTTP call. | β |
filter | string | Optional filter to apply to the overall output or results. | β |
spec.api[]β
Defines a single HTTP request and its dependencies.
| Field | Type | Description | Required |
|---|---|---|---|
name | string | A unique identifier for this API call. | β |
verb | string | The HTTP method (e.g., GET, POST, PUT, DELETE). Defaults to GET. | β |
path | string | The URI path of the request. | β |
payload | string | The request body (for methods like POST, PUT, etc.). |