go to post Eduard Lebedyuk · Jul 18, 2019 Sure csession {INSTANCE} -U{NAMESPACE} < {SCRIPT} Script contains code you want to execute, in your case the call to installer manifest. It could be a file or just the code itself. Example. A series of articles about automating CI/CD.
go to post Eduard Lebedyuk · Jul 17, 2019 Fixed some issues in REST, but you have license problem. ClassMethod CreateCoffee() As %Status { s json = {}.%FromJSON(%request.Data) s CoffeeProp = ##class(User.PropertyName).%New() s CoffeeProp.CoffeeName= json.CoffeeName s CoffeeProp.CoffeeColor=json.CoffeeColor s CoffeeProp.CoffeePrice= json.CoffeePrice s Status = CoffeeProp.%Save() }
go to post Eduard Lebedyuk · Jul 17, 2019 Use ccontrol qlist to get structured information about available instances.ccontrol qlist [<instance>] [nodisplay > outputfile]Display a quick list of information about all installed instances, in a format suitable for parsing in command scripts.The record for an instance contains fields separated by "^" (carats):Field 1: instance nameField 2: instance directoryField 3: version identifierField 4: current status for the instanceField 5: configuration file name last usedField 6: SuperServer port numberField 7: WebServer port numberField 8: JDBC Gateway port numberField 9: Instance status (e.g., ok, warn, alert)Field 10: Product name of the instanceField 11: Mirror Member Type (e.g., Failover, Disaster Recovery)Field 12: Mirror Status (e.g., Primary, Backup, Connected)
go to post Eduard Lebedyuk · Jul 17, 2019 How is it valid JSON?1. JSON accepts only double quotes. Single quotes are not valid.2. Property names must be quoted (in double quotes). error/txt are not quoted.Here's JSON standard.
go to post Eduard Lebedyuk · Jul 17, 2019 Should be If glo["ABC",type="K" Set restmode=0 /*except if a kill on ^ABC*/ Instead of If glo["^ABC",type="K" Set restmode=0 /*except if a kill on ^ABC*/
go to post Eduard Lebedyuk · Jul 17, 2019 Globals can't have duplicate keys.After I execute your code and call zw ^Data I get this output: ^Data("Athens")=7 ^Data("Boston")=3 ^Data("Cambridge")=1 ^Data("London")=4 ^Data("New York")=2
go to post Eduard Lebedyuk · Jul 17, 2019 Please post CROSRestAPI as text.Can you get InterSystems IRIS or a complete version of Cache/Ensemble?Service Unavailable error is because of license limitations on TRYCACHE.
go to post Eduard Lebedyuk · Jul 16, 2019 Create a response wrapper and use it. %ListOfObjects is serial, not persistent. Class MyResponse Extends %Persistent { Property Snapshots As List Of EnsLib.SQL.Snapshot; }
go to post Eduard Lebedyuk · Jul 16, 2019 Well, maybe it's a handwritten response?I'd recommend contacting the API developer and verifying that API responses would be indeed JSON.
go to post Eduard Lebedyuk · Jul 16, 2019 Can you make the same call to the API using Postman and show the response?It's very strange that API returns non-json response.Does my code snippet throw the same error?
go to post Eduard Lebedyuk · Jul 16, 2019 You can simplify your code to this: set dynObj = {}.%FromJSON(objHttpResponse.Data) set iter = dynObj.%GetIterator() while iter.%GetNext(.key , .value ) { write "key = "_key_" , value = "_value,! } Also json is a string so in your code sample it won't have %FromJSON method.
go to post Eduard Lebedyuk · Jul 16, 2019 Well, the JSON you posted is not a valid JSON. Where did you get it?Valid JSON looks like this: { "error":[ { "txt1":"error msg1" }, { "txt2":"error msg2" } ] }
go to post Eduard Lebedyuk · Jul 16, 2019 What version are you on?If it's 2016.2+ you can use dynamic objects.
go to post Eduard Lebedyuk · Jul 16, 2019 1.Variables are defined or referenced via <var>, yes, but you can pass the values to the Installer from your script. For example, check MDX2JSON installer: Set pVars("User")="web" Set pVars("Password")="dsweb" Set pVars("Namespace")="TEMP3" Set pVars("Import")=1 Set pVars("SourceDir")="C:\temp\MDX2JSON\MDX2JSON" Do ##class(MDX2JSON.Installer).setup(.pVars) 2. You set environment variable in cmd (Windows): set NEWVAR=SOMETHING And after that you can get it from installer with: $system.Util.GetEnviron("NEWVAR")
go to post Eduard Lebedyuk · Jul 16, 2019 1. You can pass variables to installation manifest.2. You can set environment variables and get them in ObjectScript: set env = "MYVAR" set val = $system.Util.GetEnviron(env)
go to post Eduard Lebedyuk · Jul 15, 2019 They go through your web server (i.e. Apache, NodeJS, IIS) directly.You can serve files via REST, from files or XDatas. Here's an example in WebTerminal app, but it can be generalized to server arbitrary files from FS.
go to post Eduard Lebedyuk · Jul 14, 2019 That would work only in the cases where original reference to OREF exists, right?
go to post Eduard Lebedyuk · Jul 11, 2019 i was able to convert the HttpResponse.Data to String and than to the Dynamic ObjectYou don't need to convert to string, pass stream to FromJSON method and it would work.send a JSON data to a REST API. Set tAge = 23 Set pRequest= {"name":"abcdefghi","salary":123,"age":(tAge) }