Merge "Minor bugs fix in ORU-app simulator" into e-release
[nonrtric.git] / dmaap-mediator-producer / api / docs.go
1 // Package api GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
2 // This file was generated by swaggo/swag
3 package api
4
5 import (
6         "bytes"
7         "encoding/json"
8         "strings"
9         "text/template"
10
11         "github.com/swaggo/swag"
12 )
13
14 var doc = `{
15     "schemes": {{ marshal .Schemes }},
16     "swagger": "2.0",
17     "info": {
18         "description": "{{escape .Description}}",
19         "title": "{{.Title}}",
20         "contact": {},
21         "license": {
22             "name": "Apache 2.0",
23             "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
24         },
25         "version": "{{.Version}}"
26     },
27     "host": "{{.Host}}",
28     "basePath": "{{.BasePath}}",
29     "paths": {
30         "/admin/log": {
31             "put": {
32                 "description": "Set the log level of the producer.",
33                 "tags": [
34                     "Admin"
35                 ],
36                 "summary": "Set log level",
37                 "parameters": [
38                     {
39                         "enum": [
40                             "Error",
41                             "Warn",
42                             "Info",
43                             "Debug"
44                         ],
45                         "type": "string",
46                         "description": "string enums",
47                         "name": "level",
48                         "in": "query"
49                     }
50                 ],
51                 "responses": {
52                     "200": {
53                         "description": ""
54                     },
55                     "400": {
56                         "description": "Problem as defined in https://tools.ietf.org/html/rfc7807",
57                         "schema": {
58                             "$ref": "#/definitions/ErrorInfo"
59                         },
60                         "headers": {
61                             "Content-Type": {
62                                 "type": "string",
63                                 "description": "application/problem+json"
64                             }
65                         }
66                     }
67                 }
68             }
69         },
70         "/health_check": {
71             "get": {
72                 "description": "Get the status of the producer. Will show if the producer has registered in ICS.",
73                 "produces": [
74                     "application/json"
75                 ],
76                 "tags": [
77                     "Data producer (callbacks)"
78                 ],
79                 "summary": "Get status",
80                 "responses": {
81                     "200": {
82                         "description": "OK",
83                         "schema": {
84                             "$ref": "#/definitions/"
85                         }
86                     }
87                 }
88             }
89         },
90         "/info_job": {
91             "post": {
92                 "description": "Callback for ICS to add an info job",
93                 "consumes": [
94                     "application/json"
95                 ],
96                 "tags": [
97                     "Data producer (callbacks)"
98                 ],
99                 "summary": "Add info job",
100                 "parameters": [
101                     {
102                         "description": "Info job data",
103                         "name": "user",
104                         "in": "body",
105                         "required": true,
106                         "schema": {
107                             "$ref": "#/definitions/JobInfo"
108                         }
109                     }
110                 ],
111                 "responses": {
112                     "200": {
113                         "description": ""
114                     },
115                     "400": {
116                         "description": "Problem as defined in https://tools.ietf.org/html/rfc7807",
117                         "schema": {
118                             "$ref": "#/definitions/ErrorInfo"
119                         },
120                         "headers": {
121                             "Content-Type": {
122                                 "type": "string",
123                                 "description": "application/problem+json"
124                             }
125                         }
126                     }
127                 }
128             }
129         },
130         "/info_job/{infoJobId}": {
131             "delete": {
132                 "description": "Callback for ICS to delete an info job",
133                 "tags": [
134                     "Data producer (callbacks)"
135                 ],
136                 "summary": "Delete info job",
137                 "parameters": [
138                     {
139                         "type": "string",
140                         "description": "Info job ID",
141                         "name": "infoJobId",
142                         "in": "path",
143                         "required": true
144                     }
145                 ],
146                 "responses": {
147                     "200": {
148                         "description": ""
149                     }
150                 }
151             }
152         },
153         "/swagger": {
154             "get": {
155                 "description": "Get the Swagger API documentation for the producer.",
156                 "tags": [
157                     "Admin"
158                 ],
159                 "summary": "Get Swagger Documentation",
160                 "responses": {
161                     "200": {
162                         "description": ""
163                     }
164                 }
165             }
166         }
167     },
168     "definitions": {
169         "": {
170             "type": "object",
171             "properties": {
172                 "registeredStatus": {
173                     "description": "The registration status of the producer in Information Coordinator Service. Either ` + "`" + `registered` + "`" + ` or ` + "`" + `not registered` + "`" + `",
174                     "type": "string",
175                     "example": "registered"
176                 }
177             }
178         },
179         "BufferTimeout": {
180             "type": "object",
181             "properties": {
182                 "maxSize": {
183                     "type": "integer"
184                 },
185                 "maxTimeMiliseconds": {
186                     "type": "integer"
187                 }
188             }
189         },
190         "ErrorInfo": {
191             "type": "object",
192             "properties": {
193                 "detail": {
194                     "description": "A human-readable explanation specific to this occurrence of the problem.",
195                     "type": "string",
196                     "example": "Info job type not found"
197                 },
198                 "instance": {
199                     "description": "A URI reference that identifies the specific occurrence of the problem.",
200                     "type": "string"
201                 },
202                 "status": {
203                     "description": "The HTTP status code generated by the origin server for this occurrence of the problem.",
204                     "type": "integer",
205                     "example": 400
206                 },
207                 "title": {
208                     "description": "A short, human-readable summary of the problem type.",
209                     "type": "string"
210                 },
211                 "type": {
212                     "description": "A URI reference that identifies the problem type.",
213                     "type": "string"
214                 }
215             }
216         },
217         "JobInfo": {
218             "type": "object",
219             "properties": {
220                 "info_job_data": {
221                     "$ref": "#/definitions/Parameters"
222                 },
223                 "info_job_identity": {
224                     "type": "string"
225                 },
226                 "info_type_identity": {
227                     "type": "string"
228                 },
229                 "last_updated": {
230                     "type": "string"
231                 },
232                 "owner": {
233                     "type": "string"
234                 },
235                 "target_uri": {
236                     "type": "string"
237                 }
238             }
239         },
240         "Parameters": {
241             "type": "object",
242             "properties": {
243                 "bufferTimeout": {
244                     "$ref": "#/definitions/BufferTimeout"
245                 }
246             }
247         }
248     }
249 }`
250
251 type swaggerInfo struct {
252         Version     string
253         Host        string
254         BasePath    string
255         Schemes     []string
256         Title       string
257         Description string
258 }
259
260 // SwaggerInfo holds exported Swagger Info so clients can modify it
261 var SwaggerInfo = swaggerInfo{
262         Version:     "1.1.0",
263         Host:        "",
264         BasePath:    "",
265         Schemes:     []string{},
266         Title:       "DMaaP Mediator Producer",
267         Description: "",
268 }
269
270 type s struct{}
271
272 func (s *s) ReadDoc() string {
273         sInfo := SwaggerInfo
274         sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
275
276         t, err := template.New("swagger_info").Funcs(template.FuncMap{
277                 "marshal": func(v interface{}) string {
278                         a, _ := json.Marshal(v)
279                         return string(a)
280                 },
281                 "escape": func(v interface{}) string {
282                         // escape tabs
283                         str := strings.Replace(v.(string), "\t", "\\t", -1)
284                         // replace " with \", and if that results in \\", replace that with \\\"
285                         str = strings.Replace(str, "\"", "\\\"", -1)
286                         return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
287                 },
288         }).Parse(doc)
289         if err != nil {
290                 return doc
291         }
292
293         var tpl bytes.Buffer
294         if err := t.Execute(&tpl, sInfo); err != nil {
295                 return doc
296         }
297
298         return tpl.String()
299 }
300
301 func init() {
302         swag.Register("swagger", &s{})
303 }