You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "Martin Harris (JIRA)" <ji...@apache.org> on 2015/11/18 11:36:10 UTC

[jira] [Updated] (BROOKLYN-195) Invalid catalog item can be posted to catalog

     [ https://issues.apache.org/jira/browse/BROOKLYN-195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Harris updated BROOKLYN-195:
-----------------------------------
    Description: 
The following YAML can be posted to the catalog

{noformat}
brooklyn.catalog:
  id: invalid-catalog-item
  version: 1.0
  displayName: Invalid Catalog Item
  itemType: template

services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
- type: org.apache.brooklyn.entity.stock.BasicApplication
{noformat}

E.g. by using the following curl command 

curl http://localhost:8081/v1/catalog --data-binary @`pwd`/services.yaml

This will return a 201 and the catalog item will be created. However, when trying to deploy the catalog item, the following error is returned:

"Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this plan: Transformer for catalog gave an error creating this plan: Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this plan: java.lang.UnsupportedOperationException: Single service expected, but got [EntitySpec{type=interface org.apache.brooklyn.entity.stock.BasicApplication}, EntitySpec{type=interface org.apache.brooklyn.entity.stock.BasicApplication}]"

As the use of multiple services is not supported, Brooklyn should not allow the catalog item to be created

Marked as low priority as the workaround is fairly simple (i.e. use the following YAML):

{noformat}
brooklyn.catalog:
  id: invalid-catalog-item
  version: 1.0
  displayName: Invalid Catalog Item
  itemType: template

services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
  brooklyn.children:
  - type: org.apache.brooklyn.entity.stock.BasicApplication
  - type: org.apache.brooklyn.entity.stock.BasicApplication

{noformat}


  was:
The following YAML can be posted to the catalog

`
brooklyn.catalog:
  id: invalid-catalog-item
  version: 1.0
  displayName: Invalid Catalog Item
  itemType: template

services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
- type: org.apache.brooklyn.entity.stock.BasicApplication
`

E.g. by using the following curl command 

curl http://localhost:8081/v1/catalog --data-binary @`pwd`/services.yaml

This will return a 201 and the catalog item will be created. However, when trying to deploy the catalog item, the following error is returned:

"Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this plan: Transformer for catalog gave an error creating this plan: Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this plan: java.lang.UnsupportedOperationException: Single service expected, but got [EntitySpec{type=interface org.apache.brooklyn.entity.stock.BasicApplication}, EntitySpec{type=interface org.apache.brooklyn.entity.stock.BasicApplication}]"

As the use of multiple services is not supported, Brooklyn should not allow the catalog item to be created

Marked as low priority as the workaround is fairly simple (i.e. use the following YAML):

```
brooklyn.catalog:
  id: invalid-catalog-item
  version: 1.0
  displayName: Invalid Catalog Item
  itemType: template

services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
  brooklyn.children:
  - type: org.apache.brooklyn.entity.stock.BasicApplication
  - type: org.apache.brooklyn.entity.stock.BasicApplication

```



> Invalid catalog item can be posted to catalog
> ---------------------------------------------
>
>                 Key: BROOKLYN-195
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-195
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Martin Harris
>            Priority: Minor
>
> The following YAML can be posted to the catalog
> {noformat}
> brooklyn.catalog:
>   id: invalid-catalog-item
>   version: 1.0
>   displayName: Invalid Catalog Item
>   itemType: template
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
> - type: org.apache.brooklyn.entity.stock.BasicApplication
> {noformat}
> E.g. by using the following curl command 
> curl http://localhost:8081/v1/catalog --data-binary @`pwd`/services.yaml
> This will return a 201 and the catalog item will be created. However, when trying to deploy the catalog item, the following error is returned:
> "Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this plan: Transformer for catalog gave an error creating this plan: Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this plan: java.lang.UnsupportedOperationException: Single service expected, but got [EntitySpec{type=interface org.apache.brooklyn.entity.stock.BasicApplication}, EntitySpec{type=interface org.apache.brooklyn.entity.stock.BasicApplication}]"
> As the use of multiple services is not supported, Brooklyn should not allow the catalog item to be created
> Marked as low priority as the workaround is fairly simple (i.e. use the following YAML):
> {noformat}
> brooklyn.catalog:
>   id: invalid-catalog-item
>   version: 1.0
>   displayName: Invalid Catalog Item
>   itemType: template
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
>   brooklyn.children:
>   - type: org.apache.brooklyn.entity.stock.BasicApplication
>   - type: org.apache.brooklyn.entity.stock.BasicApplication
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)