Skip to content

Commit ef52c47

Browse files
authored
make api v1 as default version (#1519)
make api v1 as default version issue: https://issues.redhat.com/browse/AAP-39012 Signed-off-by: Djebran Lezzoum <[email protected]>
1 parent 3e4232e commit ef52c47

File tree

3 files changed

+38
-59
lines changed

3 files changed

+38
-59
lines changed

ansible_ai_connect/main/settings/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,12 @@ def is_ssl_enabled(value: str) -> bool:
270270
"DEFAULT_RENDERER_CLASSES": ("rest_framework.renderers.JSONRenderer",),
271271
"DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning",
272272
"ALLOWED_VERSIONS": ("v0", "v1"),
273-
"DEFAULT_VERSION": "v0",
273+
"DEFAULT_VERSION": "v1",
274274
"VERSION_PARAM": "version",
275275
}
276276

277+
API_VERSION = "1.0.0"
278+
277279
# Current RHSSOAuthentication implementation is incompatible with tech preview terms partial
278280
if not ANSIBLE_AI_ENABLE_TECH_PREVIEW:
279281
REST_FRAMEWORK["DEFAULT_AUTHENTICATION_CLASSES"].insert(

ansible_ai_connect/main/settings/development.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from .base import * # NOQA
16-
from .base import MIDDLEWARE, cast, os
16+
from .base import API_VERSION, MIDDLEWARE, cast, os
1717
from .types import t_wca_secret_backend_type
1818

1919
DEBUG = True
@@ -24,7 +24,7 @@
2424
SPECTACULAR_SETTINGS = {
2525
"TITLE": f"{ANSIBLE_AI_PROJECT_NAME}.", # noqa: F405
2626
"DESCRIPTION": "Equip the automation developer at Lightspeed.",
27-
"VERSION": "0.0.9",
27+
"VERSION": API_VERSION,
2828
"SERVE_INCLUDE_SCHEMA": False,
2929
# OTHER SETTINGS
3030
"TAGS": [

tools/openapi-schema/ansible-ai-connect-service.yaml

Lines changed: 33 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
openapi: 3.0.3
22
info:
33
title: Ansible AI Connect.
4-
version: 0.0.9 (v0)
4+
version: 1.0.0 (v1)
55
description: Equip the automation developer at Lightspeed.
66
paths:
7-
/api/v0/ai/chat/:
7+
/api/v1/ai/chat/:
88
post:
99
operationId: ai_chat_create
1010
description: Send a message to the backend chatbot service and get a reply.
@@ -47,7 +47,7 @@ paths:
4747
description: Internal server error
4848
'503':
4949
description: Service unavailable
50-
/api/v0/ai/completions/:
50+
/api/v1/ai/completions/:
5151
post:
5252
operationId: ai_completions_create
5353
description: Returns inline code suggestions based on a given Ansible editor
@@ -111,7 +111,7 @@ paths:
111111
description: Request was throttled
112112
'503':
113113
description: Service Unavailable
114-
/api/v0/ai/contentmatches/:
114+
/api/v1/ai/contentmatches/:
115115
post:
116116
operationId: ai_contentmatches_create
117117
description: Returns content matches that were the highest likelihood sources
@@ -151,7 +151,7 @@ paths:
151151
description: Request was throttled
152152
'503':
153153
description: Service Unavailable
154-
/api/v0/ai/explanations/:
154+
/api/v1/ai/explanations/:
155155
post:
156156
operationId: ai_explanations_create
157157
description: Returns a text that explains a playbook.
@@ -192,7 +192,7 @@ paths:
192192
description: Request was throttled
193193
'503':
194194
description: Service Unavailable
195-
/api/v0/ai/feedback/:
195+
/api/v1/ai/feedback/:
196196
post:
197197
operationId: ai_feedback_create
198198
description: Feedback API for the AI service
@@ -234,48 +234,7 @@ paths:
234234
description: Bad Request
235235
'401':
236236
description: Unauthorized
237-
/api/v0/ai/generations/:
238-
post:
239-
operationId: ai_generations_create
240-
description: Returns a playbook based on a text input.
241-
summary: Inline code suggestions
242-
tags:
243-
- ai
244-
requestBody:
245-
content:
246-
application/json:
247-
schema:
248-
$ref: '#/components/schemas/GenerationPlaybookRequest'
249-
application/x-www-form-urlencoded:
250-
schema:
251-
$ref: '#/components/schemas/GenerationPlaybookRequest'
252-
multipart/form-data:
253-
schema:
254-
$ref: '#/components/schemas/GenerationPlaybookRequest'
255-
required: true
256-
security:
257-
- oauth2:
258-
- read
259-
- write
260-
- cookieAuth: []
261-
responses:
262-
'200':
263-
content:
264-
application/json:
265-
schema:
266-
$ref: '#/components/schemas/GenerationPlaybookResponse'
267-
description: ''
268-
'204':
269-
description: Empty response
270-
'400':
271-
description: Bad Request
272-
'401':
273-
description: Unauthorized
274-
'429':
275-
description: Request was throttled
276-
'503':
277-
description: Service Unavailable
278-
/api/v0/ai/generations/playbook:
237+
/api/v1/ai/generations/playbook/:
279238
post:
280239
operationId: ai_generations_playbook_create
281240
description: Returns a playbook based on a text input.
@@ -316,7 +275,7 @@ paths:
316275
description: Request was throttled
317276
'503':
318277
description: Service Unavailable
319-
/api/v0/ai/generations/role:
278+
/api/v1/ai/generations/role/:
320279
post:
321280
operationId: ai_generations_role_create
322281
description: Returns a role based on a text input.
@@ -349,7 +308,7 @@ paths:
349308
description: ''
350309
'401':
351310
description: Unauthorized
352-
/api/v0/me/:
311+
/api/v1/me/:
353312
get:
354313
operationId: me_retrieve
355314
tags:
@@ -363,7 +322,7 @@ paths:
363322
schema:
364323
$ref: '#/components/schemas/UserResponse'
365324
description: ''
366-
/api/v0/me/summary/:
325+
/api/v1/me/summary/:
367326
get:
368327
operationId: me_summary_retrieve
369328
tags:
@@ -377,7 +336,7 @@ paths:
377336
schema:
378337
$ref: '#/components/schemas/MarkdownUserResponse'
379338
description: ''
380-
/api/v0/telemetry/:
339+
/api/v1/telemetry/:
381340
get:
382341
operationId: telemetry_settings_get
383342
summary: Get the telemetry settings for an Organisation
@@ -401,6 +360,8 @@ paths:
401360
description: Request was throttled
402361
'500':
403362
description: Internal service error
363+
'501':
364+
description: Not implemented
404365
post:
405366
operationId: telemetry_settings_set
406367
summary: Set the Telemetry settings for an Organisation
@@ -442,7 +403,9 @@ paths:
442403
description: Request was throttled
443404
'500':
444405
description: Internal service error
445-
/api/v0/wca/apikey/:
406+
'501':
407+
description: Not implemented
408+
/api/v1/wca/apikey/:
446409
get:
447410
operationId: wca_api_key_get
448411
summary: Get WCA key for an Organisation
@@ -467,6 +430,8 @@ paths:
467430
description: Request was throttled
468431
'500':
469432
description: Internal service error
433+
'501':
434+
description: Not implemented
470435
post:
471436
operationId: wca_api_key_set
472437
summary: Set the WCA key for an Organisation
@@ -509,6 +474,8 @@ paths:
509474
description: Request was throttled
510475
'500':
511476
description: Internal service error
477+
'501':
478+
description: Not implemented
512479
delete:
513480
operationId: wca_api_key_delete
514481
summary: DELETE WCA key for an Organization
@@ -533,7 +500,9 @@ paths:
533500
description: Request was throttled
534501
'500':
535502
description: Internal service error
536-
/api/v0/wca/apikey/test/:
503+
'501':
504+
description: Not implemented
505+
/api/v1/wca/apikey/test/:
537506
get:
538507
operationId: wca_api_key_validator_get
539508
summary: Validate WCA key for an Organisation
@@ -556,7 +525,9 @@ paths:
556525
description: Request was throttled
557526
'500':
558527
description: Internal service error
559-
/api/v0/wca/modelid/:
528+
'501':
529+
description: Not implemented
530+
/api/v1/wca/modelid/:
560531
get:
561532
operationId: wca_model_id_get
562533
summary: Get WCA Model Id for an Organisation
@@ -580,6 +551,8 @@ paths:
580551
description: Request was throttled
581552
'500':
582553
description: Internal service error
554+
'501':
555+
description: Not implemented
583556
post:
584557
operationId: wca_model_id_set
585558
summary: Set the Model Id to be used for an Organisation
@@ -621,7 +594,9 @@ paths:
621594
description: Request was throttled
622595
'500':
623596
description: Internal service error
624-
/api/v0/wca/modelid/test/:
597+
'501':
598+
description: Not implemented
599+
/api/v1/wca/modelid/test/:
625600
get:
626601
operationId: wca_model_id_validator_get
627602
summary: Validate WCA Model Id for an Organisation
@@ -644,6 +619,8 @@ paths:
644619
description: Request was throttled
645620
'500':
646621
description: Internal service error
622+
'501':
623+
description: Not implemented
647624
/check/:
648625
get:
649626
operationId: check_retrieve

0 commit comments

Comments
 (0)