Add rules routes

This commit is contained in:
2024-01-24 11:03:08 +01:00
parent 0247413a10
commit 57722116d6
5 changed files with 180 additions and 70 deletions

View File

@ -101,32 +101,6 @@ const docTemplate = `{
}
}
},
"/api/rules": {
"get": {
"description": "Get a list of all available hostname generation rules.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Rules"
],
"summary": "List Available Rules",
"responses": {
"200": {
"description": "List of available rules with descriptions",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/server": {
"put": {
"security": [
@ -286,6 +260,51 @@ const docTemplate = `{
}
}
},
"/rules": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Return a list of names of Rules which are known in the RulesRegistry",
"produces": [
"application/json"
],
"tags": [
"Querying Rules"
],
"summary": "Returns a list of available rules",
"operationId": "get-rules",
"responses": {}
}
},
"/rules/:rule": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Returns two obea an Input Object and an Output Object\ndescribing the Rules stored values and required parameters",
"produces": [
"application/json"
],
"tags": [
"Querying Rules"
],
"summary": "Returns details about a rule",
"operationId": "get-rule-details",
"responses": {
"200": {
"description": "Hostname",
"schema": {
"$ref": "#/definitions/models.SimpleHostnameResponse"
}
}
}
}
},
"/{category}": {
"get": {
"security": [

View File

@ -95,32 +95,6 @@
}
}
},
"/api/rules": {
"get": {
"description": "Get a list of all available hostname generation rules.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Rules"
],
"summary": "List Available Rules",
"responses": {
"200": {
"description": "List of available rules with descriptions",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/server": {
"put": {
"security": [
@ -280,6 +254,51 @@
}
}
},
"/rules": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Return a list of names of Rules which are known in the RulesRegistry",
"produces": [
"application/json"
],
"tags": [
"Querying Rules"
],
"summary": "Returns a list of available rules",
"operationId": "get-rules",
"responses": {}
}
},
"/rules/:rule": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Returns two obea an Input Object and an Output Object\ndescribing the Rules stored values and required parameters",
"produces": [
"application/json"
],
"tags": [
"Querying Rules"
],
"summary": "Returns details about a rule",
"operationId": "get-rule-details",
"responses": {
"200": {
"description": "Hostname",
"schema": {
"$ref": "#/definitions/models.SimpleHostnameResponse"
}
}
}
}
},
"/{category}": {
"get": {
"security": [

View File

@ -212,23 +212,6 @@ paths:
summary: Update hostname for category "notebook"
tags:
- Manipulate existing Hostnames
/api/rules:
get:
consumes:
- application/json
description: Get a list of all available hostname generation rules.
produces:
- application/json
responses:
"200":
description: List of available rules with descriptions
schema:
additionalProperties:
type: string
type: object
summary: List Available Rules
tags:
- Rules
/api/server:
post:
consumes:
@ -330,6 +313,36 @@ paths:
summary: User login
tags:
- Authentication
/rules:
get:
description: Return a list of names of Rules which are known in the RulesRegistry
operationId: get-rules
produces:
- application/json
responses: {}
security:
- Bearer: []
summary: Returns a list of available rules
tags:
- Querying Rules
/rules/:rule:
get:
description: |-
Returns two obea an Input Object and an Output Object
describing the Rules stored values and required parameters
operationId: get-rule-details
produces:
- application/json
responses:
"200":
description: Hostname
schema:
$ref: '#/definitions/models.SimpleHostnameResponse'
security:
- Bearer: []
summary: Returns details about a rule
tags:
- Querying Rules
securityDefinitions:
Bearer:
description: Type "Bearer" followed by a space and JWT token.