diff --git a/.github/workflows/image-publish.yml b/.github/workflows/image-publish.yml index c2b5f0f..75514c0 100644 --- a/.github/workflows/image-publish.yml +++ b/.github/workflows/image-publish.yml @@ -18,7 +18,7 @@ on: jobs: image-publish: - uses: WIPACrepo/wipac-dev-workflows/.github/workflows/image-publish.yml@v1.23 + uses: WIPACrepo/wipac-dev-workflows/.github/workflows/image-publish.yml@v1.24 permissions: # for GITHUB_TOKEN packages: write with: diff --git a/.github/workflows/wipac-cicd.yml b/.github/workflows/wipac-cicd.yml index c91d511..82eaccc 100644 --- a/.github/workflows/wipac-cicd.yml +++ b/.github/workflows/wipac-cicd.yml @@ -49,7 +49,7 @@ jobs: lint: needs: [ py-versions ] - uses: WIPACrepo/wipac-dev-workflows/.github/workflows/lint-python.yml@v1.23 + uses: WIPACrepo/wipac-dev-workflows/.github/workflows/lint-python.yml@v1.24 with: py-matrix-json: ${{ needs.py-versions.outputs.matrix }} max-complexity: 10 # ideal is ~10-15 @@ -67,7 +67,7 @@ jobs: with: token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} ref: ${{ github.ref }} # dont lock to sha (action needs to push) - - uses: WIPACrepo/wipac-dev-py-setup-action@v5.10 + - uses: WIPACrepo/wipac-dev-py-setup-action@v5.12 with: mode: PACKAGING python_min: 3.12 @@ -92,24 +92,6 @@ jobs: - uses: WIPACrepo/wipac-dev-py-dependencies-action@v3.4 - ############################################################################ - # DOCS GENERATION - ############################################################################# - - api-documentation: - needs: [ lint ] - if: ${{ github.actor != 'dependabot[bot]' }} # dependabot cannot access PAT - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # fyi, dependabot can't access normal secrets - ref: ${{ github.ref }} # dont lock to sha (action needs to push) - - uses: WIPACrepo/wipac-dev-openapi-docs-action@v1.0 - with: - openapi_fpath: "mqs/openapi.json" - - ############################################################################ # TESTS ############################################################################# @@ -237,12 +219,11 @@ jobs: lint, py-setup, py-dependencies, - api-documentation, test-build-docker, integration-tests, unit-tests ] - uses: WIPACrepo/wipac-dev-workflows/.github/workflows/tag-and-release.yml@v1.23 + uses: WIPACrepo/wipac-dev-workflows/.github/workflows/tag-and-release.yml@v1.24 permissions: # for GITHUB_TOKEN contents: write with: diff --git a/Docs/.openapi-generator-ignore b/Docs/.openapi-generator-ignore deleted file mode 100755 index 7484ee5..0000000 --- a/Docs/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/Docs/.openapi-generator/FILES b/Docs/.openapi-generator/FILES deleted file mode 100755 index a7ff977..0000000 --- a/Docs/.openapi-generator/FILES +++ /dev/null @@ -1,10 +0,0 @@ -.openapi-generator-ignore -Apis/DefaultApi.md -Models/MQGroupObject.md -Models/MQGroupObjectAndProfiles.md -Models/MQGroupObject_criteria.md -Models/MQProfileObject.md -Models/_mqbroker_issuer__well_known_jwks_json_get_200_response.md -Models/_mqbroker_issuer__well_known_jwks_json_get_400_response.md -Models/_v1_mqs_get_400_response.md -README.md diff --git a/Docs/.openapi-generator/VERSION b/Docs/.openapi-generator/VERSION deleted file mode 100755 index 0610c66..0000000 --- a/Docs/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.21.0-SNAPSHOT diff --git a/Docs/Apis/DefaultApi.md b/Docs/Apis/DefaultApi.md deleted file mode 100755 index ecbf1cc..0000000 --- a/Docs/Apis/DefaultApi.md +++ /dev/null @@ -1,200 +0,0 @@ -# DefaultApi - - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [_details_](DefaultApi.md#get-mqbroker-issuer.well-knownjwks.json) | **GET** /mqbroker-issuer/.well-known/jwks.json | | -| [_details_](DefaultApi.md#get-v1mqs) | **GET** /v1/mqs | | -| [_details_](DefaultApi.md#get-v1mqsmq-profilesmqid) | **GET** /v1/mqs/mq-profiles/{mqid} | | -| [_details_](DefaultApi.md#get-v1mqsschemaopenapi) | **GET** /v1/mqs/schema/openapi | | -| [_details_](DefaultApi.md#post-v1mqsworkflowsworkflow_idmq-groupactivation) | **POST** /v1/mqs/workflows/{workflow_id}/mq-group/activation | | -| [_details_](DefaultApi.md#get-v1mqsworkflowsworkflow_idmq-group) | **GET** /v1/mqs/workflows/{workflow_id}/mq-group | | -| [_details_](DefaultApi.md#post-v1mqsworkflowsworkflow_idmq-groupreservation) | **POST** /v1/mqs/workflows/{workflow_id}/mq-group/reservation | | -| [_details_](DefaultApi.md#get-v1mqsworkflowsworkflow_idmq-profilespublic) | **GET** /v1/mqs/workflows/{workflow_id}/mq-profiles/public | | - - - -# **GET /mqbroker-issuer/.well-known/jwks.json** -> _mqbroker_issuer__well_known_jwks_json_get_200_response GET /mqbroker-issuer/.well-known/jwks.json() - - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**_mqbroker_issuer__well_known_jwks_json_get_200_response**](../Models/_mqbroker_issuer__well_known_jwks_json_get_200_response.md) - -### Authorization - - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **GET /v1/mqs** -> GET /v1/mqs() - - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **GET /v1/mqs/mq-profiles/{mqid}** -> MQProfileObject GET /v1/mqs/mq-profiles/{mqid}(mqid) - - - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **mqid** | **String**| the id of the message queue (found in mq profile) | [default to null] | - -### Return type - -[**MQProfileObject**](../Models/MQProfileObject.md) - -### Authorization - - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **GET /v1/mqs/schema/openapi** -> Map GET /v1/mqs/schema/openapi() - - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Map**](../Models/AnyType.md) - -### Authorization - - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **POST /v1/mqs/workflows/{workflow_id}/mq-group/activation** -> MQGroupObjectAndProfiles POST /v1/mqs/workflows/{workflow_id}/mq-group/activation(workflow\_id, body) - - - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflow\_id** | **String**| the id of the ewms workflow that maps to an mq group | [default to null] | -| **body** | **oas_any_type_not_mapped**| | [optional] | - -### Return type - -[**MQGroupObjectAndProfiles**](../Models/MQGroupObjectAndProfiles.md) - -### Authorization - - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -# **GET /v1/mqs/workflows/{workflow_id}/mq-group** -> MQGroupObject GET /v1/mqs/workflows/{workflow_id}/mq-group(workflow\_id) - - - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflow\_id** | **String**| the id of the ewms workflow that maps to an mq group | [default to null] | - -### Return type - -[**MQGroupObject**](../Models/MQGroupObject.md) - -### Authorization - - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **POST /v1/mqs/workflows/{workflow_id}/mq-group/reservation** -> MQGroupObjectAndProfiles POST /v1/mqs/workflows/{workflow_id}/mq-group/reservation(workflow\_id, body) - - - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflow\_id** | **String**| the id of the ewms workflow that maps to an mq group | [default to null] | -| **body** | **oas_any_type_not_mapped**| | [optional] | - -### Return type - -[**MQGroupObjectAndProfiles**](../Models/MQGroupObjectAndProfiles.md) - -### Authorization - - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -# **GET /v1/mqs/workflows/{workflow_id}/mq-profiles/public** -> oas_any_type_not_mapped GET /v1/mqs/workflows/{workflow_id}/mq-profiles/public(workflow\_id) - - - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflow\_id** | **String**| the id of the ewms workflow that maps to an mq group | [default to null] | - -### Return type - -[**oas_any_type_not_mapped**](../Models/AnyType.md) - -### Authorization - - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - diff --git a/Docs/Models/MQGroupObject.md b/Docs/Models/MQGroupObject.md deleted file mode 100755 index c6a9cbe..0000000 --- a/Docs/Models/MQGroupObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# MQGroupObject -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **workflow\_id** | **String** | | [optional] [default to null] | -| **timestamp** | **BigDecimal** | | [optional] [default to null] | -| **criteria** | [**MQGroupObject_criteria**](MQGroupObject_criteria.md) | | [optional] [default to null] | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/Docs/Models/MQGroupObjectAndProfiles.md b/Docs/Models/MQGroupObjectAndProfiles.md deleted file mode 100755 index 7a60b2c..0000000 --- a/Docs/Models/MQGroupObjectAndProfiles.md +++ /dev/null @@ -1,10 +0,0 @@ -# MQGroupObjectAndProfiles -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **mqgroup** | [**MQGroupObject**](MQGroupObject.md) | the created mq group object | [default to null] | -| **mqprofiles** | [**List**](MQProfileObject.md) | a list of mq profiles | [default to null] | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/Docs/Models/MQGroupObject_criteria.md b/Docs/Models/MQGroupObject_criteria.md deleted file mode 100755 index adf219c..0000000 --- a/Docs/Models/MQGroupObject_criteria.md +++ /dev/null @@ -1,9 +0,0 @@ -# MQGroupObject_criteria -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **priority** | **Integer** | | [default to null] | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/Docs/Models/MQProfileObject.md b/Docs/Models/MQProfileObject.md deleted file mode 100755 index ef79df6..0000000 --- a/Docs/Models/MQProfileObject.md +++ /dev/null @@ -1,17 +0,0 @@ -# MQProfileObject -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **mqid** | **String** | | [optional] [default to null] | -| **workflow\_id** | **String** | | [optional] [default to null] | -| **timestamp** | **BigDecimal** | | [optional] [default to null] | -| **alias** | **String** | | [optional] [default to null] | -| **is\_public** | **Boolean** | | [optional] [default to null] | -| **is\_activated** | **Boolean** | | [optional] [default to null] | -| **auth\_token** | **String** | | [optional] [default to null] | -| **broker\_type** | **String** | | [optional] [default to null] | -| **broker\_address** | **String** | | [optional] [default to null] | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/Docs/Models/_mqbroker_issuer__well_known_jwks_json_get_200_response.md b/Docs/Models/_mqbroker_issuer__well_known_jwks_json_get_200_response.md deleted file mode 100755 index 139eb53..0000000 --- a/Docs/Models/_mqbroker_issuer__well_known_jwks_json_get_200_response.md +++ /dev/null @@ -1,9 +0,0 @@ -# _mqbroker_issuer__well_known_jwks_json_get_200_response -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **keys** | [**List**](map.md) | the JWKS keys | [default to null] | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/Docs/Models/_mqbroker_issuer__well_known_jwks_json_get_400_response.md b/Docs/Models/_mqbroker_issuer__well_known_jwks_json_get_400_response.md deleted file mode 100755 index ba5f93d..0000000 --- a/Docs/Models/_mqbroker_issuer__well_known_jwks_json_get_400_response.md +++ /dev/null @@ -1,10 +0,0 @@ -# _mqbroker_issuer__well_known_jwks_json_get_400_response -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **code** | **Integer** | http error code | [default to null] | -| **error** | **String** | http error reason | [default to null] | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/Docs/Models/_v1_mqs_get_400_response.md b/Docs/Models/_v1_mqs_get_400_response.md deleted file mode 100755 index 16d5218..0000000 --- a/Docs/Models/_v1_mqs_get_400_response.md +++ /dev/null @@ -1,10 +0,0 @@ -# _v1_mqs_get_400_response -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **code** | **Integer** | http error code | [default to null] | -| **error** | **String** | http error reason | [default to null] | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/Docs/README.md b/Docs/README.md deleted file mode 100755 index c2070f8..0000000 --- a/Docs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Documentation for EWMS - Message Queue Service - - -## Documentation for API Endpoints - - -| Class | Method | HTTP request | Description | -|------------ | ------------- | ------------- | -------------| -| *DefaultApi* | [_details_](Apis/DefaultApi.md#get-mqbroker-issuer.well-knownjwks.json) | **GET** /mqbroker-issuer/.well-known/jwks.json | | -*DefaultApi* | [_details_](Apis/DefaultApi.md#get-v1mqs) | **GET** /v1/mqs | | -*DefaultApi* | [_details_](Apis/DefaultApi.md#get-v1mqsmq-profilesmqid) | **GET** /v1/mqs/mq-profiles/{mqid} | | -*DefaultApi* | [_details_](Apis/DefaultApi.md#get-v1mqsschemaopenapi) | **GET** /v1/mqs/schema/openapi | | -*DefaultApi* | [_details_](Apis/DefaultApi.md#post-v1mqsworkflowsworkflow_idmq-groupactivation) | **POST** /v1/mqs/workflows/{workflow_id}/mq-group/activation | | -*DefaultApi* | [_details_](Apis/DefaultApi.md#get-v1mqsworkflowsworkflow_idmq-group) | **GET** /v1/mqs/workflows/{workflow_id}/mq-group | | -*DefaultApi* | [_details_](Apis/DefaultApi.md#post-v1mqsworkflowsworkflow_idmq-groupreservation) | **POST** /v1/mqs/workflows/{workflow_id}/mq-group/reservation | | -*DefaultApi* | [_details_](Apis/DefaultApi.md#get-v1mqsworkflowsworkflow_idmq-profilespublic) | **GET** /v1/mqs/workflows/{workflow_id}/mq-profiles/public | | - - - -## Documentation for Models - - - [MQGroupObject](./Models/MQGroupObject.md) - - [MQGroupObjectAndProfiles](./Models/MQGroupObjectAndProfiles.md) - - [MQGroupObject_criteria](./Models/MQGroupObject_criteria.md) - - [MQProfileObject](./Models/MQProfileObject.md) - - [_mqbroker_issuer__well_known_jwks_json_get_200_response](./Models/_mqbroker_issuer__well_known_jwks_json_get_200_response.md) - - [_mqbroker_issuer__well_known_jwks_json_get_400_response](./Models/_mqbroker_issuer__well_known_jwks_json_get_400_response.md) - - [_v1_mqs_get_400_response](./Models/_v1_mqs_get_400_response.md) - - - -## Documentation for Authorization - diff --git a/README.md b/README.md index 6362288..5afbcd7 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,30 @@ -[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Observation-Management-Service/ewms-message-queue-service?include_prereleases)](https://github.com/Observation-Management-Service/ewms-message-queue-service/) [![GitHub issues](https://img.shields.io/github/issues/Observation-Management-Service/ewms-message-queue-service)](https://github.com/Observation-Management-Service/ewms-message-queue-service/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aopen) [![GitHub pull requests](https://img.shields.io/github/issues-pr/Observation-Management-Service/ewms-message-queue-service)](https://github.com/Observation-Management-Service/ewms-message-queue-service/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aopen) +[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Observation-Management-Service/ewms-message-queue-service?include_prereleases)](https://github.com/Observation-Management-Service/ewms-message-queue-service) [![GitHub issues](https://img.shields.io/github/issues/Observation-Management-Service/ewms-message-queue-service)](https://github.com/Observation-Management-Service/ewms-message-queue-service/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aopen) [![GitHub pull requests](https://img.shields.io/github/issues-pr/Observation-Management-Service/ewms-message-queue-service)](https://github.com/Observation-Management-Service/ewms-message-queue-service/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aopen) -# ewms-message-queue-service v1 +# Message Queue Service EWMS's Message Queue Service (MQS): The Interface to the DDS's Message Queue Broker + + + + +
+
Keywords
+
EWMS  ·  task  ·  Workflow Management Service  ·  WIPAC  ·  IceCube  ·  Observation Management Service  ·  Event Workflow Management System
+
URLs
+
Homepage  ·  Tracker  ·  Source  ·  Documentation
+
+ +
+ ## API Documentation -See [Docs/](./Docs) +See [Docs](https://observation-management-service.github.io/ewms-docs/services/mqs.html) ## Queue Creation Queue creation (joined as a group of 1+ queues) has two distinct steps: reservation and activation. Queue groups must be reserved before activation. +Also, see [EWMS Workflow Lifetime](https://observation-management-service.github.io/ewms-docs/services/wms.html#ewms-workflow-lifetime). diff --git a/mqs/openapi.json b/mqs/openapi.json index 3ea73c4..daa49f9 100644 --- a/mqs/openapi.json +++ b/mqs/openapi.json @@ -1,7 +1,7 @@ { "openapi": "3.1.0", "info": { - "title": "EWMS - Message Queue Service", + "title": "EWMS Message Queue Service", "version": "1" }, "components": { @@ -10,13 +10,36 @@ "name": "workflow_id", "in": "path", "required": true, - "description": "the id of the ewms workflow that maps to an mq group", + "description": "The ID of the EWMS workflow that maps to an MQ group.", "schema": { "type": "string" } } }, "schemas": { + "ErrorResponse": { + "type": "object", + "properties": { + "code": { + "description": "HTTP error code.", + "type": "integer" + }, + "error": { + "description": "HTTP error reason.", + "type": "string" + } + }, + "required": [ + "code", + "error" + ], + "additionalProperties": false + }, + "EmptyObject": { + "type": "object", + "description": "An empty JSON object.", + "additionalProperties": false + }, "MQGroupObject": { "type": "object", "properties": { @@ -108,11 +131,11 @@ "type": "object", "properties": { "mqgroup": { - "description": "the created mq group object", + "description": "The created MQ group object.", "$ref": "#/components/schemas/MQGroupObject" }, "mqprofiles": { - "description": "a list of mq profiles", + "description": "A list of MQ profiles.", "type": "array", "items": { "$ref": "#/components/schemas/MQProfileObject" @@ -125,6 +148,104 @@ "mqprofiles" ], "additionalProperties": false + }, + "MQGroupActivationRequest": { + "type": "object", + "properties": { + "criteria": { + "$ref": "#/components/schemas/MQGroupObject/properties/criteria" + } + }, + "additionalProperties": false + }, + "MQGroupReservationRequest": { + "type": "object", + "properties": { + "queue_aliases": { + "description": "A list of requested queues, given by user-defined aliases.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "public": { + "description": "A list of queue aliases designated for public access outside EWMS.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 0 + } + }, + "required": [ + "queue_aliases" + ], + "additionalProperties": false + }, + "PublicMQProfilesResponse": { + "type": "object", + "properties": { + "mqprofiles": { + "description": "A list of MQ profiles.", + "type": "array", + "items": { + "$ref": "#/components/schemas/MQProfileObject" + }, + "minItems": 0 + } + }, + "required": [ + "mqprofiles" + ], + "additionalProperties": false + }, + "JWKSetResponse": { + "type": "object", + "properties": { + "keys": { + "description": "The JWKS keys.", + "type": "array", + "items": { + "type": "object", + "minProperties": 0, + "additionalProperties": true + }, + "minItems": 0 + } + }, + "required": [ + "keys" + ], + "additionalProperties": false + }, + "OpenAPISchemaObject": { + "type": "object", + "description": "The OpenAPI schema.", + "properties": {}, + "additionalProperties": true + } + }, + "responses": { + "BadRequest": { + "description": "Invalid request arguments.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "NotFound": { + "description": "Not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } }, @@ -134,57 +255,20 @@ "get": { "responses": { "200": { - "description": "the JWKS keys", + "description": "The JWKS keys.", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "keys": { - "description": "the JWKS keys", - "type": "array", - "items": { - "type": "object", - "minProperties": 0, - "additionalProperties": true - }, - "minItems": 0 - } - }, - "required": [ - "keys" - ], - "additionalProperties": false + "$ref": "#/components/schemas/JWKSetResponse" } } } }, "400": { - "description": "invalid request arguments", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/BadRequest" } - } + }, + "description": "See `JWKSetResponse `_." } }, "/v1/mqs": { @@ -192,35 +276,17 @@ "get": { "responses": { "200": { - "description": "an empty response", - "content": { - "application/json": {} - } - }, - "400": { - "description": "invalid request arguments", + "description": "An empty response.", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false + "$ref": "#/components/schemas/EmptyObject" } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" } } } @@ -231,7 +297,7 @@ "name": "mqid", "in": "path", "required": true, - "description": "the id of the message queue (found in mq profile)", + "description": "The ID of the message queue, as found in the MQ profile.", "schema": { "type": "string" } @@ -240,7 +306,7 @@ "get": { "responses": { "200": { - "description": "the matching mq profile", + "description": "The matching MQ profile.", "content": { "application/json": { "schema": { @@ -250,56 +316,16 @@ } }, "400": { - "description": "invalid request arguments", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/BadRequest" }, "404": { - "description": "not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/NotFound" } - } + }, + "tags": [ + "mq-profiles" + ], + "description": "See `MQProfileObject `_." } }, "/v1/mqs/schema/openapi": { @@ -307,43 +333,22 @@ "get": { "responses": { "200": { - "description": "the openapi schema", + "description": "The OpenAPI schema.", "content": { "application/json": { "schema": { - "type": "object", - "properties": {}, - "additionalProperties": true + "$ref": "#/components/schemas/OpenAPISchemaObject" } } } }, "400": { - "description": "invalid request arguments", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/BadRequest" } - } + }, + "tags": [ + "openapi" + ] } }, "/v1/mqs/workflows/{workflow_id}/mq-group": { @@ -355,7 +360,7 @@ "get": { "responses": { "200": { - "description": "the matching mq group object", + "description": "The matching MQ group object.", "content": { "application/json": { "schema": { @@ -365,56 +370,16 @@ } }, "400": { - "description": "invalid request arguments", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/BadRequest" }, "404": { - "description": "not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/NotFound" } - } + }, + "tags": [ + "mq-group" + ], + "description": "See `MQGroupObject `_." } }, "/v1/mqs/workflows/{workflow_id}/mq-group/activation": { @@ -425,19 +390,18 @@ ], "post": { "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "criteria": { - "$ref": "#/components/schemas/MQGroupObject/properties/criteria" - } + "$ref": "#/components/schemas/MQGroupActivationRequest" } } } }, "responses": { "200": { - "description": "an activated group of queues", + "description": "An activated group of queues.", "content": { "application/json": { "schema": { @@ -447,56 +411,16 @@ } }, "400": { - "description": "invalid request arguments", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/BadRequest" }, "404": { - "description": "not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/NotFound" } - } + }, + "tags": [ + "mq-group" + ], + "description": "See `MQGroupActivationRequest `_, `MQGroupObjectAndProfiles `_." } }, "/v1/mqs/workflows/{workflow_id}/mq-group/reservation": { @@ -507,32 +431,18 @@ ], "post": { "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "queue_aliases": { - "description": "a list of queues requested, given by user-defined aliases", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "public": { - "description": "a list of which queue aliases are deemed for public access (outside of EWMS)", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 0 - } + "$ref": "#/components/schemas/MQGroupReservationRequest" } } } }, "responses": { "200": { - "description": "a successfully reserved (unactivated) group of queues", + "description": "A successfully reserved, unactivated group of queues.", "content": { "application/json": { "schema": { @@ -542,56 +452,16 @@ } }, "400": { - "description": "invalid request arguments", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/BadRequest" }, "404": { - "description": "not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/NotFound" } - } + }, + "tags": [ + "mq-group" + ], + "description": "See `MQGroupReservationRequest `_, `MQGroupObjectAndProfiles `_." } }, "/v1/mqs/workflows/{workflow_id}/mq-profiles/public": { @@ -604,73 +474,26 @@ "parameters": [], "responses": { "200": { - "description": "a successful result", + "description": "The public MQ profiles for the workflow.", "content": { "application/json": { "schema": { - "mqprofiles": { - "description": "a list of mq profiles", - "type": "array", - "items": { - "$ref": "#/components/schemas/MQProfileObject" - }, - "minItems": 0 - } + "$ref": "#/components/schemas/PublicMQProfilesResponse" } } } }, "400": { - "description": "invalid request arguments", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/BadRequest" }, "404": { - "description": "not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "http error code", - "type": "integer" - }, - "error": { - "description": "http error reason", - "type": "string" - } - }, - "required": [ - "code", - "error" - ], - "additionalProperties": false - } - } - } + "$ref": "#/components/responses/NotFound" } - } + }, + "tags": [ + "mq-profiles" + ], + "description": "See `PublicMQProfilesResponse `_." } } } diff --git a/mqs/rest_handlers/base_handlers.py b/mqs/rest_handlers/base_handlers.py index afd21fd..26152b3 100644 --- a/mqs/rest_handlers/base_handlers.py +++ b/mqs/rest_handlers/base_handlers.py @@ -16,7 +16,7 @@ class BaseMQSHandler(RestHandler): # pylint: disable=W0223 """BaseMQSHandler is a RestHandler for all MQS routes.""" - def initialize( # type: ignore[override] + def initialize( # type: ignore[override] # ty: ignore[invalid-method-override] self, mongo_client: AsyncMongoClient, mqbroker_auth: BrokerQueueAuth, diff --git a/pyproject.toml b/pyproject.toml index 0f0a534..c7e7051 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,9 +56,10 @@ mypy = [ ] # do not edit — autogenerated by wipac-dev-py-setup-action [project.urls] # do not edit — autogenerated by wipac-dev-py-setup-action -Homepage = "https://github.com/Observation-Management-Service/ewms-message-queue-service" -Tracker = "https://github.com/Observation-Management-Service/ewms-message-queue-service/issues" -Source = "https://github.com/Observation-Management-Service/ewms-message-queue-service" +Homepage = "https://github.com/Observation-Management-Service/ewms-message-queue-service" # do not edit — autogenerated by wipac-dev-py-setup-action +Tracker = "https://github.com/Observation-Management-Service/ewms-message-queue-service/issues" # do not edit — autogenerated by wipac-dev-py-setup-action +Source = "https://github.com/Observation-Management-Service/ewms-message-queue-service" # do not edit — autogenerated by wipac-dev-py-setup-action +Documentation = "https://observation-management-service.github.io/ewms-docs/services/mqs.html" [build-system] # do not edit — autogenerated by wipac-dev-py-setup-action requires = ["setuptools>=78.1", "setuptools-scm"] diff --git a/setup.py b/setup.py index d866a37..3e4e7e7 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,7 @@ """Setup.""" -from setuptools import setup # type: ignore[import-not-found] # for ci/cd +# ruff: noqa + +from setuptools import setup # type: ignore[import-not-found] # ty: ignore[unresolved-import] # for ci/cd setup()