diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9b38fcf..43c4709 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,6 +90,27 @@ start compiling your repo. (build out this section based on questions asked of the team) +### How do I add a new API endpoint? + +New endpoints starts in [openapi.yml](./service/src/main/resources/api/openapi.yml). + +Add and/or modify the desired endpoints in this document. +For documentation on `openapi` document structure, +[please start here](https://swagger.io/docs/specification/basic-structure/). + +> **NOTE: This is our public facing contract.** +> Changes to this must be considered carefully for version management. +> See [API Versioning](./docs/api_versioning.md) + +From here, run the following command to validate and generate the necessary `service/` +[interfaces](./service/build/swagger-code/src/main/java/bio/terra/appmanager/api), +[models](./service/build/swagger-code/src/main/java/bio/terra/appmanager/model), and +[`client/` code](./client/build/swagger-code/src/main/java/bio/terra/appmanager). + +```shell +/scripts/build -t project +``` + ## Additional questions The [Interactive Analysis Team](https://github.com/orgs/DataBiosphere/teams/broad-interactive-analysis) diff --git a/README.md b/README.md index bf96568..01d5ac2 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,12 @@ http://localhost:8080 ./scripts/run docker ``` +## Service swagger endpoints + +Existing deployed versions of this service are: + +- https://appmanager.dsde-dev.broadinstitute.org + ## Next steps Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for more information about the process of diff --git a/scripts/build b/scripts/build index 9473eb2..8dccc82 100755 --- a/scripts/build +++ b/scripts/build @@ -25,7 +25,7 @@ skip_tests="" die() { log_error "$*" >&2; echo ""; usage; exit 2; } # complain to STDERR and exit with error needs_arg() { if [ -z "$OPTARG" ]; then die "No arg for --$OPT option"; fi; } -while getopts h-: OPT; do # allow -h and -- "with arg" +while getopts th-: OPT; do # allow -h and -- "with arg" # support long options: https://stackoverflow.com/a/28466267/519360 if [ "$OPT" = "-" ]; then # long option: reformulate OPT and OPTARG OPT="${OPTARG%%=*}" # extract long option name @@ -44,6 +44,7 @@ shift $((OPTIND-1)) # remove parsed options and args from $@ list # process positional arguments (if any) BUILDTYPE=$1 +[ -z "${BUILDTYPE}" ] && die "Missing BUILDTYPE: '${BUILDTYPE}'" shift 1 # use all trailing arguments as caveats to BUILD command diff --git a/service/src/main/resources/api/openapi.yml b/service/src/main/resources/api/openapi.yml index 04ca813..059e98b 100644 --- a/service/src/main/resources/api/openapi.yml +++ b/service/src/main/resources/api/openapi.yml @@ -37,6 +37,26 @@ paths: $ref: '#/components/responses/ServerError' # README /docs/api_versioning.md + # + /api/admin/v1/charts/versions: + post: + tags: [ admin ] + summary: Create new ChartVersion(s) to track + operationId: createChartVersions + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChartArray' + responses: + '204': + description: ChartVersion(s) have been successfully created + '403': + description: Request did not come from an admin + '500': + $ref: '#/components/responses/ServerError' + /api/example/v1/message: get: summary: Gets your message @@ -191,6 +211,26 @@ components: build: type: string + ChartVersion: + type: object + properties: + chartName: + type: string + chartVersion: + type: string + appVersion: + type: string + activeAt: + type: string + format: date-time + inactiveAt: + type: string + format: date-time + ChartArray: + type: array + items: + $ref: '#/components/schemas/ChartVersion' + securitySchemes: bearerAuth: type: http