brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BROOKLYN-153) REST API Inconsistencies
Date Mon, 06 Jul 2015 15:36:04 GMT

    [ https://issues.apache.org/jira/browse/BROOKLYN-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14615183#comment-14615183
] 

ASF GitHub Bot commented on BROOKLYN-153:
-----------------------------------------

Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/729#discussion_r33947419
  
    --- Diff: usage/rest-api/src/main/java/brooklyn/rest/api/CatalogApi.java ---
    @@ -180,15 +180,15 @@ public CatalogEntitySummary getEntity(
             @PathParam("entityId") String entityId) throws Exception;
     
         @GET
    -    @Path("/entities/{entityId}/{version}")
    +    @Path("/entities/{symbolicName}/{version}")
         @ApiOperation(value = "Fetch a specific version of an entity's definition from the
catalog", responseClass = "CatalogEntitySummary", multiValueResponse = true)
         @ApiErrors(value = {
             @ApiError(code = 404, reason = "Entity not found")
         })
         public CatalogEntitySummary getEntity(
    -        @ApiParam(name = "entityId", value = "The ID of the entity or template to retrieve",
required = true)
    -        @PathParam("entityId") String entityId,
    -        
    +        @ApiParam(name = "symbolicName", value = "The symbolic name of the entity or
template to retrieve", required = true)
    +        @PathParam("symbolicName") String symbolicName,
    +
    --- End diff --
    
    Surplus line


> REST API Inconsistencies
> ------------------------
>
>                 Key: BROOKLYN-153
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-153
>             Project: Brooklyn
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Thomas Bouron
>
> There are inconsistencies with the REST API for the {{/catalog/*}} endpoints. For example,
If I want to get an application with the a specific {{type}} or {{id}}, I can use either:
> {code}
> GET /v1/catalog/entities/{type} (returns the latest version)
> GET /v1/catalog/entities/{id} (returns the specific version as id = {type}:{version})
> GET /v1/catalog/application/{id}/{version}
> GET /v1/catalog/entities/{id}:{version}
> GET /v1/catalog/entities/{id}/{version}
> {code}
> This is really confusing, especially the last 3 as the {{id}} already contains the {{version}}.
These endpoints should rather take the {{type}} instead of {{id}}.



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

Mime
View raw message