Interface ResourceWithEndpoints<T extends Resource<T> & ResourceWithEndpoints<T>>

All Superinterfaces:
ResourceTrait<T>, SelfAware<T>
All Known Implementing Classes:
AzureEventHubsResource, AzureOpenAIResource, AzureStorageResource, Container, DockerFile, EurekaServiceDiscovery, Executable, MicronautProject, MicroserviceProject, QuarkusProject, SpringProject

public interface ResourceWithEndpoints<T extends Resource<T> & ResourceWithEndpoints<T>> extends ResourceTrait<T>
  • Method Details

    • withHttpEndpoint

      default T withHttpEndpoint(int targetPort)
      Exposes an HTTP endpoint on a resource. This endpoint reference can be retrieved using GetEndpoint(IResourceBuilder, String). The endpoint name will be "http" if not specified.
      Parameters:
      targetPort - This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.
      Returns:
    • withHttpsEndpoint

      default T withHttpsEndpoint(int targetPort)
      Exposes an HTTPS endpoint on a resource. This endpoint reference can be retrieved using GetEndpoint(IResourceBuilder, String). The endpoint name will be "https" if not specified.
      Parameters:
      targetPort -
      Returns:
    • withHttpEndpoint

      default T withHttpEndpoint(Integer port, int targetPort, String endpointName, String env, boolean isProxied)
      Adds an HTTP endpoint to the resource with specified configurations.

      This method configures an HTTP endpoint with the provided port, target port, name, environment variable, and proxy settings. It's a convenience method for quickly adding a common HTTP endpoint to a resource.

      Parameters:
      port - An optional host port.
      targetPort - The port the resource is listening on. If the endpoint is used for the container, it is the container port.
      endpointName - The name of the endpoint. An optional parameter, defaults to "http" if not specified.
      env - The name of the environment variable to inject. An optional parameter.
      isProxied - Specifies if the endpoint will be proxied by DCP. Defaults to true.
      Returns:
      The resource with the added HTTP endpoint.
    • withHttpsEndpoint

      default T withHttpsEndpoint(Integer port, int targetPort, String endpointName, String env, boolean isProxied)
      Exposes an HTTPS endpoint on a resource. This endpoint reference can be retrieved using the getEndpoint method. The endpoint name will be "https" if not specified.
      Parameters:
      port - An optional host port.
      targetPort - This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.
      endpointName - An optional name of the endpoint. Defaults to "https" if not specified.
      env - An optional name of the environment variable to inject.
      isProxied - Specifies if the endpoint will be proxied by DCP. Defaults to true.
      Returns:
      The resource with the added HTTPS endpoint.
    • getEndpoints

      default List<EndpointReference<?>> getEndpoints()
    • getEndpoint

      default EndpointReference<?> getEndpoint(String name)
      Gets an EndpointReference by name from the resource.
      Parameters:
      name - The name of the endpoint.
      Returns:
    • withExternalHttpEndpoints

      default T withExternalHttpEndpoints()
      Marks existing http or https endpoints on a resource as external.
      Returns:
      The resource with updated endpoints.
    • self

      default T self()
      Description copied from interface: SelfAware
      Returns a reference to the object that implements this interface.
      Specified by:
      self in interface SelfAware<T extends Resource<T> & ResourceWithEndpoints<T>>
      Returns:
      A reference to the object that implements this interface.