Interface IRestClientContext


  • public interface IRestClientContext

    REST clients of this application. Use the REST clients editor to configure a new REST client and then access it with client(String) or client(UUID)

    Example:

    String response = ivy.rest.client("myRestClient").request().get().readEntity(String.class) as String;
     

    API:
    This is a public API.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      javax.ws.rs.client.WebTarget client​(String name)
      Gets the REST client with the given name.
      javax.ws.rs.client.WebTarget client​(UUID id)
      Gets the REST client with the given unique identifier.
      List<UUID> getIds()
      Gets a list with the unique identifiers of all available rest clients
      List<String> getNames()
      Gets a list with the names of all available rest clients
    • Method Detail

      • client

        javax.ws.rs.client.WebTarget client​(String name)
                                     throws NoSuchElementException

        Gets the REST client with the given name.

        Example:

        String response = ivy.rest.client("myRestClient").request().get().readEntity(String.class) as String;
         

        Parameters:
        name -
        Returns:
        client
        Throws:
        NoSuchElementException - if REST client with the given name or id does not exist
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • client

        javax.ws.rs.client.WebTarget client​(UUID id)
                                     throws NoSuchElementException

        Gets the REST client with the given unique identifier.

        Examples:

         import java.util.UUID;
         UUID uuid = UUID.fromString("e00c9735-7733-4da8-85c8-6413c6fb2cd2");
         String response = ivy.rest.client(uuid).request().get().readEntity(String.class) as String;
         

        Parameters:
        id - unique identifier
        Returns:
        client
        Throws:
        NoSuchElementException - if REST client with the given id does not exist
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getNames

        List<String> getNames()
        Gets a list with the names of all available rest clients
        Returns:
        list of rest client names
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      • getIds

        List<UUID> getIds()
        Gets a list with the unique identifiers of all available rest clients
        Returns:
        list of rest client identifiers
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.