我正在尝试获取通过REST API / Curl命令部署到UCD中的环境的组件的当前组件版本。下面是示例代码,该代码返回UCD中可用的该组件的所有版本。它没有为我提供部署到环境中的该组件的最新版本。有帮助/建议吗?
import sys
from PySide2.QtCore import *
from PySide2.QtWidgets import *
table_text = '\
Name Flower\n\
------ -------\n\
Violet Yes\n\
Robert No\n\
Daisy Yes\n\
Anna No\n\
'
class Widget(QWidget):
def __init__(self, parent= None):
super(Widget, self).__init__()
warning_text = 'warning_text'
info_text = 'info_text'
pt = 'colour name'
msg = QMessageBox()
msg.setIcon(QMessageBox.Warning)
msg.setText(warning_text)
msg.setInformativeText(info_text)
msg.setDetailedText("{}".format(table_text))
msg.setTextInteractionFlags(Qt.TextSelectableByMouse)
# print all children and their children to find out which widget
# is the one that contains the detailed text
for child in msg.children():
print('child:{}'.format(child))
print(' {}'.format(child.children()))
pname = 'QMessageBox'
cname = 'QTextEdit'
msg.setStyleSheet(
"""{} {} {{ background-color: red; color: black; font-family: Courier; }}""".format(pname, cname))
msg.exec_()
if __name__ == '__main__':
app = QApplication(sys.argv)
Widget()
答案 0 :(得分:0)
uDeploy具有许多未记录的api端点。我无法从他们的文档中弄清楚如何做到这一点,但是多次检查uDeploy Web界面可以帮助您找到要命中的端点。
https:// {your-udeploy-url} / rest / deploy / environment / {your-environment-id} / latestDesiredInventory / true?rowsPerPage = 10000&pageNumber = 1&orderField = name&sortType = desc
这将返回您可以解析的json,以获取在环境中部署的版本。