UiPath Documentation
uipath-cli
latest
false
UiPath-CLI-Benutzerhandbuch
Wichtig :
Dieser Inhalt wurde maschinell übersetzt. Es kann 1–2 Wochen dauern, bis die Lokalisierung neu veröffentlichter Inhalte verfügbar ist.

uip resources

Syntax and options for `uip resources`, which declares the solution resources a coded project uses in `uipath_resources.ts` or `uipath_resources.py`.

uip resources declares the solution resources that a coded project uses. The declarations live in one file at the project root: uipath_resources.ts for a project on the TypeScript SDK, or uipath_resources.py for a project on the Python SDK. Each resource is a typed handle that the SDK accepts in place of a plain name.

import { resource } from '@uipath/uipath-typescript/resources';

export class ProjectResources {
    static readonly invoiceThreshold = resource.asset({ name: 'InvoiceThreshold', folderPath: 'Finance/Shared', type: 'integer' });
    static readonly invoiceReview = resource.queue({ name: 'InvoiceReview' });
}
import { resource } from '@uipath/uipath-typescript/resources';

export class ProjectResources {
    static readonly invoiceThreshold = resource.asset({ name: 'InvoiceThreshold', folderPath: 'Finance/Shared', type: 'integer' });
    static readonly invoiceReview = resource.queue({ name: 'InvoiceReview' });
}
from uipath.resources import resource


class ProjectResources:
    invoice_threshold = resource.asset(name="InvoiceThreshold", folder_path="Finance/Shared", type="integer")
    invoice_review = resource.queue(name="InvoiceReview")
from uipath.resources import resource


class ProjectResources:
    invoice_threshold = resource.asset(name="InvoiceThreshold", folder_path="Finance/Shared", type="integer")
    invoice_review = resource.queue(name="InvoiceReview")
UnterbefehlZweck
addDeclare a resource, and add it to the project's solution when the project is in one.
listList the resources that the project declares.
syncDeclare the resources of the project's local solution that the project does not declare yet.

There is no remove subcommand. To remove a declaration, delete its line from the file.

uip resources wird vom Plugin @uipath/resources-tool bereitgestellt. Wenn sie noch nicht installiert ist, wird uip tools install resources hinzugefügt. Siehe Tools (Plugins).

Zusammenfassung​

uip resources add [name] [--kind <kind>] [--folder-path <path>] [--type <type>] [--skip-verify] [--project-path <path>]
uip resources list [--kind <kind>] [--limit <number>] [--offset <number>] [--project-path <path>]
uip resources sync [--all] [--solution-folder <path>] [--project-path <path>]
uip resources add [name] [--kind <kind>] [--folder-path <path>] [--type <type>] [--skip-verify] [--project-path <path>]
uip resources list [--kind <kind>] [--limit <number>] [--offset <number>] [--project-path <path>]
uip resources sync [--all] [--solution-folder <path>] [--project-path <path>]

Jeder Unterbefehl berücksichtigt die globalen Optionen und gibt die Standardaustrittscodes zurück.

Allgemeines Verhalten​

  • Project folder. Run the commands from the folder that holds package.json or pyproject.toml, or pass --project-path. For a coded app inside a solution, that is the app's source/ folder.
  • Language. The language is not an option. An existing declarations file decides. Otherwise the SDK that the project depends on decides: @uipath/uipath-typescript in package.json selects TypeScript, and uipath or one of its framework packages (for example uipath-langchain) in pyproject.toml selects Python.
  • Kinds. --kind is one of asset, bucket, queue, process, entity, connection.
  • Bindings. The commands do not write bindings_v2.json. For a coded app, uip codedapp pack, uip codedapp push, uip solution pack, uip solution upload, and uip solution resources refresh derive the bindings from uipath_resources.ts. A bindings_v2.json already in the project is merged in for kinds that a declaration cannot express. Other project types keep their own bindings file: their packagers do not read the declarations file.
  • Folder. A resource declared without a folder is one that the solution creates. A resource declared with a folder is an existing resource in that tenant folder.

Hinzufügen​

Declare a resource in the project's declarations file. Without --skip-verify, the command looks the resource up in the tenant and takes its folder and type from there, which requires uip login. Without a name, the command opens a picker, which needs an interactive terminal.

When the project belongs to a local solution, add also adds the resource to the solution, as uip solution resources refresh does.

Argumente​

  • [name] (optional) — Resource name, as Orchestrator or Integration Service shows it. Required with --skip-verify, and when no interactive terminal is available.

Optionen​

LongWertStandardBeschreibung
--kind <kind>asset | bucket | queue | process | entity | connection–Resource kind. Required when a name is passed.
--folder-path <path>Pfad–Folder that the resource sits in. Omit it, or pass ., for a resource that the solution creates. For a connection, it narrows the lookup.
--type <type>textfrom the tenantAsset value type (text, integer, bool, credential, secret, json) or bucket provider (orchestrator, amazon, azure). For a process, the process kind, which is written as given. For a connection, the connector key (for example uipath-slack), which narrows the lookup. Queues and entities take no type.
--skip-verifyMarkierenausWrite the declaration as given, without looking the resource up. Use it offline, in CI, or for a resource that the solution creates. Needs the resource name. Does not apply to a connection.
--project-path <path>Pfadaktuelles VerzeichnisProject folder, the one with package.json or pyproject.toml.

A connection is declared by its ID and its connector key, and the name is only a label. The ID comes from the lookup, so a connection cannot be declared with --skip-verify.

Adding a resource that is already declared changes nothing in the file and returns Added: false.

Beispiele​

# An asset in a tenant folder; its type comes from the tenant
uip resources add InvoiceThreshold --kind asset --folder-path Finance/Shared

# A queue that the solution creates, without a tenant lookup
uip resources add InvoiceReview --kind queue --skip-verify

# An Integration Service connection, narrowed by connector
uip resources add "Finance Slack" --kind connection --type uipath-slack
# An asset in a tenant folder; its type comes from the tenant
uip resources add InvoiceThreshold --kind asset --folder-path Finance/Shared

# A queue that the solution creates, without a tenant lookup
uip resources add InvoiceReview --kind queue --skip-verify

# An Integration Service connection, narrowed by connector
uip resources add "Finance Slack" --kind connection --type uipath-slack

Datenform (--output json)​

{
  "Code": "ResourceDeclared",
  "Data": {
    "Added": true,
    "Kind": "asset",
    "Name": "InvoiceThreshold",
    "FolderPath": "Finance/Shared",
    "Type": "integer",
    "Field": "invoiceThreshold",
    "File": "uipath_resources.ts",
    "Solution": "Added"
  }
}
{
  "Code": "ResourceDeclared",
  "Data": {
    "Added": true,
    "Kind": "asset",
    "Name": "InvoiceThreshold",
    "FolderPath": "Finance/Shared",
    "Type": "integer",
    "Field": "invoiceThreshold",
    "File": "uipath_resources.ts",
    "Solution": "Added"
  }
}
FeldBeschreibung
Addedfalse when the same resource was already declared.
Kind, NameThe declared resource.
IdThe connection ID. Connections only.
FolderPathThe tenant folder. Absent for a resource that the solution creates.
TypeThe asset value type, bucket provider, process kind, or connector key. Absent when the resource has none.
FieldThe ProjectResources field that the declaration was written to. Absent when nothing was written.
FileThe declarations file: uipath_resources.ts or uipath_resources.py.
SolutionWhat happened in the project's solution: Added, Unchanged, Pending (the resource is not in the solution yet, and the next uip solution resources refresh or uip solution pack adds it), or NotInSolution (the project is not in a solution).

Fehlermodi​

  • A name without --kind, a --type that the kind does not take, an empty name, or --skip-verify without a name or with a connection. Fails with ValidationError, ErrorCode: invalid_argument, exit code 3.
  • No package.json or pyproject.toml in the project folder, or a project that depends on neither SDK. Fails with ErrorCode: invalid_argument. Instructions names --project-path or the SDK to install.
  • Not logged in. A lookup without a session fails with AuthenticationError, ErrorCode: authentication_required, exit code 2. Run uip login, or pass --skip-verify.
  • No resource with that name in the tenant, or not in the folder that --folder-path names. Fails with ErrorCode: not_found.
  • The name matches resources in more than one folder, or more than one connection. Fails with ErrorCode: invalid_argument. Instructions lists the folders, or the connectors, to pass.
  • --type differs from the declaration already in the file. Fails with ErrorCode: invalid_argument. Edit or remove the line in the file to change the type.
  • No name and no interactive terminal. Fails with ErrorCode: invalid_argument.

Liste​

List the resources declared in the project's declarations file. A declaration that the CLI cannot read, such as a value that is not a literal, is reported as a warning on stderr and left out. The command works offline.

Optionen​

LongWertStandardBeschreibung
--kind <kind>asset | bucket | queue | process | entity | connection–Only declarations of this kind.
--limit <number>Nummer50Number of declarations to return.
--offset <number>Nummer0Number of declarations to skip.
--project-path <path>Pfadaktuelles VerzeichnisProject folder, the one with package.json or pyproject.toml.

Beispiele​

uip resources list

uip resources list --kind queue
uip resources list

uip resources list --kind queue

Datenform (--output json)​

{
  "Code": "ResourceDeclarationList",
  "Data": [
    {
      "Kind": "asset",
      "Name": "InvoiceThreshold",
      "FolderPath": "Finance/Shared",
      "Type": "integer"
    },
    { "Kind": "queue", "Name": "InvoiceReview" }
  ],
  "Pagination": { "Returned": 2, "Limit": 50, "Offset": 0, "Total": 2 }
}
{
  "Code": "ResourceDeclarationList",
  "Data": [
    {
      "Kind": "asset",
      "Name": "InvoiceThreshold",
      "FolderPath": "Finance/Shared",
      "Type": "integer"
    },
    { "Kind": "queue", "Name": "InvoiceReview" }
  ],
  "Pagination": { "Returned": 2, "Limit": 50, "Offset": 0, "Total": 2 }
}

Data is an empty array when nothing is declared. A connection row also carries Id, and its Type is the connector key.


Synchronisieren​

Declare resources of the project's local solution in the project's declarations file. The command lists the solution resources that the project does not declare yet and opens a picker to choose from them. --all declares every listed resource without a picker.

A resource that the solution creates is declared without a folder. A resource that the solution imported from the tenant is declared with its tenant name and folder, which the command reads from the tenant.

Optionen​

LongWertStandardBeschreibung
--allMarkierenausDeclare every listed resource without a picker. Required when there is no interactive terminal.
--solution-folder <path>Pfadthe nearest .uipx above the projectSolution root folder, the one with the .uipx.
--project-path <path>Pfadaktuelles VerzeichnisProject folder, the one with package.json or pyproject.toml.

Beispiele​

uip resources sync --all

uip resources sync --all --project-path ./Invoices/App/source
uip resources sync --all

uip resources sync --all --project-path ./Invoices/App/source

Datenform (--output json)​

{
  "Code": "ResourcesSynced",
  "Data": {
    "Added": [
      { "Kind": "queue", "Name": "InvoiceReview", "Field": "invoiceReview" }
    ],
    "AlreadyDeclared": 2,
    "Unresolved": [],
    "File": "uipath_resources.ts"
  }
}
{
  "Code": "ResourcesSynced",
  "Data": {
    "Added": [
      { "Kind": "queue", "Name": "InvoiceReview", "Field": "invoiceReview" }
    ],
    "AlreadyDeclared": 2,
    "Unresolved": [],
    "File": "uipath_resources.ts"
  }
}
FeldBeschreibung
AddedThe declarations written, with the same fields as a list row plus Field.
AlreadyDeclaredNumber of solution resources that the project already declared.
UnresolvedImported resources whose tenant folder could not be read, for example without a session. Each entry carries Kind, Name, and Reason. These resources are not declared, and a warning on stderr names each one.
FileThe declarations file.

Without a session, the command cannot check whether a resource was imported from the tenant. Such a resource is declared as one that the solution creates, and a warning on stderr names it.

Fehlermodi​

  • No .uipx above the project. Fails with ErrorCode: not_found. Run the command inside a solution, or pass --solution-folder.
  • No --all and no interactive terminal. Fails with ErrorCode: invalid_argument.

  • uip solution resources — list, add, remove, edit, and refresh the resources of a solution.
  • uip codedapp — build, pack, and push the coded app that reads the declarations.

Siehe auch​

War diese Seite hilfreich?

Verbinden

Benötigen Sie Hilfe? Support(opens in new window)

Möchten Sie lernen? UiPath Academy(opens in new window)

Haben Sie Fragen? UiPath-Forum(opens in new window)

Auf dem neuesten Stand bleiben