UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

uip 是连接器构建器触发器状态

用于连接轮询/Webhook 触发器以及使用 Integration Service 连接器构建器对连接器文件进行低级结构化读取/写入访问的语法和选项 - 触发器创建、状态查询和状态修补。

属于uip is connectors builder本地创作工具链的一部分。本页涵盖两个不相关但较小的命令组,这两个命令组由于其大小而共享一个页面:

  • builder trigger create — 连接现有活动作为事件源(轮询或 Webhook),以便 Studio 可以在创建、更新或删除供应商记录时触发流程。
  • builder state query / patch — 连接器磁盘文件的通用指针编址读取/写入表面。对于高级命令(init、auth、activity)不会公开为专用标志的任何内容,这是一个转义窗口。

有关连接器目录解析、设计与已发布的区别以及整体创作流程,请参阅父页面上的概念。有关触发器附加到的活动,请参阅活动和挂钩。

大纲​

uip is connectors builder trigger create --resource-name <name> --updated-date-field <field> [options...]
uip is connectors builder state query <pointer> [--connector-dir <path>]
uip is connectors builder state patch <pointer> [--value <json> | --value-file <path>] [--op upsert|remove] [--connector-dir <path>]
uip is connectors builder trigger create --resource-name <name> --updated-date-field <field> [options...]
uip is connectors builder state query <pointer> [--connector-dir <path>]
uip is connectors builder state patch <pointer> [--value <json> | --value-file <path>] [--op upsert|remove] [--connector-dir <path>]

uip 是连接器构建器触发器创建​

将现有活动/资源连接为触发器源:为事件配置捆绑包 (--event-kind) 设定种子,然后配置轮询元数据 (CREATED/UPDATED/DELETED) — 标准资源元数据、轮询器配置条目和连接器的 hasEvents 标志。

trigger 有单个动词。trigger list / get / delete没有触发器 — 应通过state patch / state query对照资源的element.json条目移除或检查触发器。

备注:

使用此活动可将现有 GET 活动转变为轮询触发器源。活动必须已存在 — 如果Code: "resourceNotFound"的标准资源文件尚不存在,则此命令将硬失败,并显示--resource-name ;请先运行activity create 。

选项​

长值描述
--resource-name <name>字符串必需。要连接作为触发器的现有活动/标准资源。
--updated-date-field <field>字符串必需。包含上次修改日期的供应商字段,例如 LastModifiedDate。
--event-kind <kind>polling | webhook | all要种子的事件配置捆绑包。默认 polling。经过验证的客户端 — 无法识别的值会快速失败,并显示 Code: "invalidEventKind",而不是静默回退。
--override <kv>key=value、可重复每个条目的 defaultValue 会覆盖种子事件的预设。
--created-date-field <field>字符串供应商创建日期字段。默认为 --updated-date-field。
--id-field <field>字符串主键字段。默认为 Id。
--date-format <mask>字符串已更新时间戳的日期格式掩码。
--created-date-format <mask>字符串创建的时间戳的日期格式掩码。默认为 --date-format。
--event-types <csv>逗号分隔要启用的事件类型。默认为 CREATED,UPDATED,DELETED。
--polling-url <url>url显式轮询 URL。省略时,则从活动的 GET 路径自动生成。
--date-timezone <tz>字符串用于日期比较的时区。默认为 GMT 时间。
--polling-resource-label <label>字符串elementMetadata.pollingResources 中使用了标签。
--connector-dir <path>路径连接器目录。解决方案顺序与概念图相同。

--event-kind 折叠了以前是单独的 config preset --kind event 步骤的内容:它在连接轮询元数据之前为事件配置捆绑包(轮询器配置条目轮询需求)设定了种子,仅一次调用。

示例​

uip is connectors builder trigger create --resource-name Account \
  --updated-date-field LastModifiedDate --id-field Id
uip is connectors builder trigger create --resource-name Account \
  --updated-date-field LastModifiedDate --id-field Id

数据形状(--输出 json)​

{
  "Code": "TriggerCreated",
  "Data": {
    "ConnectorRoot": "/work/my-acme-connector",
    "ResourceName": "Account",
    "EventKind": "polling",
    "EventTypes": ["CREATED", "UPDATED", "DELETED"],
    "PollingUrl": "/accounts?where=LastModifiedDate>'<gmtDate>'",
    "PollerConfigKey": "polling.interval",
    "PollingConfig": { "...": "seeded poller config entry" }
  }
}
{
  "Code": "TriggerCreated",
  "Data": {
    "ConnectorRoot": "/work/my-acme-connector",
    "ResourceName": "Account",
    "EventKind": "polling",
    "EventTypes": ["CREATED", "UPDATED", "DELETED"],
    "PollingUrl": "/accounts?where=LastModifiedDate>'<gmtDate>'",
    "PollerConfigKey": "polling.interval",
    "PollingConfig": { "...": "seeded poller config entry" }
  }
}

当操作成功但有注意事项(例如,自动生成的轮询 URL 可能需要手动审核)时,系统将添加 Warnings 数组。

uip 是连接器构建器状态查询​

读取指针编址的连接器扇区。只读 — 按原样返回解析后的值(对象、数组或字符串)。

备注:

使用此功能在修补连接器之前检查连接器的当前形状 - 单个配置条目、资源、标准资源字段、挂钩文件或元数据键。对于整体连接器结构汇总,请使用inspect代替已解决的切片。要写入或删除,请使用下方的 state patch。

参数​

名称必填用途
<pointer>是指向连接器的指针 — 请参阅下面的指针语法。

选项​

长值描述
--connector-dir <path>路径连接器目录。解决方案顺序与概念图相同。

示例​

uip is connectors builder state query element.json/configuration/base.url
uip is connectors builder state query element.json/configuration/base.url
# Path segments in a resource pointer are URL-encoded
uip is connectors builder state query element.json/resources/GET/%2Fcontacts
# Path segments in a resource pointer are URL-encoded
uip is connectors builder state query element.json/resources/GET/%2Fcontacts
uip is connectors builder state query standard-resources/contacts/fields/email
uip is connectors builder state query standard-resources/contacts/fields/email

数据形状(--输出 json)​

{
  "Code": "StateQuery",
  "Data": {
    "pointer": "element.json/configuration/base.url",
    "value": { "key": "base.url", "type": "TEXTFIELD_128" }
  }
}
{
  "Code": "StateQuery",
  "Data": {
    "pointer": "element.json/configuration/base.url",
    "value": { "key": "base.url", "type": "TEXTFIELD_128" }
  }
}

Value 的密钥与其在磁盘上显示的完全相同(驼峰式命名法,而非像此 CLI 输出的其余部分一样采用帕斯卡命名法)——这是特意的设计,因此 state query 结果可以直接馈入 state patch --value,无需进行任何调整。请参阅下面的“查询 → patch 往返” 。如果返回的是每个项目的存根而不是完整对象,则数组级别读取会将 "Summarized": true 和 SummaryHint 字段添加到信封中 — 将汇总结果视为要单独查询的名称/键列表,而不是完整的记录。

uip 是连接器构建器状态补丁​

写入(更新插入)或删除指针编址的连接器扇区。element.json 是事实来源;当补丁更改链接的标准资源参数所依赖的内容时,这些参数会自动同步。

备注:

使用此选项可设置或替换任何高级命令(init、auth、activity)均未将其公开为专用标志的配置条目、资源、参数、标准资源字段、挂钩或元数据键— 或删除单个已解决项目 (--op remove)。要优先读取,请使用上面的 state query。这不适用于批量搭建或身份验证连接 — 请使用专用的创作命令。

参数​

名称必填用途
<pointer>是指向连接器的指针 — 请参阅下面的指针语法。

选项​

长值描述
--value <json>内联 JSON要写入的值。与 --value-file 互斥。请省略 --op remove。
--value-file <path>路径要从文件读取要写入的 JSON 值,而非内联。与 --value 互斥。
--op <op>upsert | remove操作。默认 upsert。
--connector-dir <path>路径连接器目录。解决方案顺序与概念图相同。

示例​

uip is connectors builder state patch standard-resources/contacts/fields/email \
  --value '{"type":"string","vendorPath":"email"}'
uip is connectors builder state patch standard-resources/contacts/fields/email \
  --value '{"type":"string","vendorPath":"email"}'
uip is connectors builder state patch 'element.json/resources/GET/%2Fcontacts/parameters/0' --op remove
uip is connectors builder state patch 'element.json/resources/GET/%2Fcontacts/parameters/0' --op remove

数据形状(--输出 json)​

{
  "Code": "StatePatched",
  "Data": {
    "Pointer": "standard-resources/contacts/fields/email",
    "Op": "upsert",
    "Outcome": "Upserted field 'email' in contacts."
  }
}
{
  "Code": "StatePatched",
  "Data": {
    "Pointer": "standard-resources/contacts/fields/email",
    "Op": "upsert",
    "Outcome": "Upserted field 'email' in contacts."
  }
}

当补丁成功完成注意事项时,系统将添加一个 Warnings 数组,并且 AutoSynced 数组列出了补丁作为副作用更新的所有链接文件或字段(例如,与更改后的 element.json资源定义)。当 Data 为空时,两者都会省略。

指针语法​

state query 和 state patch 都通过相同的指针语法对连接器进行编址,这也显示在每个命令自己的 --help 输出中:

指针地址
element.json/configuration配置摘要。使用 ?type= 进行筛选。
element.json/configuration/{key}一个配置条目。
element.json/resources资源摘要。使用 ?method= / ?type= 进行筛选。
element.json/resources/{METHOD}/{path}一个资源({path} 是 URL 编码的)。
element.json/authentication身份验证块。
element.json/hooks | element.json/parameters全局挂钩/参数数组。
standard-resources列出标准资源名称。
standard-resources/{name}整个标准资源文件。
standard-resources/{name}/fields列表字段名称。
standard-resources/{name}/fields/{field}一个字段对象。
standard-resources/{name}/metadata[/{key}]元数据对象或单个元数据密钥。
hooks列出挂钩文件。
hooks/{file}一个挂钩 JS 文件。
element-metadata.jsonelement-metadata.json 对象。
任何其他存储库相对路径原始文件回退。只读; JSON 是美化文件的。

查询 → 补丁往返​

state query 的输出设计为不加修改地直接反馈到 state patch --value:使用 query 读取切片,编辑生成的 JSON,然后将 patch 设置为编辑后的 JSON 的相同指针--value(或将其写入文件并使用 --value-file)。这有效的唯一原因是 Value 的密钥是按原义保留的(驼峰式命名法,磁盘大小写),而不是像此 CLI 的 JSON 输出的其余部分一样采用帕斯卡命名法 — 在修补之前重新命名密钥将无法正确往返。

另请参阅​

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新