Github user aledsage commented on the issue:

    https://github.com/apache/brooklyn-library/pull/128
  
    Thanks @tbouron. I think the icon url needs to be at the top-level to be 
known about by the catalog, and that should be sufficient for it to be known by 
the entity instances.
    
    I added two catalog items:
    ```
    brooklyn.catalog:
        version: "1.0.1"
        itemType: entity
        items:
        - id: pr-128-top-level
          iconUrl: classpath:///ansible-logo.png
          name: PR 128 Icon at top
          item:
            type: org.apache.brooklyn.entity.stock.BasicApplication
    ```
    And:
    ```
    brooklyn.catalog:
        version: "1.0.1"
        itemType: entity
        items:
        - id: pr-128-inside-item
          name: PR 128 Icon inside item
          item:
            type: org.apache.brooklyn.entity.stock.BasicApplication
            iconUrl: classpath:///ansible-logo.png
    ```
    I queried the catalog for these (e.g. with `curl -v -u xxxx:xxxx 
http://localhost:8081/v1/catalog/entities/pr-128-top-level/1.0.1`).
    
    The response for the top-level .bom included: 
`"iconUrl":"/v1/catalog/icon/pr-128-top-level/1.0.1"`, but the inside-item .bom 
didn't (in the "planYaml" section it did show the iconUrl though).
    
    ---
    I deployed two apps:
    ```
    services:
    - type: pr-128-top-level
    ```
    and:
    ```
    services:
    - type: pr-128-inside-item
    ```
    I then queried the rest api about each entity (e.g. with `curl -v -u 
xxxx:xxxx 
http://localhost:8081/v1/applications/zlhibxdxxz/entities/zlhibxdxxz`).
    
    The app response for "top-level" included 
`"iconUrl":"/v1/applications/zlhibxdxxz/entities/zlhibxdxxz/icon"`, and the 
"inside-item" app had 
`"iconUrl":"/v1/applications/jyda9wjmx0/entities/jyda9wjmx0/icon"`. I 
downloaded both of those icons from the server. I confirmed that both were the 
icon defined in the original .bom files.
    
    ---
    @tbouron would you expect the icon to be defined/referenced anywhere else 
for the running instance? Anything else I should check?


---

Reply via email to