brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <>
Subject [GitHub] brooklyn-server pull request #885: Icons for adjuncts, and descriptions
Date Wed, 08 Nov 2017 11:56:04 GMT
Github user ahgittin commented on a diff in the pull request:
    --- Diff: rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/ ---
    @@ -253,4 +253,12 @@ public Response setConfig(
                 @ApiParam(value = "Whether to include subtasks recursively across different
entities (default false)", required = false)
                 @QueryParam("recurse") @DefaultValue("false") Boolean recurse);
    +    @GET
    +    @ApiOperation(value = "Returns an icon for the adjunct, if defined")
    +    @Path("/{adjunct}/icon")
    +    public Response getIcon(
    +        @ApiParam(value = "Application ID or name", required = true) @PathParam("application")
String applicationId,
    +        @ApiParam(value = "Entity ID or name", required = true) @PathParam("entity")
String entityId,
    +        @ApiParam(value = "Adjunct ID or name", required = true) @PathParam("adjunct")
String adjunctToken);
    --- End diff --
    as we're dealing with adjunct instances here best to copy the entity instance api as i've
done, no?
    whether an entity returns `/v1/applications/XXX/entities/XXX/icon` or `/v1/catalog/icon/symbolicName/version`
as the URL is not guaranteed.  in fact the latter would sometimes be wrong if an entity has
a custom icon set in a tag, and the code suggests entity instances returns the former, at
least for `EntityDetail`, in `ApplicationResource.fromEntity`:
        iconUrl = EntityTransformer.entityUri(entity, ui.getBaseUriBuilder())+"/icon";
    the `EntitySummary` class doesn't include `iconUrl`.  you probably mean `CatalogEntitySummary`
which is for types not instances in which case the non-instance link would be the correct
    but for this purpose -- adjunct _instances_ - i think what i've done, mirroring entity
instances, is correct.


View raw message