functions
latest
false
函数用户指南
Python 函数通过 UiPath() 客户端访问 Orchestrator 资源。凭据和资源引用在运行时解析,系统不会在您的代码中存储任何机密信息,也不会在包中附带任何机密信息。
from uipath.platform import UiPath
sdk = UiPath()
from uipath.platform import UiPath
sdk = UiPath()
资产
从文件夹中检索命名资产值(例如,API 令牌或基本 URL):
asset = sdk.assets.retrieve("API_BASE_URL", folder_path="Shared")
asset = sdk.assets.retrieve("API_BASE_URL", folder_path="Shared")
存储桶
从 Orchestrator 存储桶下载和上传文件:
sdk.buckets.download(
name="Invoices",
blob_file_path="invoice.pdf",
destination_path="/tmp/invoice.pdf",
folder_path="Shared",
)
sdk.buckets.download(
name="Invoices",
blob_file_path="invoice.pdf",
destination_path="/tmp/invoice.pdf",
folder_path="Shared",
)
连接
Retrieve the metadata of an Integration Service connection by id:
conn = sdk.connections.retrieve("connection-id")
conn = sdk.connections.retrieve("connection-id")
This returns the connection's id, base URI, and folder. It does not call the connector. To invoke a connector operation — the equivalent of a Studio activity such as Get Email By ID — see Call an Integration Service activity.
The connection id is a design-time value declared as a binding, not a function input. See Resource bindings.
其他服务
平台客户端还公开队列、作业、流程、文档和实体。有关完整的表面和方法签名,请参阅uipath SDK 参考。
凭据和安全性
- 密码位于 Orchestrator资产中,在运行时检索 — 切勿将其硬编码或提交到项目中。
- 函数在调用它时所使用的身份下运行;文件夹级别的 RBAC 会管理它可以读取的资产和资源。
- Resource references are declared in
bindings.jsonand remapped to the target tenant's resources at runtime, so one package serves every tenant. - An unmapped binding does not fail the job: the call falls back to the design-time identifier, so a function deployed elsewhere can reach for the original tenant's resource.