MCPcopy Create free account
hub / github.com/dagger/dagger / Service

Class Service

sdk/python/src/dagger/client/gen.py:14418–14635  ·  view source on GitHub ↗

A content-addressed service providing TCP connectivity.

Source from the content-addressed store, hash-verified

14416
14417@typecheck
14418class Service(Type):
14419 """A content-addressed service providing TCP connectivity."""
14420
14421 async def endpoint(
14422 self,
14423 *,
14424 port: int | None = None,
14425 scheme: str | None = "",
14426 ) -> str:
14427 """Retrieves an endpoint that clients can use to reach this container.
14428
14429 If no port is specified, the first exposed port is used. If none exist
14430 an error is returned.
14431
14432 If a scheme is specified, a URL is returned. Otherwise, a host:port
14433 pair is returned.
14434
14435 Parameters
14436 ----------
14437 port:
14438 The exposed port number for the endpoint
14439 scheme:
14440 Return a URL with the given scheme, eg. http for http://
14441
14442 Returns
14443 -------
14444 str
14445 The `String` scalar type represents textual data, represented as
14446 UTF-8 character sequences. The String type is most often used by
14447 GraphQL to represent free-form human-readable text.
14448
14449 Raises
14450 ------
14451 ExecuteTimeoutError
14452 If the time to execute the query exceeds the configured timeout.
14453 QueryError
14454 If the API returns an error.
14455 """
14456 _args = [
14457 Arg("port", port, None),
14458 Arg("scheme", scheme, ""),
14459 ]
14460 _ctx = self._select("endpoint", _args)
14461 return await _ctx.execute(str)
14462
14463 async def hostname(self) -> str:
14464 """Retrieves a hostname which can be used by clients to reach this
14465 container.
14466
14467 Returns
14468 -------
14469 str
14470 The `String` scalar type represents textual data, represented as
14471 UTF-8 character sequences. The String type is most often used by
14472 GraphQL to represent free-form human-readable text.
14473
14474 Raises
14475 ------

Callers 8

serviceMethod · 0.70
as_serviceMethod · 0.70
as_serviceMethod · 0.70
serviceMethod · 0.70
tunnelMethod · 0.70
load_service_from_idMethod · 0.70
terminalMethod · 0.70
with_hostnameMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected