We have a requirement where we need to send .avro file as an input request to our API's. Really stuck at this point. If any detail example provided would be more appreciated.
Just use Java interop: https://github.com/intuit/karate#calling-java
You need to write a helper (start with a static method) to convert JSON to Avro and vice versa. I know teams using this for gRPC. Read this thread for tips: https://github.com/intuit/karate/issues/412
Also there is even a "karate-grpc" project: https://github.com/pecker-io/karate-grpc
Also see:
https://twitter.com/KarateDSL/status/1128170638223364097
https://twitter.com/KarateDSL/status/1417023536082812935
Related
i'm writing to you to ask a little support about an action that we are currently developing using Action Builder and webhook library #assistant/conversation for Nodejs.
In particular, we would invoke our webhook's logic using the device location.
We have understand that we must ask the user permission to access on device location using something like this:
https://developers.google.com/assistant/actionssdk/reference/rest/Shared.Types/PermissionValueSpec
but in all Github examples provided by Google nothing is specified.
Furthermore, we tried to integrate the PermissionValueSpec in a slot using the notification actions.type.Notifications, but the returned value of that slot is
PermissionLocation --> ALREADY_GRANTED without any other information about the device coordinates.
We've read a lot of documentation and also looked for some example to support our develop but nothing was found.
How we can get the current device location?
Thank you in advance!
I have an in-memory TinkerGraph. I want to write a Spring Boot REST controller to expose a serialized (as GraphML) representation of this Tinkergraph. The serialization APIs (g.io) needs a String filepath to be passed to it. Currently I am having to write to a /tmp file and then read the file to get a String representation of the serialized GraphML.
Is there a way to directly get a String output of the serialized GraphML? Without having to write into a tmp file and read it back in?
g.io("graph.xml").write().iterate()
As of the current latest release 3.4.2, I'm afraid that there is no way to do it with the Gremlin language. The reason it only writes to a file and not to something like an Java OutputStream is that the io() step is meant to be programming language agnostic. Python and other languages off the JVM have no way to construct or specify such an object so writing to file makes it work across the board. I don't know if that will change in the future, unless we came up with a reasonable API that would work intuitively across programming languages.
Since you are using an in-memory TinkerGraph you could bypass Gremlin and got back to the very old way of doing things:
Graph graph = TinkerFactory.createModern();
try (OutputStream os = new FileOutputStream("tinkerpop-modern.xml")) {
graph.io(IoCore.graphml()).writer().normalize(true).create().writeGraph(os, graph);
}
You would just replace the FileOutputStream with whatever kind of OutputStream you wanted to use. This approach uses the old Graph API which I think is just deprecated in newer versions, so the option should still be available to you. Note that if you are not on the JVM the only way to do return a String would be by submitting a Gremlin script to Gremlin Server.
Tinkerpop 2 used to support user-defined step through Gremlin.defineStep(..)
How can I achieve the same using Tinkerpop 3 ?
Is there any Gremlin API to create a custom step and combine a set of traversal steps ?
Any suggestion will be highly appreciated.
Thanks
Kaniska
Patterns for DSL development are not completely established for TinkerPop 3.x, so expect some changes in advice as time progresses. There is surrounding information on this on the gremlin-users mailing list.
If you are using Gremlin Server (or can incorporate Groovy into your project) I don't see a reason to not just do some groovy metaprogramming to get this to work. Using the standard Gremlin Server zip distribution edit the generate-modern.groovy file to include this line at the start:
GraphTraversal.metaClass.knows = { delegate.out('knows') }
then start the server with:
bin/gremlin-server.sh conf/gremlin-server-rest-modern.yaml
Then a simple curl:
$ curl "http://localhost:8182?gremlin=g.V(1).knows().values('name')"
{"requestId":"66c2c929-9cc2-491d-acb0-ae4d7eef6b00","status":{"message":"","code":200,"attributes":{}},"result":{"data":["vadas","josh"],"meta":{}}}
If you have a complex DSL you might not want all that logic trapped in a groovy script. Easy enough - just build a standard groovy project, construct a jar, include some form of static initializer to call your metaprogramming code and place it on Gremlin Server's path. then your init script just needs to call that static initializer and your DSL is loaded.
I have an R package that I would like to host through Amazon Web Services that will be accessible via an API. The script should take a couple of input values and return the R output in json format. Also, the API should be able to handle multiple requests simultaneously.
So for example, call http://sampleapi.com/?location=USA?state=Florida. That would then run the R package and return the output data to the calling application.
Has anyone done this before or know of resources you can point me to that would explain how to do so? Thanks!
Thanks for all the suggestions. I decided to use Ruby for the API with the rinruby and rails-api gems and will host that through AWS Elastic Beanstalk. See this question for how I am setting it up - Ruby API - Accept parameters and execute script
I am implementing S4U protocol using GSS in java. Since java 7 does not support this protocol, I plan to write a JNI wrapper over the gss api methods in C that do not have equivalent in java.
As part of this I am writing a JNI over gss_acquire_cred_impersonate_name as described in
http://k5wiki.kerberos.org/wiki/Projects/Services4User#gss_acquire_cred_impersonate_name .
This method takes an previously populated input credential handle (gss_cred_id_t) and populates an output credential handle. In my java code I have a GSSCredential created which I need to pass to C function in form of gss_cred_id_t and convert the output credential handle from gss_cred_id_t back to GSSCredential for further use.
How can I export GSSCredential object to byte array and vice versa in order to communicate with the C function ?
Thanks
You should rather Java 8 code, it has built-in support.
Export cred us a custom extension for GSS-API and therefore not available. The Globus JGSS implementation support this extension.
When I had a similar problem I used https://github.com/cconlon/kerberos-java-gssapi and did all my GSS-API work though the wrapper. (But that was only a temporary stage before discarding Java altogether.)