-
Notifications
You must be signed in to change notification settings - Fork 0
/
ords-rest_schema.xml
190 lines (164 loc) · 5.63 KB
/
ords-rest_schema.xml
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:n0="http://www.oracle.com/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<changeSet id="adb3e29f6aa3b4a7e27d5a7c1454dd95000792b9" author="(PRICEADMIN)-Generated" failOnError="false" >
<n0:runOracleScript objectName="SCRIPT" objectType="ORDS" ownerName="PRICEADMIN" sourceType="STRING" >
<n0:source><![CDATA[
-- Generated by ORDS REST Data Services 22.3.0.r2781755
-- Schema: PRICEADMIN Date: Tue Oct 25 08:10:06 2022
--
DECLARE
l_roles OWA.VC_ARR;
l_modules OWA.VC_ARR;
l_patterns OWA.VC_ARR;
BEGIN
ORDS.ENABLE_SCHEMA(
p_enabled => TRUE,
p_schema => 'PRICEADMIN',
p_url_mapping_type => 'BASE_PATH',
p_url_mapping_pattern => 'priceadmin',
p_auto_rest_auth => FALSE);
ORDS.DEFINE_MODULE(
p_module_name => 'options',
p_base_path => '/options/',
p_items_per_page => 25,
p_status => 'PUBLISHED',
p_comments => NULL);
ORDS.DEFINE_TEMPLATE(
p_module_name => 'options',
p_pattern => 'free',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => 'options',
p_pattern => 'free',
p_method => 'GET',
p_source_type => 'json/collection',
p_mimes_allowed => NULL,
p_comments => NULL,
p_source =>
'select * from options where tier=''FREE''');
ORDS.DEFINE_TEMPLATE(
p_module_name => 'options',
p_pattern => 'enterprise',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => 'options',
p_pattern => 'enterprise',
p_method => 'GET',
p_source_type => 'json/collection',
p_mimes_allowed => NULL,
p_comments => NULL,
p_source =>
'select * from options where tier=''ENTERPRISE''');
ORDS.DEFINE_TEMPLATE(
p_module_name => 'options',
p_pattern => 'pro',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => 'options',
p_pattern => 'pro',
p_method => 'GET',
p_source_type => 'json/collection',
p_mimes_allowed => NULL,
p_comments => NULL,
p_source =>
'select * from options where tier=''PRO''');
ORDS.DEFINE_MODULE(
p_module_name => 'prices',
p_base_path => '/price/',
p_items_per_page => 25,
p_status => 'PUBLISHED',
p_comments => NULL);
ORDS.DEFINE_TEMPLATE(
p_module_name => 'prices',
p_pattern => 'free',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => 'prices',
p_pattern => 'free',
p_method => 'GET',
p_source_type => 'json/collection',
p_mimes_allowed => NULL,
p_comments => NULL,
p_source =>
'select * from price where tier=''FREE''');
ORDS.DEFINE_TEMPLATE(
p_module_name => 'prices',
p_pattern => 'pro',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => 'prices',
p_pattern => 'pro',
p_method => 'GET',
p_source_type => 'json/collection',
p_mimes_allowed => NULL,
p_comments => NULL,
p_source =>
'select * from price where tier=''PRO''');
ORDS.DEFINE_TEMPLATE(
p_module_name => 'prices',
p_pattern => 'enterprise',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => 'prices',
p_pattern => 'enterprise',
p_method => 'GET',
p_source_type => 'json/collection',
p_mimes_allowed => NULL,
p_comments => NULL,
p_source =>
'select * from price where tier=''ENTERPRISE''');
ORDS.CREATE_ROLE(p_role_name => 'oracle.dbtools.role.autorest.PRICEADMIN');
l_roles(1) := 'oracle.dbtools.autorest.any.schema';
l_roles(2) := 'oracle.dbtools.role.autorest.PRICEADMIN';
ORDS.DEFINE_PRIVILEGE(
p_privilege_name => 'oracle.dbtools.autorest.privilege.PRICEADMIN',
p_roles => l_roles,
p_patterns => l_patterns,
p_modules => l_modules,
p_label => NULL,
p_description => NULL,
p_comments => NULL);
l_roles.DELETE;
l_modules.DELETE;
l_patterns.DELETE;
l_roles(1) := 'SODA Developer';
l_patterns(1) := '/soda/*';
ORDS.DEFINE_PRIVILEGE(
p_privilege_name => 'oracle.soda.privilege.developer',
p_roles => l_roles,
p_patterns => l_patterns,
p_modules => l_modules,
p_label => NULL,
p_description => NULL,
p_comments => NULL);
l_roles.DELETE;
l_modules.DELETE;
l_patterns.DELETE;
COMMIT;
END;]]></n0:source>
</n0:runOracleScript>
</changeSet>
</databaseChangeLog>