【问题标题】:How can I call OS commands from within ballerina如何从芭蕾舞演员中调用操作系统命令
【发布时间】:2019-08-19 14:27:45
【问题描述】:

我想生成一些证书,使用 openSSL 并通过 REST 提供它们。

我找不到在 linux 中调用我的 openssl 来生成证书并在 ballerina 中使用它的方法。

没有找到插件

或者还有其他方法可以在芭蕾舞演员中生成证书。 ballerina/crypto 模块中对 KeyStores 有一些支持 https://ballerina.io/learn/api-docs/ballerina/crypto.html#KeyStore

【问题讨论】:

    标签: operating-system ballerina


    【解决方案1】:

    这将通过ballerina/system 模块与ballerina-1.0.0 一起提供。 API 将如下所示。

    # Executes an operating system command as a subprocess of the current process.
    #
    # + command - The name of the command to be executed
    # + env - Environment variables to be set to the process
    # + dir - The current working directory to be set to the process
    # + args - Command arguments to be passed in
    # + return - Returns a `Process` object in success, or an `Error` if a failure occurs
    public function exec(@untainted string command, @untainted map<string> env = {}, 
                         @untainted string? dir = (), @untainted string... args) 
                         returns Process|Error = external;
    

    【讨论】:

      猜你喜欢
      • 2018-11-10
      • 2023-04-04
      • 1970-01-01
      • 2019-06-02
      • 1970-01-01
      • 1970-01-01
      • 2020-07-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多