Source
yaml
id: get-all-namespaces
namespace: blueprints
variables:
kestra_local_uri: http://localhost:8080/kestra
labels:
type: ADMIN_PROCESS
tasks:
- id: get_nr_of_namespaces
type: io.kestra.plugin.core.http.Request
uri: "{{ vars.kestra_local_uri }}/api/v1/namespaces/search?size=1"
- id: get_all_namespaces
type: io.kestra.plugin.core.http.Request
uri: "{{ vars.kestra_local_uri }}/api/v1/namespaces/search?size={{
json(outputs.get_nr_of_namespaces['body']).total }}"
outputs:
- id: namespaces
type: ARRAY
value: |
[{% for elem in json(outputs.get_all_namespaces["body"]).results %}"{{ elem.id }}"{% if not loop.last %},{% endif %}{% endfor %}]
- id: total
type: INT
value: "{{ json(outputs.get_nr_of_namespaces['body']).total }}"
pluginDefaults:
- type: io.kestra.plugin.core.http.Request
values:
method: GET
headers:
Authorization: "{{ secret('KESTRA_API_TOKEN') }}"
About this blueprint
API Kestra
This flow queries a Kestra instance to retrieve all available namespaces using Kestra's API.
- The first HTTP request fetches the total number of namespaces.
- The second HTTP request retrieves all namespaces in a single request.
- The output includes a list of all namespace IDs and the total count.
More Related Blueprints