Cloud API Overview > @adpt/cloud > NetworkServiceInstance > hostname
NetworkServiceInstance.hostname() method
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Returns the hostname for the service from the given scope
Signature:
hostname(scope?: NetworkScope): string | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
scope | NetworkScope | the scope of the desired hostname ("default" cluster/internal, "external" - world accessible) |
Returns:
string | undefined
- the requested hostname, or undefined if it is not yet available
Remarks
This function should return the external, world accessible name if there is no cluster/internal only name. The function should throw an error if an external name is requested, but no name/address is available (e.g., the service is internally acessible only.)