From fff7fd5151773904a71a557d1e33d2a0f00ef3df Mon Sep 17 00:00:00 2001 From: lbroudoux Date: Thu, 30 Aug 2018 15:06:46 +0200 Subject: [PATCH 1/2] Move threescale_cicd_api_basepath from vars to default to be able to override with playbook vars --- defaults/main.yml | 1 + vars/main.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 40d6c45..dfc4560 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -50,6 +50,7 @@ threescale_cicd_openapi_smoketest_operation: '{{ threescale_cicd_openapi_file_co ## ## OpenAPI Specification File parsing ## +threescale_cicd_api_basepath: '{{ threescale_cicd_openapi_file_content.basePath|default("") }}' threescale_cicd_api_base_system_name: '{{ lookup(''template'', ''openapi/generate_base_system_name.j2'') }}' threescale_cicd_api_system_name: '{{ lookup(''template'', ''openapi/generate_final_system_name.j2'') }}' threescale_cicd_private_base_url: '{{ lookup(''template'', ''openapi/private_base_url.j2'') }}' diff --git a/vars/main.yml b/vars/main.yml index b116f88..ca38c7b 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -24,7 +24,6 @@ threescale_cicd_api_default_name: '{{ threescale_cicd_openapi_file_content.info. threescale_cicd_api_name: '{{ lookup(''template'', ''openapi/service_name.j2'') }}' threescale_cicd_api_description: '{{ threescale_cicd_openapi_file_content.info.description|default("") }}' threescale_cicd_api_version: '{{ threescale_cicd_openapi_file_content.info.version|default("0.0.1") }}' -threescale_cicd_api_basepath: '{{ threescale_cicd_openapi_file_content.basePath|default("") }}' threescale_cicd_api_operations: '{{ lookup(''template'', ''openapi/openapi_operations.j2'') }}' threescale_cicd_api_version_components: '{{ threescale_cicd_api_version.split(".") }}' threescale_cicd_api_version_major: '{{ threescale_cicd_api_version_components|first }}' From 205a4735b6092c9ad40d8043584adabbdaac3ad1 Mon Sep 17 00:00:00 2001 From: lbroudoux Date: Thu, 30 Aug 2018 16:22:27 +0200 Subject: [PATCH 2/2] Update README on threescale_cicd_api_basepath behaviour --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 4ed7d14..57d396c 100644 --- a/README.md +++ b/README.md @@ -404,6 +404,17 @@ Automatically defines the APIcast public URLs based on a scheme. threescale_cicd_apicast_production_endpoint=https://my-wonderful-service.acme.corp/ ``` +### `threescale_cicd_api_basepath` + +Defines a `basePath` on which is deployed the backend API, overriding the `basePath` field +of the OpenAPI Specification. The resulting value is used to define the mapping rules of the +3scale API Gateway, prepending this base path to paths of different methods/operations. + +- **Syntax:** URI part with starting / +- **Required:** no +- **Default value:** the `basePath` field of the OpenAPI Specification. +- **Examples:** `/api` or `/context` + ### `threescale_cicd_api_backend_hostname` Defines the backend hostname, overriding the `host` field of the OpenAPI Specification.