Skip to content

Commit b38245e

Browse files
authored
Merge pull request linuxfoundation#10 from linuxfoundation/jme/LFXV2-321
do not generate spec for /livez or /readyz
2 parents 0cc6d05 + 063b69c commit b38245e

File tree

5 files changed

+23
-166
lines changed

5 files changed

+23
-166
lines changed

design/query-svc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ var _ = dsl.Service("query-svc", func() {
8787

8888
dsl.Method("readyz", func() {
8989
dsl.Description("Check if the service is able to take inbound requests.")
90+
dsl.Meta("swagger:generate", "false")
9091
dsl.Result(dsl.Bytes, func() {
9192
dsl.Example("OK")
9293
})
@@ -106,6 +107,7 @@ var _ = dsl.Service("query-svc", func() {
106107

107108
dsl.Method("livez", func() {
108109
dsl.Description("Check if the service is alive.")
110+
dsl.Meta("swagger:generate", "false")
109111
dsl.Result(dsl.Bytes, func() {
110112
dsl.Example("OK")
111113
})

gen/http/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"swagger":"2.0","info":{"title":"LFX V2 - Query Service","description":"Query indexed resources","version":"0.0.1"},"host":"localhost:80","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/_query/openapi.json":{"get":{"tags":["query-svc"],"summary":"Download gen/http/openapi.json","operationId":"query-svc#/_query/openapi.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/_query/openapi.yaml":{"get":{"tags":["query-svc"],"summary":"Download gen/http/openapi.yaml","operationId":"query-svc#/_query/openapi.yaml","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/_query/openapi3.json":{"get":{"tags":["query-svc"],"summary":"Download gen/http/openapi3.json","operationId":"query-svc#/_query/openapi3.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/_query/openapi3.yaml":{"get":{"tags":["query-svc"],"summary":"Download gen/http/openapi3.yaml","operationId":"query-svc#/_query/openapi3.yaml","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/livez":{"get":{"tags":["query-svc"],"summary":"livez query-svc","description":"Check if the service is alive.","operationId":"query-svc#livez","produces":["text/plain"],"responses":{"200":{"description":"OK response.","schema":{"type":"string","format":"byte"}}},"schemes":["http"]}},"/query/resources":{"get":{"tags":["query-svc"],"summary":"query-resources query-svc","description":"Locate resources by their type or parent, or use typeahead search to query resources by a display name or similar alias.","operationId":"query-svc#query-resources","parameters":[{"name":"v","in":"query","description":"Version of the API","required":true,"type":"string","enum":["1"]},{"name":"name","in":"query","description":"Resource name or alias; supports typeahead","required":false,"type":"string","minLength":1},{"name":"parent","in":"query","description":"Parent (for navigation; varies by object type)","required":false,"type":"string","pattern":"^[a-zA-Z]+:[a-zA-Z0-9_-]+$"},{"name":"type","in":"query","description":"Resource type to search","required":false,"type":"string"},{"name":"tags","in":"query","description":"Tags to search (varies by object type)","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"sort","in":"query","description":"Sort order for results","required":false,"type":"string","default":"name_asc","enum":["name_asc","name_desc","updated_asc","updated_desc"]},{"name":"page_token","in":"query","description":"Opaque token for pagination","required":false,"type":"string"},{"name":"Authorization","in":"header","description":"JWT token issued by Heimdall","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/QuerySvcQueryResourcesResponseBody","required":["resources"]},"headers":{"Cache-Control":{"description":"Cache control header","type":"string"}}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/BadRequestError","required":["message"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/InternalServerError","required":["message"]}},"503":{"description":"Service Unavailable response.","schema":{"$ref":"#/definitions/ServiceUnavailableError","required":["message"]}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/readyz":{"get":{"tags":["query-svc"],"summary":"readyz query-svc","description":"Check if the service is able to take inbound requests.","operationId":"query-svc#readyz","produces":["text/plain"],"responses":{"200":{"description":"OK response.","schema":{"type":"string","format":"byte"}},"503":{"description":"Service Unavailable response.","schema":{"$ref":"#/definitions/QuerySvcReadyzNotReadyResponseBody"}}},"schemes":["http"]}}},"definitions":{"BadRequestError":{"title":"BadRequestError","type":"object","properties":{"message":{"type":"string","description":"Error message","example":"The request was invalid."}},"description":"Bad request","example":{"message":"The request was invalid."},"required":["message"]},"InternalServerError":{"title":"InternalServerError","type":"object","properties":{"message":{"type":"string","description":"Error message","example":"An internal server error occurred."}},"description":"Internal server error","example":{"message":"An internal server error occurred."},"required":["message"]},"QuerySvcQueryResourcesResponseBody":{"title":"QuerySvcQueryResourcesResponseBody","type":"object","properties":{"page_token":{"type":"string","description":"Opaque token if more results are available","example":"****"},"resources":{"type":"array","items":{"$ref":"#/definitions/Resource"},"description":"Resources found","example":[{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"},{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"}]}},"example":{"page_token":"****","resources":[{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"},{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"},{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"},{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"}]},"required":["resources"]},"QuerySvcReadyzNotReadyResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Service is not ready yet (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"Resource":{"title":"Resource","type":"object","properties":{"data":{"description":"Resource data snapshot","example":{"id":"123","name":"My committee","description":"a committee"}},"id":{"type":"string","description":"Resource ID (within its resource collection)","example":"123"},"type":{"type":"string","description":"Resource type","example":"committee"}},"description":"A resource is a universal representation of an LFX API resource for indexing.","example":{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"}},"ServiceUnavailableError":{"title":"ServiceUnavailableError","type":"object","properties":{"message":{"type":"string","description":"Error message","example":"The service is unavailable."}},"description":"Service unavailable","example":{"message":"The service is unavailable."},"required":["message"]}},"securityDefinitions":{"jwt_header_Authorization":{"type":"apiKey","description":"Heimdall authorization","name":"Authorization","in":"header"}}}
1+
{"swagger":"2.0","info":{"title":"LFX V2 - Query Service","description":"Query indexed resources","version":"0.0.1"},"host":"localhost:80","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/_query/openapi.json":{"get":{"tags":["query-svc"],"summary":"Download gen/http/openapi.json","operationId":"query-svc#/_query/openapi.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/_query/openapi.yaml":{"get":{"tags":["query-svc"],"summary":"Download gen/http/openapi.yaml","operationId":"query-svc#/_query/openapi.yaml","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/_query/openapi3.json":{"get":{"tags":["query-svc"],"summary":"Download gen/http/openapi3.json","operationId":"query-svc#/_query/openapi3.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/_query/openapi3.yaml":{"get":{"tags":["query-svc"],"summary":"Download gen/http/openapi3.yaml","operationId":"query-svc#/_query/openapi3.yaml","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/query/resources":{"get":{"tags":["query-svc"],"summary":"query-resources query-svc","description":"Locate resources by their type or parent, or use typeahead search to query resources by a display name or similar alias.","operationId":"query-svc#query-resources","parameters":[{"name":"v","in":"query","description":"Version of the API","required":true,"type":"string","enum":["1"]},{"name":"name","in":"query","description":"Resource name or alias; supports typeahead","required":false,"type":"string","minLength":1},{"name":"parent","in":"query","description":"Parent (for navigation; varies by object type)","required":false,"type":"string","pattern":"^[a-zA-Z]+:[a-zA-Z0-9_-]+$"},{"name":"type","in":"query","description":"Resource type to search","required":false,"type":"string"},{"name":"tags","in":"query","description":"Tags to search (varies by object type)","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"sort","in":"query","description":"Sort order for results","required":false,"type":"string","default":"name_asc","enum":["name_asc","name_desc","updated_asc","updated_desc"]},{"name":"page_token","in":"query","description":"Opaque token for pagination","required":false,"type":"string"},{"name":"Authorization","in":"header","description":"JWT token issued by Heimdall","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/QuerySvcQueryResourcesResponseBody","required":["resources"]},"headers":{"Cache-Control":{"description":"Cache control header","type":"string"}}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/BadRequestError","required":["message"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/InternalServerError","required":["message"]}},"503":{"description":"Service Unavailable response.","schema":{"$ref":"#/definitions/ServiceUnavailableError","required":["message"]}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}}},"definitions":{"BadRequestError":{"title":"BadRequestError","type":"object","properties":{"message":{"type":"string","description":"Error message","example":"The request was invalid."}},"description":"Bad request","example":{"message":"The request was invalid."},"required":["message"]},"InternalServerError":{"title":"InternalServerError","type":"object","properties":{"message":{"type":"string","description":"Error message","example":"An internal server error occurred."}},"description":"Internal server error","example":{"message":"An internal server error occurred."},"required":["message"]},"QuerySvcQueryResourcesResponseBody":{"title":"QuerySvcQueryResourcesResponseBody","type":"object","properties":{"page_token":{"type":"string","description":"Opaque token if more results are available","example":"****"},"resources":{"type":"array","items":{"$ref":"#/definitions/Resource"},"description":"Resources found","example":[{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"},{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"}]}},"example":{"page_token":"****","resources":[{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"},{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"},{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"},{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"}]},"required":["resources"]},"Resource":{"title":"Resource","type":"object","properties":{"data":{"description":"Resource data snapshot","example":{"id":"123","name":"My committee","description":"a committee"}},"id":{"type":"string","description":"Resource ID (within its resource collection)","example":"123"},"type":{"type":"string","description":"Resource type","example":"committee"}},"description":"A resource is a universal representation of an LFX API resource for indexing.","example":{"data":{"id":"123","name":"My committee","description":"a committee"},"id":"123","type":"committee"}},"ServiceUnavailableError":{"title":"ServiceUnavailableError","type":"object","properties":{"message":{"type":"string","description":"Error message","example":"The service is unavailable."}},"description":"Service unavailable","example":{"message":"The service is unavailable."},"required":["message"]}},"securityDefinitions":{"jwt_header_Authorization":{"type":"apiKey","description":"Heimdall authorization","name":"Authorization","in":"header"}}}

gen/http/openapi.yaml

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,6 @@ paths:
6565
type: file
6666
schemes:
6767
- http
68-
/livez:
69-
get:
70-
tags:
71-
- query-svc
72-
summary: livez query-svc
73-
description: Check if the service is alive.
74-
operationId: query-svc#livez
75-
produces:
76-
- text/plain
77-
responses:
78-
"200":
79-
description: OK response.
80-
schema:
81-
type: string
82-
format: byte
83-
schemes:
84-
- http
8568
/query/resources:
8669
get:
8770
tags:
@@ -176,27 +159,6 @@ paths:
176159
- http
177160
security:
178161
- jwt_header_Authorization: []
179-
/readyz:
180-
get:
181-
tags:
182-
- query-svc
183-
summary: readyz query-svc
184-
description: Check if the service is able to take inbound requests.
185-
operationId: query-svc#readyz
186-
produces:
187-
- text/plain
188-
responses:
189-
"200":
190-
description: OK response.
191-
schema:
192-
type: string
193-
format: byte
194-
"503":
195-
description: Service Unavailable response.
196-
schema:
197-
$ref: '#/definitions/QuerySvcReadyzNotReadyResponseBody'
198-
schemes:
199-
- http
200162
definitions:
201163
BadRequestError:
202164
title: BadRequestError
@@ -279,49 +241,6 @@ definitions:
279241
type: committee
280242
required:
281243
- resources
282-
QuerySvcReadyzNotReadyResponseBody:
283-
title: 'Mediatype identifier: application/vnd.goa.error; view=default'
284-
type: object
285-
properties:
286-
fault:
287-
type: boolean
288-
description: Is the error a server-side fault?
289-
example: false
290-
id:
291-
type: string
292-
description: ID is a unique identifier for this particular occurrence of the problem.
293-
example: 123abc
294-
message:
295-
type: string
296-
description: Message is a human-readable explanation specific to this occurrence of the problem.
297-
example: parameter 'p' must be an integer
298-
name:
299-
type: string
300-
description: Name is the name of this class of errors.
301-
example: bad_request
302-
temporary:
303-
type: boolean
304-
description: Is the error temporary?
305-
example: true
306-
timeout:
307-
type: boolean
308-
description: Is the error a timeout?
309-
example: false
310-
description: Service is not ready yet (default view)
311-
example:
312-
fault: false
313-
id: 123abc
314-
message: parameter 'p' must be an integer
315-
name: bad_request
316-
temporary: true
317-
timeout: true
318-
required:
319-
- name
320-
- id
321-
- message
322-
- temporary
323-
- timeout
324-
- fault
325244
Resource:
326245
title: Resource
327246
type: object

0 commit comments

Comments
 (0)