-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmdxreader.swagger.yaml
149 lines (129 loc) · 6.19 KB
/
mdxreader.swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
openapi: 3.0.0
info:
description: Runs a MDX query and returns the result, or forward the result to DbWebApi (for bulk insert/update) and then send a notification to somewhere.
version: 1.0.0
title: MDX Reader
contact:
name: PyWebApi
url: 'https://github.com/DataBooster/PyWebApi'
license:
name: MIT
url: 'https://github.com/DataBooster/PyWebApi/blob/master/LICENSE'
externalDocs:
url: 'https://github.com/DataBooster/PyWebApi#mdx-reader'
description: Wiki
tags:
- name: Main
paths:
/mdx_task.run_query:
post:
summary: Run a MDX query task.
operationId: run_query
description: |-
This function acts as an MDX query dispatcher:
1. It forwards an MDX query (received as JSON from the HTTP client) to a specified OLAP, and then convert the query result to the specified model;
2. (optional) Sends the above results to a database (DbWebApi) for storage or further processing;
3. (optional) Sends a notification about the final result or error.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/run_query'
description: Payload
responses:
"200":
description: Return the final results
content:
application/json:
schema:
type: object
"401":
$ref: '#/components/responses/Unauthorized'
default:
$ref: '#/components/responses/ServerError'
tags:
- Main
components:
responses:
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error-response'
ServerError:
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/error-response'
schemas:
run_query:
type: object
required:
- connection_string
- command_text
properties:
connection_string:
type: string
example: "Provider=MSOLAP;Data Source=The_OLAP;Initial Catalog=The_Cube;Integrated Security=SSPI;Format=Tabular;Connect Timeout=3600;"
description: The ADOMD connection string for the MDX query.
command_text:
type: string
example: WITH ... SELECT ... ON COLUMNS, ... ON ROWS FROM ... WHERE ...
description: The entire text of the MDX select query.
result_model:
type: string
default: DictOfList
example: SqlTvp
enum:
- ListOfList
- DictOfList
- ListOfDict
- SqlTvp
description: See <https://github.com/DataBooster/PyWebApi#mdx-reader> for details.
column_mapping:
type: object
default: {}
example: {"": "inTvp_ForSql", "Top 1% Avg": "Lev1Avg", "Useless Col4": ""}
description: |-
A mapping dictionary can be used to customize irregular column name mapping.
Mapping a column name to empty string (or None) - often used to indicate that column does not need to appear in the final rendering of data.
Special Note (to SQL Server stored procedure): A empty key in the map is used to specify the name of the table-valued parameter.
pass_result_to_url:
type: string
format: url
example: "http://dbwebapi.dev.com/sqldev/the_db.dbo.load_mdx_result"
description: Rather than just returning the MDX results to the HTTP client, this optional argument can be used to forward these result data directly to a database stored procedure for storage or further processing (the stored procedure is exposed as a URL through DbWebApi).
more_args:
type: object
default: {}
example: {"inAsOfDate": "2020-05-01", "inParam2": "test from Swagger UI"}
description: Other than above MDX result data, your stored procedure may require more input parameters. This more_args argument (a dictionary) allows you to prepare all other input parameters required by the stored procedure into the dictionary.
notify_url:
type: string
format: url
example: http://...(optional)
description: We may need to send a notification to somewhere when above process get completed or an error is encountered. This argument allows you to specify the URL of the notification destination (it must also be a RESTful service).
notify_args:
type: object
example: {}
description: |-
This is a JSON dictionary. In general, any items it carries will be passed to the notification service as input arguments. However, if we want to include detailed result data and/or error information in the notification, then what parameter name(s) does the notification service use to receive them? We make a convention to use two special keys in this dictionary to indicate these two particular parameter names:
'[=]' key - the value of this special key indicates the parameter name through which the notification service will receive detailed result data. (this is optional) If not specified, detailed result data will not be sent to the notification service;
'[!]' key - the value of this special key indicates the parameter name through which the notification service will receive detailed error information. (this is optional) If not specified, detailed error information will not be sent to the notification service; in this case, the notification itself cannot tell whether the process has completed successfully or encountered any errors, then the notification service may require some other channel to know whether the process succeeded or failed.
error-response:
type: object
required:
- ExceptionMessage
properties:
ExceptionMessage:
type: string
ExceptionType:
type: string
StackTrace:
type: string
servers:
- description: (Please update the local-test base URL to your actual path)
url: http://localhost/PyWebApi/pys/test_app/samples/mdxreader