New post

Find

Announcement
· Aug 27, 2024

开发者社区AI (DC AI)来了!

欢迎来到开发者社区AI的新纪元!

🚀 InterSystems Developer Community AI 🚀

开发者社区 AI (即DC AI), 我们的新助手,已经准备好为您答疑解惑!

借助 InterSystems IRIS Vector Search 及 SerenityGPT, 能够基于InterSystems开发者社区提供相关度最高的答案。此外,DC AI支持六种语言,包括英语、西班牙语、葡萄牙语、日语、中文和法语,极大地方便了全球各地的开发者们!

 


    如何使用

    • 登录:登录您的开发者社区账号
    • 导航至 DC AI进入 DC AI 页面 ,在您主页的右上角,有一个 "What's New(最新变化)" 模块,通过这个模块即可快速到达DC AI页面。

    • 提问:直接在该页面提交您的问题即可。


    更多功能:

    • 如果没有得到您需要的答案,可以使用“在社区提问(Ask Community)”按钮轻松地将您的问题转换为帖子。
    • 您可以使用共享按钮()与他人分享您的聊天内容,并保存/复制答案以备将来参考()。
    • 通过来源部分列出的相关社区帖子,更深入了解DC AI的答案。


    我们期待您的回复!
    由于该功能仍处于测试阶段,您的反馈对改进DC AI至关重要:

    • 使用“喜欢/不喜欢”按钮对答案进行评分。
    • 在这篇文章的评论中分享具体的反馈、建议和想法。


    即刻尝试DC AI!

    提出您的问题并与社区分享您的经验。

    Discussion (0)1
    Log in or sign up to continue
    Article
    · Aug 27, 2024 4m read

    Acceso a Azure Blob Storage

    Acceder a un almacenamiento en la nube de Azure para cargar/descargar blobs es bastante fácil usando los métodos API designados de la clase %Net.Cloud.Storage.Client, o usando los adaptadores de entrada/salida EnsLib.CloudStorage.*

    Tened en cuenta que necesitaréis tener el Servidor de Lenguaje Externo %JavaServer en funcionamiento para usar tanto la API de almacenamiento en la nube como los adaptadores, ya que ambos usan el marco PEX usando el Servidor Java.

    He aquí un breve resumen:

    El acceso a Azure Blob Storage se realiza mediante una cadena de conexión similar a esta:

    DefaultEndpointsProtocol=https;AccountName=abcdefscleanisr;AccountKey=n3mWskdjgfhklsghdfjaskhgkjdfizqMWJ5X2L4JpqeEJk/FuEnw0rPI6E/rULPn0V5BWgFw+AStRJZlYQ==;EndpointSuffix=core.windows.net

    Divididlo en líneas con «;» como delimitador y guardadlo como archivo de texto:

    DefaultEndpointsProtocol=https;
    AccountName=abcdefscleanisr;
    AccountKey=n3mWskdjgfhklsghdfjaskhgkjdfizqMWJ5X2L4JpqeEJk/FuEnw0rPI6E/rULPn0V5BWgFw+AStRJZlYQ==;
    EndpointSuffix=core.windows.net

    Para este ejemplo llamaré a este archivo «MyAzureStorage.txt».

    Ahora vamos a activar la API:

    set file="C:\Storage\MyAzureStorage.txt"
    set endpoint="abcdefscleanisr.privatelink.blob.core.windows.net"
    set tStatus=""

    En el método API CreateClient, el segundo parámetro es el proveedor de la nube:

    • 0 - Amazon S3
    • 1 - Azure Blob
    • 2 - Google Cloud Storage
    SET myClient = ##CLASS(%Net.Cloud.Storage.Client).CreateClient(,1,file,0,.tStatus,endpoint)

    Una vez establecido el cliente (tStatus=1), podéis ejecutar cualquiera de los métodos del cliente:

     

    En Azure Blob Storage, un Bucket es un Contenedor.

    Así, por ejemplo, para obtener la lista de contenedores de Azure, ejecutad el método ListBuckets:

    set list=myClient.ListBuckets()
    
    for i=1:1:list.Count() {write list.GetAt(i).name,!}
    
    clean
    dirty

    Una vez que tengáis un nombre de contenedor (tomemos como ejemplo el contenedor "clean"), podéis obtener la lista de blobs que contiene:

    set list=myClient.ListBlobs("clean")
    
    for i=1:1:list.Count() {write list.GetAt(i).name,!}
    
    4caa6f29-e9e6-4cde-9112-65ec28d4eded.jpeg
    2374233-e9e6-4cde-9112-65ec28d4eded.jpeg
    3klfd3lld-e9e6-4cde-9112-65ec28d4eded.jpeg
    4caa6f29-e9e6-87ry-9112-65ec28d4eded.jpeg

    El adaptador de salida CloudStorage tiene menos opciones - sus métodos incluyen sólo los siguientes:

    • UploadBlobFromString(bucketName,blobName,content)
    • UploadBlobFromStream(bucketName,blobName,content)
    • UploadBlobFromFile(bucketName,blobName,filePath)
    • DeleteBlob(bucketName,blobName)

    Estos son los parámetros para configurar una operación de negocio utilizando el EnsLib.CloudStorage.OutboundAdapter con Azure Blob Storage. El parámetro Storage Region no es relevante para Azure Blob Storage.

    Todos los demás parámetros son relevantes igual que cuando usábamos el método CreateClient:

    El parámetro ContainerName no es parte de los parámetros del adaptador - no es necesario para crear el cliente (el método CreateClient no lo utiliza).

    Sin embargo, todos los demás métodos del adaptador enumerados anteriormente sí necesitan especificar a qué cubo/contenedor debe cargarse el blob, por lo que tiene sentido añadirlo como parámetro como parte de la configuración:

    Class Sasa.BO.Storage Extends Ens.BusinessOperation
    { 
    Parameter ADAPTER = "EnsLib.CloudStorage.OutboundAdapter"; 
    Property Adapter As EnsLib.CloudStorage.OutboundAdapter; 
    Parameter INVOCATION = "Queue"; 
    /// Bucket name(Amazon) = Container name(Azure)
    Property ContainerName As %String(MAXLEN = 1000); 
    Parameter SETTINGS = "ContainerName:Cloud Storage"; 
    Method CreateFile(pRequest As Cloud.RES.REST, Output pResponse As Cloud.RES.REST) As %Status
    {
        #dim tException As %Exception.SystemException
        Set tStatus = $$$OK
        set pResponse=##class(Cloud.RES.REST).%New() 
        Try {
            Set tStatus = ..Adapter.DeleteBlob(..ContainerName, pRequest.FileName)
            Set tStatus = ..Adapter.UploadBlobFromStream(..ContainerName, pRequest.FileName, pRequest.FileData)   
            if $$$ISERR(tStatus) {
                set pResponse.Success = 0
                set pResponse.ErrorMessage = $system.Status.GetErrorText(tStatus)
            }
        } 
        Catch tException {
            Set tStatus = tException.AsStatus()
            set pResponse.Success=0
            set pResponse.ErrorMessage=$system.Status.GetErrorText(tStatus)
        }
        Quit $$$OK
    }

    Espero que os ayude a empezar a utilizar el adaptador de nube con Azure.

    Discussion (0)1
    Log in or sign up to continue
    Discussion (3)4
    Log in or sign up to continue
    Article
    · Aug 26, 2024 2m read

    在 Linux 上配置 IRIS 自动启动功能

    出于实际原因,可能需要在 Linux 服务器重启后自动启动 IRIS 实例。

    下面是在 Linux 服务器重启时通过 systemd 自动启动 IRIS 的步骤:

    1. 在 /etc/systemd/system/iris.service 中创建一个 iris.service 文件,其中包含以下信息

    [Unit]
    Description=InterSystems IRIS Data Platform
    After=network.target
    
    [Service]
    Type=forking
    User=irisusr
    ExecStart=/usr/bin/iris start iris
    ExecStop=/usr/bin/iris stop iris quietly
    Restart=on-failure
    RemainAfterExit=yes
    
    [Install]
    WantedBy=multi-user.target

    注意:User应该填入IRIS实例的所有者。

    2. 重新加载 systemd 配置管理器

    sudo systemctl daemon-reload

    3. 启用IRIS服务,使其自动启动

    sudo systemctl enable iris
    

    激活后将创建软链接,自动启动 IRIS:

    Synchronizing state of iris.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
    Executing: /usr/lib/systemd/systemd-sysv-install enable iris
    Created symlink /etc/systemd/system/multi-user.target.wants/iris.service → /etc/systemd/system/iris.service.
    

    4. 试着重启服务器

    sudo reboot

    5. 查看IRIS实例是否自动启动

    ssh guilbaud@192.168.102.130
    guilbaud@192.168.102.130's password: 
    Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-36-generic x86_64)
    $ iris all
        Instance Name     Version ID        Port   Directory
        ----------------  ----------------  -----  --------------------------------
    up >IRIS              2024.1.0.267.2    1972   /usr/irissys
    Discussion (0)1
    Log in or sign up to continue
    Article
    · Aug 26, 2024 3m read

    第八章 创建和使用策略

    第八章 创建和使用策略

    本主题介绍如何在 IRIS 中使用 WS-Policy 支持。WS-Policy 使您能够指定要使用或预期的 WS-Security 标头。它还使能够指定 WS-Addressing 标头和 MTOM 的使用(在创建 Web 服务和 Web 客户端中描述)。可以在单独的类中创建策略,而不是直接编辑 Web 服务或 Web 客户端。在大多数情况下,不需要进行低级编程。

    概述

    IRIS 中,Web 服务或客户端的策略(或策略集合)包含在单独的配置类中,即 %SOAP.Configuration的子类。编译该类时,策略生效。

    通常不需要编码。但是,在某些情况下,可以通过编程指定详细信息,而不是将该元素硬编码到策略中。

    Discussion (0)1
    Log in or sign up to continue