Example: Marketplace/ Applications
9 min
end to end walkthrough pull a docker image from the litmus marketplace, run it as a container, inspect logs, and clean up setup from litmussdk import marketplace 1\ browse the marketplace overview = marketplace marketplace overview() images = marketplace list all images() \# find an image by name target = next(i for i in images if "node red" in i get("name", "") lower()) image id = target\["id"] 2\ pull an image marketplace pull image(image id) \# track the pull job jobs = marketplace list image pulls() print(f"active pulls {len(jobs)}") 3\ run a container running = marketplace run container({ "imageid" image id, "name" "my node red", "ports" \[{"hostport" 1880, "containerport" 1880}], \# other docker options }) container id = running\["id"] 4\ inspect all containers = marketplace list all containers() me = next(c for c in all containers if c\["id"] == container id) print(f"state {me\['state']}") \# detail detail = marketplace container inspect(container id) \# live logs logs = marketplace container log(container id, lines=200) \# top processes top = marketplace container top(container id) 5\ lifecycle \# pause / unpause marketplace pause containers(\[container id]) marketplace unpause containers(\[container id]) \# stop / start marketplace stop containers(\[container id]) marketplace start containers(\[container id]) 6\ cleanup \# remove container marketplace remove containers list by ids(\[container id]) \# remove image marketplace remove images(\[image id]) \# reclaim space marketplace prune containers() image upload (custom registries) if you have a custom docker image not in the public marketplace \# from local file marketplace upload image(file path="/path/to/image tar") \# from an ftp accessible source marketplace upload from ftp(image file path="ftp\ // ") see also marketplace catalogs and applications docid\ gqogt szm8rz9udphl2nl if you're managing the marketplace itself across multiple edges via edge manager