【发布时间】:2023-02-04 05:14:31
【问题描述】:
我一直在尝试通过 ansible uri 模块执行以下 curl 命令 (网址、用户名和密码已更改,只是为了保护隐私)
curl -u "username:password" "https://company.abc.apps.company.eu/qps/rest/1.0/download/ca/downloadbinary/" --header "Content-Type: application/xml" --data-raw "<ServiceRequest><data><DownloadBinary><platform>LINUX_UBUNTU</platform><architecture>ARM_64</architecture></DownloadBinary></data></ServiceRequest>" -o file.deb
我目前的剧本任务是:
- name: Download Binaries?
ansible.builtin.uri:
url: https://company.abc.apps.company.eu/qps/rest/1.0/download/ca/downloadbinary/
url_username: username
url_password: password
force_basic_auth: true
headers:
Content-Type: application/xml
body_format: raw
body: "<ServiceRequest><data><DownloadBinary><platform>LINUX_UBUNTU</platform><architecture>ARM_64</architecture></DownloadBinary></data></ServiceRequest>"
dest: file.deb
我从该站点收到的错误消息如下:
<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://companty.abc.apps.company.eu/qps/xsd/1.0/ca/downloadbinary.xsd">
<responseCode>OPERATION_NOT_SUPPORTED</responseCode>
<responseErrorDetails>
<errorMessage>Operation not supported for this object using this method.</errorMessage>
<errorResolution>Refer to the QPS guide for authorized operation for this domain object.</errorResolution>
</responseErrorDetails>
</ServiceResponse>
有谁知道我在这里做错了什么?
感谢:D
【问题讨论】: