ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jaimin Jetly (JIRA)" <>
Subject [jira] [Updated] (AMBARI-20436) Create a prototype of ambari-server swagger integration
Date Mon, 20 Mar 2017 21:31:41 GMT


Jaimin Jetly updated AMBARI-20436:
    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

Received +1 on reviewboard
Patch committed to ambari-rest-api-explorer branch

> Create a prototype of ambari-server swagger integration
> -------------------------------------------------------
>                 Key: AMBARI-20436
>                 URL:
>             Project: Ambari
>          Issue Type: Task
>          Components: ambari-server, ambari-web
>    Affects Versions: 3.0.0
>            Reporter: Jaimin Jetly
>            Assignee: Jaimin Jetly
>             Fix For: 3.0.0
>         Attachments: AMBARI-20436.2.patch, AMBARI-20436.patch
> As part of this task, following changes are done:
> # A separate branch is created for this work: ambari-rest-api-explorer
> # Users, Groups and Views API are integrated with swagger and exposed from ambari rest
api explorer ui (swagger ui) on a deployed cluster at path:
> # swagger-maven-plugin is used to generate swagger.json file on compile time. This file
is published in web resources directory. Note that this file is generated build time and will
be available on deployed ambari-server host at web resources location but it is not yet decided
to be committed and maintained in Ambari source code
> # swagger2markup-maven-plugin is used to generate asciidoc from swagger.json file (that
can be shown as markdown in github). More information about this format an be found at
and This generates files in docs/api/asciidoc/** location at build
time. This directory is currently intended to be committed and maintained in ambari source
> # swagger-ui (version: v2.1.1-M2) compiled code with the different css skin (adopted
from [link|]) is committed to ambari-web/api-docs directory
with certain modification to make it work with ambari api. Further ui polishing will be done
in subsequent tasks. Also there is a strong possibility to maintain the fork code of swagger-ui
and compile (minify and concanate) it during ambari compile time rather than directly using
swagger-ui dist files. Doing so will help when customization done over swagger-ui will increase
> # swagger-annotation expects application to define schema of request body and response
for each endpoint to be encapsulated in a class. While Ambari follows this pattern for some
of the endpoint, there are many others which does not do so. For The ones which do not does
so, new request and response classes were defined. Going forward at the completion of this
epic, either each resource type or each resource provider should be coupled with a resource
response class and a resource request class. As part of this patch, each resourceprovider
worked upon introduces a new method "getResponse". At completion of this epic ResourceProvider
interface should also declare methods like "getResponse" and "getRequest" that returns response
schema and request schema instances for the resource API endpoints
> #  Currently it seems that swagger has a limitation in supporting  "subresource locator
methods". This issue is been reported to swagger community and is being tracked at [link|]
. As a result of which currently as a temporary workaround, all subresources are converted
to root resources. Also all root resources on similar path are moved under same subpackages.

This message was sent by Atlassian JIRA

View raw message