[JBoss JIRA] (TEIID-4374) Procedure missing for an OData metadata request to a Swagger VDB
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-4374?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-4374:
-------------------------------------
> are you saying I should create a wrapper that includes the parameters and the body? What are the semantics for this?
No, with simple parameters Teiid will do necessary conversions to call the Swagger service. As a user you need focus on the executing with SQL interface exposed. Only in the case where BODY parameter is projected as CLOB, then you would need to build the target input document according to the Swagger schema defined then pass through the SQL interface.
> How would you distinguish between path and query parameters?
You don't, Teiid is providing a abstraction layer to swagger service in relational database terms, in this case as a stored procedure.
> Is it then the responsibility of your code (the Swagger translator)
Yes, it is swagger translator which converts to final form.
>the Teiid OData interface code to unwrap this?
OData interface is built on top of the SQL interface exposed by Teiid. If the procedure is exposed as "Action", then it is ALWAYS a POST call. Then you need to follow the metadata of the OData interface to execute that call. With the POST the only way to send parameters is in BODY. But do not confuse this with Swagger service definition, you need to follow the OData metadata here. If this is exposed as "Function" then it is GET call.
> Procedure missing for an OData metadata request to a Swagger VDB
> ----------------------------------------------------------------
>
> Key: TEIID-4374
> URL: https://issues.jboss.org/browse/TEIID-4374
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.0, 9.0.1, 9.0.2
> Environment: Windows 10 Pro x64
> Java 8
> Reporter: Van Dillon
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 9.1
>
> Attachments: resource-adapter-rhq.xml, rhq-metadata.xml, rhq-vdb.xml, swagger.json
>
>
> When a REST PUT path defined in Swagger has a path parameter and a body it does not appear in OData metadata.
> See the attached swagger.json for an example. The operation 'executeOperation' does not appear in OData metadata.
> The code that determines if a procedure is allowed is in:
> org.teiid.olingo.service.ODataSchemaBuilder.allowedProcedure()
> The comment seems to indicate that as long as there is only a single LOB, multiple 'in' parameters are allowed. But the actual code does not allow any other 'in' parameters if there is a LOB parameter.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 7 months
[JBoss JIRA] (TEIID-4374) Procedure missing for an OData metadata request to a Swagger VDB
by Van Dillon (JIRA)
[ https://issues.jboss.org/browse/TEIID-4374?page=com.atlassian.jira.plugin... ]
Van Dillon edited comment on TEIID-4374 at 8/13/16 12:47 PM:
-------------------------------------------------------------
Thanks for the help on this Ramesh. I suspected this wasn't a really bug. But I thought someone probably had a workaround.
I'm not sure I fully understand the workaround you mention. If I'm trying to use an existing REST service (like RHQ) that has PUT operations with both input parameters (path, query, a mix) and a body (like the executeOperation operation); are you saying I should create a wrapper that includes the parameters and the body? What are the semantics for this? Do you just include the parameters as:
[parameter name]=value
How would you distinguish between path and query parameters? Is it then the responsibility of your code (the Swagger translator) or the Teiid OData interface code to unwrap this? Or does the OData implementation know how to unwrap it?
The new dependency on apache.common.io comes from SwaggerParser. If you call read(String), it uses Swagger20Parser to load the file with org.apache.commons.io.FileUtils.
was (Author: evdillon):
Thanks for the help on this Ramesh. I suspected this wasn't a really bug. But I thought someone probably had a workaround.
If we pass parameters in the body, is there any way to distinguish between path and query types?
The new dependency on apache.common.io comes from SwaggerParser. If you call read(String), it uses Swagger20Parser to load the file with org.apache.commons.io.FileUtils.
> Procedure missing for an OData metadata request to a Swagger VDB
> ----------------------------------------------------------------
>
> Key: TEIID-4374
> URL: https://issues.jboss.org/browse/TEIID-4374
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.0, 9.0.1, 9.0.2
> Environment: Windows 10 Pro x64
> Java 8
> Reporter: Van Dillon
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 9.1
>
> Attachments: resource-adapter-rhq.xml, rhq-metadata.xml, rhq-vdb.xml, swagger.json
>
>
> When a REST PUT path defined in Swagger has a path parameter and a body it does not appear in OData metadata.
> See the attached swagger.json for an example. The operation 'executeOperation' does not appear in OData metadata.
> The code that determines if a procedure is allowed is in:
> org.teiid.olingo.service.ODataSchemaBuilder.allowedProcedure()
> The comment seems to indicate that as long as there is only a single LOB, multiple 'in' parameters are allowed. But the actual code does not allow any other 'in' parameters if there is a LOB parameter.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 7 months
[JBoss JIRA] (TEIID-4374) Procedure missing for an OData metadata request to a Swagger VDB
by Van Dillon (JIRA)
[ https://issues.jboss.org/browse/TEIID-4374?page=com.atlassian.jira.plugin... ]
Van Dillon commented on TEIID-4374:
-----------------------------------
Thanks for the help on this Ramesh. I suspected this wasn't a really bug. But I thought someone probably had a workaround.
If we pass parameters in the body, is there any way to distinguish between path and query types?
The new dependency on apache.common.io comes from SwaggerParser. If you call read(String), it uses Swagger20Parser to load the file with org.apache.commons.io.FileUtils.
> Procedure missing for an OData metadata request to a Swagger VDB
> ----------------------------------------------------------------
>
> Key: TEIID-4374
> URL: https://issues.jboss.org/browse/TEIID-4374
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.0, 9.0.1, 9.0.2
> Environment: Windows 10 Pro x64
> Java 8
> Reporter: Van Dillon
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 9.1
>
> Attachments: resource-adapter-rhq.xml, rhq-metadata.xml, rhq-vdb.xml, swagger.json
>
>
> When a REST PUT path defined in Swagger has a path parameter and a body it does not appear in OData metadata.
> See the attached swagger.json for an example. The operation 'executeOperation' does not appear in OData metadata.
> The code that determines if a procedure is allowed is in:
> org.teiid.olingo.service.ODataSchemaBuilder.allowedProcedure()
> The comment seems to indicate that as long as there is only a single LOB, multiple 'in' parameters are allowed. But the actual code does not allow any other 'in' parameters if there is a LOB parameter.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 7 months
[JBoss JIRA] (TEIID-2578) add/remove schema elements
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2578?page=com.atlassian.jira.plugin... ]
Ramesh Reddy edited comment on TEIID-2578 at 8/13/16 11:05 AM:
---------------------------------------------------------------
The revised syntax would be
{code}
#create a data role
CREATE ROLE <data-role> [WITH JAAS ROLE <string>(,<string>)*]
#assign grants to data role
GRANT ( SELECT | INSERT | UPDATE | DELETE | EXECUTE | LANGUAGE | ALTER | DROP | ALL PRIVILEGES | TEMPORARY TABLES )
ON
(
DATABASE
TABLE <schema-name>.<table-name>
PROCEDURE <schema-name>.<proc-name>
SCHEMA <schema-name>
COLUMN <schema-name>.<table-name>.<col-name> [MASK [ORDER \d] <string-val> ] [CONDITION [CONSTRAINT] <string-val>]
)
TO <data-role-name>
{code}
was (Author: rareddy):
The revised syntax would be
{code}
#create a data role
CREATE ROLE <data-role> [WITH JAAS ROLE <string>(,<string>)*]
#assign grants to data role
GRANT ( SELECT | INSERT | UPDATE | DELETE | EXECUTE | LANGUAGE | ALTER | DROP | ALL PRIVILEGES | TEMP TABLES )
ON
(
DATABASE
TABLE <schema-name>.<table-name>
PROCEDURE <schema-name>.<proc-name>
SCHEMA <schema-name>
COLUMN <schema-name>.<table-name>.<col-name> [MASK [ORDER \d] <string-val> ] [CONDITION [CONSTRAINT] <string-val>]
)
TO <data-role-name>
{code}
> add/remove schema elements
> --------------------------
>
> Key: TEIID-2578
> URL: https://issues.jboss.org/browse/TEIID-2578
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Ramesh Reddy
> Assignee: Ramesh Reddy
> Fix For: 9.1
>
>
> Schemas are currently static after load. Modifications can only happen with restarts or new versions. We should allow add/drop at runtime.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 7 months
[JBoss JIRA] (TEIID-2578) add/remove schema elements
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2578?page=com.atlassian.jira.plugin... ]
Ramesh Reddy edited comment on TEIID-2578 at 8/13/16 10:12 AM:
---------------------------------------------------------------
The revised syntax would be
{code}
#create a data role
CREATE ROLE <data-role> [WITH JAAS ROLE <string>(,<string>)*]
#assign grants to data role
GRANT ( SELECT | INSERT | UPDATE | DELETE | EXECUTE | LANGUAGE | ALTER | DROP | ALL PRIVILEGES | TEMP TABLES )
ON
(
DATABASE
TABLE <schema-name>.<table-name>
PROCEDURE <schema-name>.<proc-name>
SCHEMA <schema-name>
COLUMN <schema-name>.<table-name>.<col-name> [MASK [ORDER \d] <string-val> ] [CONDITION [CONSTRAINT] <string-val>]
)
TO <data-role-name>
{code}
was (Author: rareddy):
The revised syntax would be
{code}
#create a data role
CREATE DATA ROLE <data-role> [WITH JAAS ROLE <string>(,<string>)*]
#assign grants to data role
GRANT ( SELECT | INSERT | UPDATE | DELETE | EXECUTE | LANGUAGE | ALTER | DROP | ALL PRIVILEGES | TEMP TABLES )
ON
(
DATABASE
TABLE <schema-name>.<table-name>
PROCEDURE <schema-name>.<proc-name>
SCHEMA <schema-name>
COLUMN <schema-name>.<table-name>.<col-name> [MASK [ORDER \d] <string-val> ] [CONDITION [CONSTRAINT] <string-val>]
)
TO <data-role-name>
{code}
> add/remove schema elements
> --------------------------
>
> Key: TEIID-2578
> URL: https://issues.jboss.org/browse/TEIID-2578
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Ramesh Reddy
> Assignee: Ramesh Reddy
> Fix For: 9.1
>
>
> Schemas are currently static after load. Modifications can only happen with restarts or new versions. We should allow add/drop at runtime.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 7 months