简体   繁体   English

Jenkins Active Choices Reactive Parameter中的OutputStreamWriter替代方法

[英]OutputStreamWriter alternative in Jenkins Active Choices Reactive Parameter

I am making a POST API call to proxmox for an authentication token but as soon as I use OutputStreamWriter inside the groovyscript for the active choices parameter it breaks. 我正在对proxmox进行POST API调用以获取身份验证令牌,但是当我在groovyscript中使用OutputStreamWriter时,它就会断开活动选择参数。 This currently works on Groovy Script IDE. 这当前适用于Groovy Script IDE。 Are there any alternatives to using the OutputStreamWriter?(it is the only way I have found that has enabled the query to return me the token when passing the params) 有没有使用OutputStreamWriter的替代方法?(这是我发现的唯一方法,它使得查询在传递参数时能够返回令牌)

def url = new URL(urlString)
    def conn = url.openConnection()
    conn.setDoOutput(true)
    def writer = new OutputStreamWriter(conn.getOutputStream())
    writer.write(paramString)
    writer.flush()

Solved: 解决了:

You can get the response with the following code run on the master node: 您可以在主节点上运行以下代码来获取响应:

def command = 'curl -k -d root@pam&password=password $URL'
def response = command.execute().text

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Jenkins Groovy 和 Active Choices 反应参数 - Jenkins Groovy and Active Choices Reactive Parameter jenkins 管道中的主动选择反应参考参数 - Active Choices Reactive Reference Parameter in jenkins pipeline 查询 AWS CLI 以填充 Jenkins “Active Choices Reactive Parameter” (Linux) - Query AWS CLI to populate Jenkins “Active Choices Reactive Parameter” (Linux) 如何在 Jenkins 中为 Active Choices Reactive Parameter 插件设置默认值? - How to set default value for Active Choices Reactive Parameter plugin in Jenkins? 如何从 Jenkins 的活动选择反应参数中引用节点参数 - How to reference the node paramater from the active choices reactive parameter in Jenkins Jenkins Active Choices反应参考参数不适用于格式化的HTML输入文本框 - Jenkins Active Choices Reactive Reference Parameter does not work with Formatted HTML Input-Text-Box Jenkins 声明式管道:如何从“主动选择反应引用参数的 Groovy 脚本”调用函数? - Jenkins Declarative Pipeline: How to call functions from "Active choices reactive reference parameter's Groovy script"? 在活动选择反应参数中使用groovy脚本 - Using groovy script in active choices reactive parameter Jenkins Active Choices参数插件无法正常工作 - Jenkins Active Choices Parameter plugin not working as expected Jenkins管道参数代码,用于多个活动选择 - Jenkins pipeline parameter code for multiple active choices
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM