p4 extension
Manage the Helix Core Server extensibility mechanism.
Syntax
p4 extension --sample extName
p4 extension --package dir
p4 extension --install extName.p4-extension [--yes]
p4 extension --delete extFQN [ --name instName ] [ --revision=n ]
[ --path filespec ] [--yes]
p4 extension --configure extFQN [ --revision=n ] [ -o | -i ]
p4 extension --configure extFQN [ --revision=n ] [ -o | -i
--name instName
p4 extension --run instName [ extArguments ]
p4 extension --list --type type
Description
p4 extension manages the installation, versioning, and configuration of Helix Core Server Extensions.
Extensions provide a way to customize the behavior of the Helix Core Server with user-supplied logic. Extensions are self-contained packages of third-party code and assets run within the Helix Core Server. Extensions can be used for many use cases, such as change submission validation, form validation, external authentication, external job fix integration, external archive integration, and command policies. For a list of events that Extensions can register for, see the list of trigger types in the output of p4 help triggers
.
Extensions coexist with triggers (see p4 triggers), but offer more functionality. The Helix Core Server runs Extensions natively, without relying on external processes, so Extensions provide a portable, versioned runtime with automatic replication and a programmatic API.
Extensions are versioned within the Helix Core Server and are stored in a special depot, named .p4-extensions
by default. The extension depot is only accessible to the super user and by read-only commands. The extension depot is created automatically.
Installing or upgrading an Extension creates a changelist with information about pre- and post-install versions.
An Extension can implement custom commands that a user can run. For example,
p4 extension --run myInstanceConfig validateFileSize pathToFile
where validateFileSize
represents a custom command and pathToFile
represents an argument that is relevant to the custom command.
Configuration and access
After installation, Extensions must be configured before use.
Firstly, the super user runs p4 extension --configure extName
to supply various global details about the Extension's configuration, such as the list of groups whose members can create instances of the Extension, or Extension runtime limits.
Secondly, the super user uses the --configure
and --name
options together to create a named instance of the Extension, parameterizing the Extension to be run with specific settings. The --name
option takes the name of the configuration to create or modify and the --configure
option takes the name of the Extension.
For an extension to be active, it must have a global configuration and at least one instance configuration. See the --configure
option. An Extension can have multiple configurations, depending on the events it registers for. Each configuration of an Extension can point to a different version of the Extension.
Naming rules
Extensions are referred to by their Fully-Qualified Name (extFQN
). This is the combination of the Extension's namespace, name, and optional depot file revision. For example,
- a namespace of
ExampleInc
and name ofextName
would be referred to asExampleInc::extName
- with a revision of
6
, the combination would beExampleInc::extName#6
Extensions are referred to by their fully-qualified name. This is the combination of the namespace, name, and, optionally, the revision of the Extension that is installed on a server (as opposed to the version of the extension code). For example, a namespace of ExampleInc
and a name of ExtName
would be referred to as ExampleInc::ExtName
For more information about Extensions, see p4 help serverextensionintro and Helix Core Extensions Developer Guide.
Options
--sample |
Creates a skeleton of a new Extension. The argument is the name of the Extension to create as well as the name of the local directory where the files are placed. The sample Extension has placeholder values that should be replaced when developing the code. (See Naming rules.) |
--package |
Creates a packaged Extension file from the named directory of files, preparing it for Packaging is done client-side and requires a version 2020.1 or later command-line client. |
--install |
The |
--name |
The name of the instance configuration to create or modify. |
--revision |
Which depot version of the Extension to
configure. The default is the head revision. This option applies to the
--configure option. This flag applies to the |
--configure
|
The
To create a global configuration, use To create an instance configuration, use the The |
--list |
Displays information about installed Extensions. The value of the
Adding the |
--delete |
Deletes an extension, its configurations, or both.
|
--run |
Executes the Extension-supplied command. An Extension can implement its own end-user commands that behave similarly to native Helix Core commands in that they can have tagged output, send RPC-level messages, and open forms client-side. However, Extension-supplied commands are restricted to reporting output and cannot access client-side content. The |
Usage Notes
Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
---|---|---|
N/A |
N/A |
|