Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/885#discussion_r149647964
--- Diff:
rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/AdjunctApi.java ---
@@ -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 one.
but for this purpose -- adjunct _instances_ - i think what i've done,
mirroring entity instances, is correct.
---