assay.kargo
Kargo continuous promotion. Stages, freight, promotions, warehouses, pipeline status. Client:
kargo.client(url, token).
Stages
c.stages:list(namespace)-> [stage] -- List stages in namespacec.stages:get(namespace, name)-> stage -- Get stage by namec.stages:status(namespace, name)->{phase, current_freight_id, health, conditions}-- Get stage statusc.stages:is_healthy(namespace, name)-> bool -- Check if stage is healthy (phase "Steady" or condition "Healthy")c.stages:wait_healthy(namespace, name, timeout_secs?)-> true -- Wait for stage health. Default 60s.c.stages:pipeline_status(namespace)->[{name, phase, freight, healthy}]-- Get pipeline overview of all stages
Freight
c.freight:list(namespace, opts?)-> [freight] -- List freight.opts:{stage, warehouse}for label filtersc.freight:get(namespace, name)-> freight -- Get freight by namec.freight:status(namespace, name)-> status -- Get freight status
Promotions
c.promotions:list(namespace, opts?)-> [promotion] -- List promotions.opts:{stage}filterc.promotions:get(namespace, name)-> promotion -- Get promotion by namec.promotions:status(namespace, name)->{phase, message, freight_id}-- Get promotion statusc.promotions:create(namespace, stage, freight)-> promotion -- Create a promotion to promote freight to stage
Warehouses
c.warehouses:list(namespace)-> [warehouse] -- List warehousesc.warehouses:get(namespace, name)-> warehouse -- Get warehouse by name
Projects
c.projects:list()-> [project] -- List Kargo projectsc.projects:get(name)-> project -- Get project by name
Example:
local kargo = require("assay.kargo")
local c = kargo.client("https://kargo.example.com", env.get("KARGO_TOKEN"))
c.promotions:create("my-project", "staging", "freight-abc123")
c.stages:wait_healthy("my-project", "staging", 300)