Encontrar

Artículo
· 15 ago, 2023 Lectura de 2 min

Using NativeAPI Extension from Python

In my previous articles, I described my Command Line Extension to NativeAPI.
Of course, this is also available for any other NativeAPI package.
So I created this example in Python as a demo.

The package contains also an IRIS server in Docker for the demo
It is evident that it also works with any remote IRIS server.
You just have to provide it with my NativeAPI CommandLine Extension.

I think this demo is easy to follow and shows the essential features.

  • First, you install the package and start the container
  • then you start the demo
    docker-compose exec iris python3 src/rcc.py
  • Next, you connect  to your IRIS server defaults refer to the ádde IRIS server in the container
    >>> serverIP [127.0.0.1]:
    >>> serverPORT [1972]:
    >>> namespace [USER]:
    >>> username [_SYSTEM]:
    >>> password [SYS]:
    Connected to Instance IRIS on Server 1C09927CAE60 
  • Now, you get into the demo menu
    Select Demo to exercise 
     0 = free ObjectScript
     1 = $ZV from Server
     2 = Actual Time in Server
     3 = TimeZone Offset of Server
     4 = Server ArchitectureVendorModel
     5 = List Global in ZWRITE style
     * = Terminate demo
    >>> take a choice [1]:  
  • And this is the result when you run through all 5 examples
    >>> take a choice [1]:
     IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2023.2 (Build 227U) Mon Jul 31 2023 18:04:28 EDT 
    
    >>> take a choice [1]: 2
     2023-08-15 07:42:16 
    
    >>> take a choice [1]: 3
     0 
    
    >>> take a coice [1]: 4
     x86_64 * Intel * Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz 
    
    >>> take a choice [1]: 0 
    >>> Your ObjectScript [ quit "?"]: quit $ZTS
     66701,27813.678790226 
    
    >>> take a choice [1]: 0 
    >>> Your ObjectScript [ quit "?"]: quit 17/4
     4.250000000000000000 
    
    >>> take a choice [1]: 0 
    >>> Your ObjectScript [ quit "?"]: quit 17/0
     <DIVIDE> 18 x^%ZX 
    
    >>> take a choice [1]: 5 
    >>> Your Global [^dc.MultiD]:
     ^dc.MultiD = 5
     ^dc.MultiD(1) = $lb("Braam,Ted Q.",51353)
     ^dc.MultiD(1,"mJSON") = "{}"
     ^dc.MultiD(2) = $lb("Klingman,Uma C.",62459)
     ^dc.MultiD(2,2,"Multi","a") = 1
     ^dc.MultiD(2,2,"Multi","rob",1) = "rcc"
     ^dc.MultiD(2,2,"Multi","rob",2) = 2222
     ^dc.MultiD(2,"Multi","a") = 1
     ^dc.MultiD(2,"Multi","rob",1) = "rcc"
     ^dc.MultiD(2,"Multi","rob",2) = 2222
     ^dc.MultiD(2,"mJSON") = "{""A"":""ahahah"",""Rob"":""VIP"",""Rob2"":1111,""Rob3"":true}"
     ^dc.MultiD(3) = $lb("Goldman,Kenny H.",45831)
     ^dc.MultiD(3,"mJSON") = "{}"
     ^dc.MultiD(4) = $lb("","")
     ^dc.MultiD(4,"mJSON") = "{""rcc"":122}"
     ^dc.MultiD(5) = $lb("","")
     ^dc.MultiD(5,"mJSON") = "{}"
     **** done ***
    
     >>> take a choice [1]: *
       Thank you for trying the demo

If you prefer to test it with embedded Python use

docker-compose exec iris iris session iris "##class(nacl.rcc).py()"

 

Video

GitHub

3 comentarios
Comentarios (3)2
Inicie sesión o regístrese para continuar
Pregunta
· 9 ago, 2023

VS Code : unable to save file to server

When I open a class in VS Code and I want to save it I'm getting the following error : Non-JSON response to /api/atelier/v7/DEV/doc/API.Mollie.Execute.cls?ignoreConflict=0 request. Is the web server suppressing detailed errors?

Also I always get a popup when I open VS Code "The extension wants to sign in using InterSystems Server Credentials."

3 comentarios
Comentarios (3)4
Inicie sesión o regístrese para continuar
Pregunta
· 4 ago, 2023

Azure Databricks JDBC connection to Intersystems

We encountered difficulties while attempting to establish a JDBC connection to Intersystems using AZURE Databricks, resulting in an inability to retrieve data. The JDBC version utilized was intersystems-jdbc-3.3.1.jar. If anyone has successfully employed Databricks for establishing a connection, we would appreciate information regarding the libraries you used

 

Error Message:
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (10.140.70.71 executor driver): java.sql.SQLException: [SQLCODE: <-25>:<Input encountered after end of query>]

7 comentarios
Comentarios (7)3
Inicie sesión o regístrese para continuar
Pregunta
· 27 jul, 2023

Is it possible to get a list all active open TCP/IP connections made by IRIS ?

There is several classes that allow to create TCP/IP connections (eg: to connect to a service).

Example : %Net.FtpSession (port 21), %Net.HttpRequest (usually port 80 or 443)

AFAIK connection will stay open unless closed explicitly or if variable that hold the instance is garbage collected.

Is there a way to get a list of all active (open) TCP/IP connections IRIS is maintaining so far ?

I took a look at Portal (eg: in dashboard, "System Resource Statistics") but couldn't find anything. Web Gateway panel provide information about connections but this is incoming connections for CSP pages. I am look for external connections (the other way around).

If it's not available in Portal, some API / classes will be fine too.

I could of course run TCPView , netstat or something like that but I am looking for something built-in in IRIS.

6 comentarios
Comentarios (6)2
Inicie sesión o regístrese para continuar
Anuncio
· 20 jul, 2023

GitLab is Now Supported on Open Exchange

Exciting news for developers using GitLab for their InterSystems applications repositories! Open Exchange has expanded its support to include GitLab, allowing you to submit your projects just as easily as you would do with GitHub repos. 

Submitting Your GitLab Repo app on Open Exchange:

  1. Start by navigating to Open Exchange and log in to your account.
  2. Head to the "Submit Application" 
  3. In the "GitHub/GitLab URL" field, include the link to your open GitLab repository.
  4. Make sure to check the "Use GitHub/GitLab README as long description" checkbox. This ensures that your project's README file serves as a a long description for the app.

Fetching App Data from GitLab

 

With the integration of GitLab on Open Exchange, the platform fetches application data from your GitLab repository, much like it does with GitHub:. This means you can take advantage of Open Exchange's wide range of features and services regardless of the repository hosting platform.
 

Please don't hesitate to share your feedback on this feature here in comments or DM me.

1 Comentario
Comentarios (1)3
Inicie sesión o regístrese para continuar