UiPath CLI 用户指南
uip solution resource会清点本地解决方案所依赖的资源(队列、资产、存储桶、流程、连接) — 在每个项目的bindings_v2.json中声明并汇总到解决方案的资源列表中的资源。用于查看解决方案在部署时所需的资源,或在编辑项目绑定后重新同步解决方案清单。
不要与uip resource混淆
本页介绍uip solution的resource子命令(一个本地解决方案作用域的清单工具)。
独立的uip resource工具是不同的命令:它在实时租户上的 Orchestrator 服务器端队列、资产、存储桶等上提供 CRUD。
经验法则: uip solution resource检查磁盘上的文件, uip resource与 Orchestrator 对话。
大纲
uip solution resource <verb> [options]
uip solution resource <verb> [options]
动词
| 动词 | 用途 |
|---|---|
list | 列出解决方案中的资源 — 本地、远程或两者兼而有之。 |
refresh | 重新扫描项目,并从其bindings_v2.json文件中同步解决方案的资源清单。 |
UIP 解决方案资源列表
列出解决方案中的资源。默认情况下,将返回在解决方案清单中本地声明的资源,以及 Orchestrator 为关联远程租户报告的资源。使用--source将范围缩小到一侧;使用--kind和--search进行筛选。
当两边都列出时,与本地条目通过Kind:Name (不区分大小写)匹配的远程条目将被重复数据删除 — 本地条目优先。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
[solutionPath] | 否 | 解决方案目录的路径。默认为当前目录。 |
选项
| 短 | 长 | 值 | 默认 | 描述 |
|---|---|---|---|---|
| — | --kind | 枚举 | — | Queue、 Asset 、 Bucket 、 Process 、 Connection 。不区分大小写。 |
| — | --search | text | — | 资源名称的包含匹配项 |
| — | --source | 枚举 | all | all、 local或remote 。 |
示例
# All resources the current solution knows about
uip solution resource list
# Only queues declared locally
uip solution resource list --kind Queue --source local
# Remote buckets whose name matches "invoice"
uip solution resource list --kind Bucket --search invoice --source remote
# Point at a specific solution directory
uip solution resource list ./solutions/finance
# All resources the current solution knows about
uip solution resource list
# Only queues declared locally
uip solution resource list --kind Queue --source local
# Remote buckets whose name matches "invoice"
uip solution resource list --kind Bucket --search invoice --source remote
# Point at a specific solution directory
uip solution resource list ./solutions/finance
数据形状(--输出 json)
{
"Code": "ResourceList",
"Data": [
{
"Source": "Local",
"Key": "a1b2c3d4-0000-0000-0000-000000000001",
"Name": "InvoiceIntake",
"Kind": "Queue",
"Type": "",
"Folder": "Shared"
},
{
"Source": "Remote",
"Key": "b2c3d4e5-0000-0000-0000-000000000002",
"Name": "InvoiceBucket",
"Kind": "Bucket",
"Type": "S3",
"Folder": "Shared/Finance"
}
]
}
{
"Code": "ResourceList",
"Data": [
{
"Source": "Local",
"Key": "a1b2c3d4-0000-0000-0000-000000000001",
"Name": "InvoiceIntake",
"Kind": "Queue",
"Type": "",
"Folder": "Shared"
},
{
"Source": "Remote",
"Key": "b2c3d4e5-0000-0000-0000-000000000002",
"Name": "InvoiceBucket",
"Kind": "Bucket",
"Type": "S3",
"Folder": "Shared/Finance"
}
]
}
--source remote (和all )需要经过身份验证的会话,该会话有权访问解决方案的目标 Orchestrator。故障按类别记录为警告;该命令会返回它能够获取的任何内容。
UIP 解决方案资源刷新
重新扫描解决方案中的每个项目,并同步其bindings_v2.json文件中的资源声明。创建尚未在解决方案资源列表中的绑定;与现有 Orchestrator 资源匹配的绑定设置将导入。编辑项目绑定后,运行此方法,以使解决方案清单文件恢复到一致的步骤。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
[solutionPath] | 否 | 解决方案目录的路径。默认为当前目录。 |
示例
# Refresh the current solution
uip solution resource refresh
# Refresh a specific solution directory
uip solution resource refresh ./solutions/finance
# Refresh the current solution
uip solution resource refresh
# Refresh a specific solution directory
uip solution resource refresh ./solutions/finance
数据形状(--输出 json)
{
"Code": "ResourceRefresh",
"Data": {
"Created": 2,
"Imported": 1,
"Skipped": 5,
"Warnings": [],
"Status": "Synced 3 resources (5 already in solution)"
}
}
{
"Code": "ResourceRefresh",
"Data": {
"Created": 2,
"Imported": 1,
"Skipped": 5,
"Warnings": [],
"Status": "Synced 3 resources (5 already in solution)"
}
}
Created是全新的解决方案资源计数; Imported是与 Orchestrator 匹配的资源计数; Skipped对已有匹配解决方案条目的绑定进行计数。Warnings是同步中人类可读注释的列表(如果是全新运行,则为空)。
相关命令
uip solution pack— 打包读取解决方案的资源列表。uip solution deploy— 在目标租户上部署配置资源。uip resource— 独立的服务器端 CRUD 工具(不同命令,不同用途)。