This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/docs/learn/1213-api.md
Gerhard Lazu f2f2f7c38a
Add link to Europa docs
So that it's easy for anyone to jump to the new docs that we are
currently working on, and intend to replace the existing docs with.

While I would have preferred to link to the local dev page, it's still
stuck in the PR state, currently blocked on another PR:
https://github.com/dagger/dagger/pull/1586

Also added a link to the pre-Europa docs, so that it's easy to go back.

While at it, drop "Sidebar" from the name of sidebars, and replace
tutorial with a more descriptive name.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2022-03-03 15:12:43 +00:00

53 lines
2.2 KiB
Markdown

---
slug: /1213/api
displayed_sidebar: europa
---
# Dagger CUE API (0.2+)
As of Dagger 0.2 (codename Europa), the Dagger CUE API can be imported at `dagger.io/dagger`.
The Dagger CUE API is the set of CUE packages released alongside the Dagger engine, to allow developers to access its features.
### Plan definition
`#Plan` defines the structure of a Dagger plan - a complete configuration executable by `dagger up`.
### Core types
Dagger extends the CUE type system with the following core types:
* `#FS`: a reference to a filesystem tree
* `#Secret`: a secure reference to an external secret
* `#Service` a reference to a network service endpoints
### Core actions
Dagger works by executing actions in a certain order and passing data between actions in a certain layout.
Developers can combine actions into higher-level actions, which in turn can be combined into even higher-level actions,
and so on at arbitrary levels of depth. At the bottom of this abstraction stack are *core actions*: these
are implemented by Dagger itself, and are always available.
The following core actions are available:
| Core action | File | Description |
| -- | -- | -- |
| `#Exec` | exec.cue | Execute a command in a docker-compatible container |
| `#HTTPFetch` | http.cue | Download an archive from an HTTP server |
| `#Push` | image.cue | Upload an image to a docker registry |
| `#Pull` | image.cue | Download an image from a docker registry |
| `#Dockerfile` | image.cue | Execute a Dockerfile |
| `#Set` | image.cue | Modify a docker image |
| `#GitPush` | git.cue | Upload a repository to a remote git server |
| `#GitPull` | git.cue | Download a repository from a remote git server |
| `#DecodeSecret` | secrets.cue | Decode a secret without leaking its contents |
| `#NewSecret` | secrets.cue | Dynamically create a new secret |
| `#Source` | fs.cue | Access the source for the current CUE package |
| `#Mkdir` | fs.cue | Create a directory in a filesystem tree |
| `#ReadFile` | fs.cue | Read a file from a tree |
| `#WriteFile` | fs.cue | Write a file to a tree |
| `#Scratch` | fs.cue | Create an empty tree |
| `#Copy` | fs.cue | Copy files between two trees |
| `#Subdir` | fs.cue | Read a subdirectory from a filesystem tree |