From 3336e9f482bd9b1600718e5204113792bd076def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Tue, 26 Mar 2024 13:45:28 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=A6=20Offer=20package=20containing?= =?UTF-8?q?=20the=20OpenAPI-specification=20of=20Autoscaler's=20API;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flake.nix b/flake.nix index 9125fef282..17c1263107 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,12 @@ }; }); + openapi-specifications = { + app-autoscaler-api = builtins.filterSource + (path: type: builtins.match ".*\.ya?ml" (baseNameOf path) != null && type == "regular") + "${app-autoscaler-release}/api"; + }; + devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; From 679d804006e128d810e72dda796ba3b0a8b6099b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Tue, 26 Mar 2024 13:46:27 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9A=96=20Add=20licence-info-object;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/application-metric-api.openapi.yaml | 8 ++++++-- api/custom-metrics-api.openapi.yaml | 6 +++++- api/policy-api.openapi.yaml | 8 ++++++-- api/scaling-history-api.openapi.yaml | 4 ++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/api/application-metric-api.openapi.yaml b/api/application-metric-api.openapi.yaml index 14d1e395fa..cdcdd95f86 100644 --- a/api/application-metric-api.openapi.yaml +++ b/api/application-metric-api.openapi.yaml @@ -7,6 +7,10 @@ info: This API is used to return the aggregated metric result of an application. version: 1.0.0 + license: + name: "Apache License Version 2.0" + # identifier: "Apache-2.0" # Requires at least OpenAPI 3.1.0 + url: "http://www.apache.org/licenses/LICENSE-2.0.html" tags: - name: Application Metric API V1 description: List aggregated metrics of an application. @@ -118,7 +122,7 @@ components: format: uri resources: type: array - items: + items: $ref: '#/components/schemas/ApplicationMetric' ApplicationMetric: description: Object containing metric history @@ -154,4 +158,4 @@ components: bearerAuth: type: http scheme: bearer - bearerFormat: JWT \ No newline at end of file + bearerFormat: JWT diff --git a/api/custom-metrics-api.openapi.yaml b/api/custom-metrics-api.openapi.yaml index 4eedf5b11a..d57687f778 100644 --- a/api/custom-metrics-api.openapi.yaml +++ b/api/custom-metrics-api.openapi.yaml @@ -4,6 +4,10 @@ info: description: | app-autoscaler lets you automatically increase or decrease the number of your application instances based on the policies you have defined. Your applications can call the app-autoscaler custom metrics API to submit custom metrics defined and used in a dynamic scaling policy to enable automatic scaling based on application-specific metrics. version: 1.0.0 + license: + name: "Apache License Version 2.0" + # identifier: "Apache-2.0" # Requires at least OpenAPI 3.1.0 + url: "http://www.apache.org/licenses/LICENSE-2.0.html" tags: - name: Custom Metrics API V1 description: Work with application-specific custom metrics to scale your application. @@ -89,4 +93,4 @@ components: description: Use the Instance Identity Credentials provided by the Cloud Foundry runtime basicAuthentication: type: http - scheme: basic \ No newline at end of file + scheme: basic diff --git a/api/policy-api.openapi.yaml b/api/policy-api.openapi.yaml index 52ad543d5c..6860cfd263 100644 --- a/api/policy-api.openapi.yaml +++ b/api/policy-api.openapi.yaml @@ -3,6 +3,10 @@ info: title: Policy API description: This API is used to create, delete, retrieve the policy version: 1.0.0 + license: + name: "Apache License Version 2.0" + # identifier: "Apache-2.0" # Requires at least OpenAPI 3.1.0 + url: "http://www.apache.org/licenses/LICENSE-2.0.html" security: - bearerAuth: [] tags: @@ -213,7 +217,7 @@ components: - end_date_time - instance_min_count - instance_max_count - properties: + properties: start_date_time: description: the start time of the schedule. Must be a future time type: string @@ -243,4 +247,4 @@ components: bearerAuth: type: http scheme: bearer - bearerFormat: JWT \ No newline at end of file + bearerFormat: JWT diff --git a/api/scaling-history-api.openapi.yaml b/api/scaling-history-api.openapi.yaml index a7250e6e37..4237eedcd7 100644 --- a/api/scaling-history-api.openapi.yaml +++ b/api/scaling-history-api.openapi.yaml @@ -3,6 +3,10 @@ info: title: Scaling History API description: List scaling history of an application version: 1.0.0 + license: + name: "Apache License Version 2.0" + # identifier: "Apache-2.0" # Requires at least OpenAPI 3.1.0 + url: "http://www.apache.org/licenses/LICENSE-2.0.html" tags: - name: Scaling History API V1 description: List the scaling history of an Application From 95ffacabf9a2ac3a02bfbcc4aaa18abdbcf89a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Tue, 26 Mar 2024 14:10:31 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=A7=20Fix=20API-spec-path;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 9 ++++++--- result | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) create mode 120000 result diff --git a/flake.nix b/flake.nix index 17c1263107..0df04e92a2 100644 --- a/flake.nix +++ b/flake.nix @@ -48,9 +48,12 @@ }); openapi-specifications = { - app-autoscaler-api = builtins.filterSource - (path: type: builtins.match ".*\.ya?ml" (baseNameOf path) != null && type == "regular") - "${app-autoscaler-release}/api"; + app-autoscaler-api = + let + apiPath = ./api; + in builtins.filterSource + (path: type: builtins.match ".*\.ya?ml" (baseNameOf path) != null && type == "regular") + apiPath; }; devShells = forAllSystems (system: diff --git a/result b/result new file mode 120000 index 0000000000..b0833e7111 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/jh9qqg0h60906vbhz08h238hhsd0m632-api \ No newline at end of file