diff --git a/ansible_ai_connect/main/settings/base.py b/ansible_ai_connect/main/settings/base.py index 5d617a763..fb2554d60 100644 --- a/ansible_ai_connect/main/settings/base.py +++ b/ansible_ai_connect/main/settings/base.py @@ -270,10 +270,12 @@ def is_ssl_enabled(value: str) -> bool: "DEFAULT_RENDERER_CLASSES": ("rest_framework.renderers.JSONRenderer",), "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning", "ALLOWED_VERSIONS": ("v0", "v1"), - "DEFAULT_VERSION": "v0", + "DEFAULT_VERSION": "v1", "VERSION_PARAM": "version", } +API_VERSION = "1.0.0" + # Current RHSSOAuthentication implementation is incompatible with tech preview terms partial if not ANSIBLE_AI_ENABLE_TECH_PREVIEW: REST_FRAMEWORK["DEFAULT_AUTHENTICATION_CLASSES"].insert( diff --git a/ansible_ai_connect/main/settings/development.py b/ansible_ai_connect/main/settings/development.py index 769587bbe..9dbef15bd 100644 --- a/ansible_ai_connect/main/settings/development.py +++ b/ansible_ai_connect/main/settings/development.py @@ -13,7 +13,7 @@ # limitations under the License. from .base import * # NOQA -from .base import MIDDLEWARE, cast, os +from .base import API_VERSION, MIDDLEWARE, cast, os from .types import t_wca_secret_backend_type DEBUG = True @@ -24,7 +24,7 @@ SPECTACULAR_SETTINGS = { "TITLE": f"{ANSIBLE_AI_PROJECT_NAME}.", # noqa: F405 "DESCRIPTION": "Equip the automation developer at Lightspeed.", - "VERSION": "0.0.9", + "VERSION": API_VERSION, "SERVE_INCLUDE_SCHEMA": False, # OTHER SETTINGS "TAGS": [ diff --git a/tools/openapi-schema/ansible-ai-connect-service.yaml b/tools/openapi-schema/ansible-ai-connect-service.yaml index 5008d44e9..0189bf23f 100644 --- a/tools/openapi-schema/ansible-ai-connect-service.yaml +++ b/tools/openapi-schema/ansible-ai-connect-service.yaml @@ -1,10 +1,10 @@ openapi: 3.0.3 info: title: Ansible AI Connect. - version: 0.0.9 (v0) + version: 1.0.0 (v1) description: Equip the automation developer at Lightspeed. paths: - /api/v0/ai/chat/: + /api/v1/ai/chat/: post: operationId: ai_chat_create description: Send a message to the backend chatbot service and get a reply. @@ -47,7 +47,7 @@ paths: description: Internal server error '503': description: Service unavailable - /api/v0/ai/completions/: + /api/v1/ai/completions/: post: operationId: ai_completions_create description: Returns inline code suggestions based on a given Ansible editor @@ -111,7 +111,7 @@ paths: description: Request was throttled '503': description: Service Unavailable - /api/v0/ai/contentmatches/: + /api/v1/ai/contentmatches/: post: operationId: ai_contentmatches_create description: Returns content matches that were the highest likelihood sources @@ -151,7 +151,7 @@ paths: description: Request was throttled '503': description: Service Unavailable - /api/v0/ai/explanations/: + /api/v1/ai/explanations/: post: operationId: ai_explanations_create description: Returns a text that explains a playbook. @@ -192,7 +192,7 @@ paths: description: Request was throttled '503': description: Service Unavailable - /api/v0/ai/feedback/: + /api/v1/ai/feedback/: post: operationId: ai_feedback_create description: Feedback API for the AI service @@ -234,48 +234,7 @@ paths: description: Bad Request '401': description: Unauthorized - /api/v0/ai/generations/: - post: - operationId: ai_generations_create - description: Returns a playbook based on a text input. - summary: Inline code suggestions - tags: - - ai - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GenerationPlaybookRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/GenerationPlaybookRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/GenerationPlaybookRequest' - required: true - security: - - oauth2: - - read - - write - - cookieAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/GenerationPlaybookResponse' - description: '' - '204': - description: Empty response - '400': - description: Bad Request - '401': - description: Unauthorized - '429': - description: Request was throttled - '503': - description: Service Unavailable - /api/v0/ai/generations/playbook: + /api/v1/ai/generations/playbook/: post: operationId: ai_generations_playbook_create description: Returns a playbook based on a text input. @@ -316,7 +275,7 @@ paths: description: Request was throttled '503': description: Service Unavailable - /api/v0/ai/generations/role: + /api/v1/ai/generations/role/: post: operationId: ai_generations_role_create description: Returns a role based on a text input. @@ -349,7 +308,7 @@ paths: description: '' '401': description: Unauthorized - /api/v0/me/: + /api/v1/me/: get: operationId: me_retrieve tags: @@ -363,7 +322,7 @@ paths: schema: $ref: '#/components/schemas/UserResponse' description: '' - /api/v0/me/summary/: + /api/v1/me/summary/: get: operationId: me_summary_retrieve tags: @@ -377,7 +336,7 @@ paths: schema: $ref: '#/components/schemas/MarkdownUserResponse' description: '' - /api/v0/telemetry/: + /api/v1/telemetry/: get: operationId: telemetry_settings_get summary: Get the telemetry settings for an Organisation @@ -401,6 +360,8 @@ paths: description: Request was throttled '500': description: Internal service error + '501': + description: Not implemented post: operationId: telemetry_settings_set summary: Set the Telemetry settings for an Organisation @@ -442,7 +403,9 @@ paths: description: Request was throttled '500': description: Internal service error - /api/v0/wca/apikey/: + '501': + description: Not implemented + /api/v1/wca/apikey/: get: operationId: wca_api_key_get summary: Get WCA key for an Organisation @@ -467,6 +430,8 @@ paths: description: Request was throttled '500': description: Internal service error + '501': + description: Not implemented post: operationId: wca_api_key_set summary: Set the WCA key for an Organisation @@ -509,6 +474,8 @@ paths: description: Request was throttled '500': description: Internal service error + '501': + description: Not implemented delete: operationId: wca_api_key_delete summary: DELETE WCA key for an Organization @@ -533,7 +500,9 @@ paths: description: Request was throttled '500': description: Internal service error - /api/v0/wca/apikey/test/: + '501': + description: Not implemented + /api/v1/wca/apikey/test/: get: operationId: wca_api_key_validator_get summary: Validate WCA key for an Organisation @@ -556,7 +525,9 @@ paths: description: Request was throttled '500': description: Internal service error - /api/v0/wca/modelid/: + '501': + description: Not implemented + /api/v1/wca/modelid/: get: operationId: wca_model_id_get summary: Get WCA Model Id for an Organisation @@ -580,6 +551,8 @@ paths: description: Request was throttled '500': description: Internal service error + '501': + description: Not implemented post: operationId: wca_model_id_set summary: Set the Model Id to be used for an Organisation @@ -621,7 +594,9 @@ paths: description: Request was throttled '500': description: Internal service error - /api/v0/wca/modelid/test/: + '501': + description: Not implemented + /api/v1/wca/modelid/test/: get: operationId: wca_model_id_validator_get summary: Validate WCA Model Id for an Organisation @@ -644,6 +619,8 @@ paths: description: Request was throttled '500': description: Internal service error + '501': + description: Not implemented /check/: get: operationId: check_retrieve