Client
class Client extends AbstractClient implements IdAble, Node
The root of the DAG.
Properties
| protected AbstractClient | $client | from AbstractClient | |
| protected Client | $graphQlClient | from AbstractClient |
Methods
No description
No description
Load an object by its ID using node(id:) with an inline fragment.
initialize an address to load directories, containers, secrets or other object types.
Constructs a cache volume for a given cache key.
Creates a scratch container, with no image or metadata.
The FunctionCall context that the SDK caller is currently executing in.
The module currently being served in the session, if any.
The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor).
The TypeDef representations of the objects currently being served in the session.
Detect and return the current workspace.
The default platform of the engine.
Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
Creates a file with the specified contents.
Create a code generation result, given a directory containing the generated code.
Queries a Git repository.
Returns a file containing an http remote url content.
Create a new module source instance from a source ref string
Sets a secret given a user defined name to its plaintext and returns the secret.
Constructs an SSHFS volume.
Get the current Dagger Engine version.
Details
in
AbstractClient at line 22
__construct(Client $clientOrConnection, QueryBuilderChain $queryBuilderChain = new QueryBuilderChain())
No description
in
AbstractClient at line 35
Results
runQuery(Query $query)
No description
in
AbstractClient at line 40
null|array|string|int|float|bool
queryLeaf(Query $query, string $leafKey)
No description
in
AbstractClient at line 67
object
loadObjectFromId(string $className, Id $id, string|null $graphQLTypeName = null)
Load an object by its ID using node(id:) with an inline fragment.
at line 19
Address
address(string $value)
initialize an address to load directories, containers, secrets or other object types.
at line 29
File
blob(string $name, Bytes $contents, int|null $permissions = 420)
Creates a file from arbitrary binary contents.
at line 43
CacheVolume
cacheVolume(string $key, Directory|null $source = null, CacheSharingMode|null $sharing = null, string|null $owner = '')
Constructs a cache volume for a given cache key.
at line 66
Changeset
changeset()
Creates an empty changeset
at line 75
Cloud
cloud()
Dagger Cloud configuration and state
at line 81
GeneratedCode
codegen(ModuleSource $modSource, File $introspectionJson)
No description
at line 89
Container
codegenBase(ModuleSource $modSource, File $introspectionJson)
No description
at line 102
Container
container(Platform|null $platform = null)
Creates a scratch container, with no image or metadata.
To pull an image, follow up with the "from" function.
at line 116
FunctionCall
currentFunctionCall()
The FunctionCall context that the SDK caller is currently executing in.
If the caller is not currently executing in a function, this will return an error.
at line 125
CurrentModule
currentModule()
The module currently being served in the session, if any.
at line 134
Node
currentNode()
The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor).
at line 143
array
currentTypeDefs(bool|null $returnAllTypes = false, bool|null $hideCore = null)
The TypeDef representations of the objects currently being served in the session.
at line 158
Workspace
currentWorkspace()
Detect and return the current workspace.
at line 167
Platform
defaultPlatform()
The default platform of the engine.
at line 176
Directory
directory()
Creates an empty directory.
at line 185
Engine
engine()
The Dagger engine container configuration and state
at line 194
Volume
engineVolume(string $name, string|null $subdir = null)
Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
at line 207
EnvFile
envFile(bool|null $expand = null)
Initialize an environment file
at line 219
Error
error(string $message)
Create a new error.
at line 229
File
file(string $name, string $contents, int|null $permissions = 420)
Creates a file with the specified contents.
at line 254
GeneratedCode
generatedCode(Directory $code)
Create a code generation result, given a directory containing the generated code.
at line 264
GitRepository
git(string $url, bool|null $keepGitDir = true, string|null $sshKnownHosts = '', Socket|null $sshAuthSocket = null, string|null $httpAuthUsername = '', Secret|null $httpAuthToken = null, Secret|null $httpAuthHeader = null, Service|null $experimentalServiceHost = null)
Queries a Git repository.
at line 303
Host
host()
Queries the host environment.
at line 312
File
http(string $url, string|null $name = null, int|null $permissions = null, string|null $checksum = null, Secret|null $authHeader = null, Service|null $experimentalServiceHost = null)
Returns a file containing an http remote url content.
at line 343
Id
id()
A unique identifier for this Query.
at line 352
JsonValue
json()
Initialize a JSON value
at line 361
LLM
llm(string|null $model = null, string|null $provider = null)
Initialize a new LLM conversation.
at line 376
Module
module()
Create a new module.
at line 382
Container
moduleRuntime(ModuleSource $modSource, File $introspectionJson)
No description
at line 393
ModuleSource
moduleSource(string $refString, string|null $refPin = '', bool|null $disableFindUp = false, bool|null $allowNotExists = false, ModuleSourceKind|null $requireKind = null)
Create a new module source instance from a source ref string
at line 420
Node|null
node(Id $id)
Load any object by its ID.
at line 445
Secret
secret(string $uri, string|null $cacheKey = null)
Creates a new secret.
at line 460
Secret
setSecret(string $name, string $plaintext)
Sets a secret given a user defined name to its plaintext and returns the secret.
The plaintext value is limited to a size of 128000 bytes.
at line 468
Directory
sourceDir()
No description
at line 477
SourceMap
sourceMap(string $filename, int $line, int $column)
Creates source map metadata.
at line 489
Volume
sshfsVolume(string $endpoint, Secret $privateKey, Secret|null $knownHosts = null, string|null $cacheKey = null, bool|null $insecureSkipHostKeyCheck = false, Service|null $experimentalServiceHost = null)
Constructs an SSHFS volume.
at line 518
TypeDef
typeDef()
Create a new TypeDef.
at line 527
string
version()
Get the current Dagger Engine version.
at line 536
Client
with(Directory|null $sdkSourceDir = null)
Configure the php-sdk constructor arguments.