9.38. fabric:profile-edit
Abstract
Synopsis
fabric:profile-edit
[
--help
] [[
-p
] | [
--pid
]PID
] [[
-r
] | [
--repository
] | [
-f
] | [
--feature
] | [
-b
] | [
--bundle
] | [
-c
] | [
--config
] | [
-s
] | [
--system
] | [
-o
] | [
--overrides
] | [
-l
] | [
--lib
] | [
-n
] | [
--endorsed
] | [
-x
] | [
--extension
]] [[
--set
] | [
--delete
]] [[
--append
] | [
--remove
]] [
--import-pid
] [[
--delimiter
]delim
] [[
--resource
]ResourceName
] {
Profile
} [
Version
]
Description
- Feature repository locations—to add a feature repository to the profile, enter a command in the following format:
fabric:profile-edit --repository RepoURL Profile [Version]
For example, to add thefuse-fabric
feature repository to the profile, enter a command like the following:fabric:profile-edit --repository mvn:io.fabric8/fuse-fabric/6.2.1.redhat-084/xml/features Profile [Version]
To delete repositories, enter a command of the following form:fabric:profile-edit --delete --repository RepoURL Profile [Version]
To edit repository locations directly, using a visual text editor, enter the following command:fabric:profile-edit Profile [Version]
The visual editor opens, showing the contents of the specified profile's agent properties. To edit the repository settings, add, modify, or delete lines of the following form:repository.ID=URL
WhereID
is an arbitrary unique identifier andURL
gives the location of a single feature repository. Only one repository URL can be specified on each line. - Features to install—to add features to the profile, enter a command in the following format:
fabric:profile-edit --feature FeatureName Profile [Version]
To add multiple features, you can specify the--feature
flag multiple times in this command. For example, to add thecamel-jetty
and thecamel-quartz
features to the default version of thesample
profile, enter a command like the following:fabric:profile-edit --feature camel-jetty --feature camel-quartz sample
To delete features, enter a command of the following form:fabric:profile-edit --delete --feature FeatureName Profile [Version]
To edit features directly, using the visual text editor, enter the following command:fabric:profile-edit Profile [Version]
The visual editor opens, showing the contents of the specified profile's agent properties. To edit the features, add, modify, or delete lines of the following form:feature.ID=FeatureName
WhereID
is an arbitrary unique identifier andFeatureName
is the name of a feature. - Bundles to install—to add bundles to the profile, enter a command in the following format:NoteThe fabric:profile-edit command supports two flag variations for specifying bundles—
--bundle
and--bundles
. The--bundles
flag is included for backwards compatibility. Regardless of which variation you use, to specify multiple bundles on the same command line, you must include the flag with each bundle specification.fabric:profile-edit --bundle BundleURL Profile [Version]
For example, to addcamel-quartz
bundle to thesample
profile, enter a command like the following:fabric:profile-edit --bundle mvn:org.apache.camel/camel-quartz/2.15.1.redhat-621084 sample
To delete bundles, enter a command of the following form:fabric:profile-edit --delete --bundle BundleURL Profile [Version]
To edit bundles directly, using the visual text editor, enter the following command:fabric:profile-edit Profile [Version]
The visual editor opens, showing the contents of the specified profile's agent properties. To edit the bundles, add, modify, or delete lines of the following form:bundle.ID=URL
WhereID
is an arbitrary unique identifier andURL
specifies the bundle's location. - Configuration settings for the OSGi Config Admin service—to modify or create a configuration setting from the OSGi Config Admin service, enter a command in the following format:
fabric:profile-edit --pid PID/Property=Value Profile [Version]
Where PID is a persistent ID, which is used in the context of the OSGi Config Admin service to identify a collection of related properties. For example, to change the value of the secure HTTPS port used by the Jetty server in thesample
profile, you could edit theorg.osgi.service.http.port.secure
property from theorg.ops4j.pax.web
PID using a command like the following:fabric:profile-edit --pid org.ops4j.pax.web/org.osgi.service.http.port.secure=8553 sample
To delete a property, enter a command of the following form:fabric:profile-edit --delete --pid PID/Property Profile [Version]
If the value of the PID property has the form of a comma-separated list, you can use the--append
option and the--remove
option to manipulate the list value. For example:fabric:profile-edit --pid org.example.foo/my.prop=a Profile [Version] fabric:profile-edit --append --pid org.example.foo/my.prop=b Profile [Version] fabric:profile-edit --append --pid org.example.foo/my.prop=c Profile [Version] fabric:display Profile ... PID: org.example.foo my.prop a,b,c
To edit OSGi Config Admin settings directly, using the visual text editor, enter the following command:fabric:profile-edit --pid PID Profile [Version]
The visual editor opens, showing the contents of the specified profile'sPID.properties
file (which is actually stored in the ZooKeeper registry). To edit the properties, add, modify, or delete lines of the following form:Property=Value
- Property settings from etc/config.properties—to modify or create a Java system property in the container's
etc/config.properties
file (which affects the container), enter a command in the following format:fabric:profile-edit --config Property=Value Profile [Version]
For example, to change the value of thekaraf.startlevel.bundle
Java system property inconfig.properties
, you would enter a command like the following:fabric:profile-edit --config karaf.startlevel.bundle=80 Profile [Version]
To delete a Java system property fromconfig.properties
, enter a command of the following form:fabric:profile-edit --delete --config Property Profile [Version]
If the value of the configuration property has the form of a comma-separated list, you can use the--append
option and the--remove
option to manipulate the list value. For example:fabric:profile-edit --config my.prop=a Profile [Version] fabric:profile-edit --append --config my.prop=b Profile [Version] fabric:profile-edit --append --config my.prop=c Profile [Version] fabric:display Profile ... Config Properties : my.prop = a, b, c
To edit the Java system properties directly, using the visual text editor, enter the following command:fabric:profile-edit Profile [Version]
The visual editor opens, showing the contents of the specified profile's agent properties. To edit the Java system properties (analogous toetc/config.properties
), add, modify, or delete lines of the following form:config.Property=Value
- Property settings from etc/system.properties—to modify or create a Java system property in the container's
etc/system.properties
file (which affects bundles deployed in the container), enter a command in the following format:fabric:profile-edit --system Property=Value Profile [Version]
For example, to change the default port for the OSGi HTTP service, you would enter a command like the following:fabric:profile-edit --system org.osgi.service.http.port=8181 Profile [Version]
If the system property,Property
, is already set at the JVM level (for example, through the--jvm-opts
option to thefabric:container-create
command), the precedingfabric:profile-edit
command will not override the JVM level setting. If you want to override the JVM level setting, you must indicate this explicitly by adding thekaraf.override
prefix to the property name,Property
—for example:fabric:profile-edit --system karaf.override.Property=Value Profile [Version]
To delete a Java system property fromsystem.properties
, enter a command of the following form:fabric:profile-edit --delete --system Property Profile [Version]
If the value of the system property has the form of a comma-separated list, you can use the--append
option and the--remove
option to manipulate the list value. For example:fabric:profile-edit --system my.prop=a Profile [Version] fabric:profile-edit --append --system my.prop=b Profile [Version] fabric:profile-edit --append --system my.prop=c Profile [Version] fabric:display Profile ... System Properties : my.prop = a, b, c
To edit the Java system properties directly, using the visual text editor, enter the following command:fabric:profile-edit Profile [Version]
The visual editor opens, showing the contents of the specified profile's agent properties. To edit the Java system properties (analogous toetc/system.properties
), add, modify, or delete lines of the following form:system.Property=Value
If you want to ensure that this setting overrides any JVM level setting, set the system property as follows:system.karaf.override.Property=Value
fabric:profile-edit
are immediately propagated to the containers that use that profile. This is not the recommended way to edit profiles, however: if you change multiple settings in the profile, you could potentially put the affected containers into an inconsistent state. To guarantee atomicity, it is better to use the fabric:profile-edit
command in combination with the fabric:container-upgrade
command—see fabric:container-upgrade.
Enclosing an Option Value in Quotes
http.nonProxyHosts="myserver1|myserver2"
, on the default
profile, you would use the following command:
fabric:profile-edit --system "karaf.override.http.nonProxyHosts=\"myserver1|myserver2\"" default
karaf.override
prefix is prepended to the property name, because http.nonProxyHosts
is already set at the JVM level and needs to be overridden.
Arguments
Argument | Interpretation |
---|---|
--help | Displays the online help for this command |
-p, --pid | Edit an OSGi configuration property, specified in the format PID/Property. To specify multiple values, specify this flag multiple times on the command line—for example, --pid PID/Property=Value --pid PID/Property=Value . |
-r, --repository | Add (or delete) a feature repository. To specify multiple values, specify this flag multiple times on the command line—for example, --repository foo --repository bar . |
--repositories | Deprecated. |
-f, --feature | Add (or delete) a feature. To specify multiple values, specify this flag multiple times on the command line—for example, --feature foo --feature bar . |
--features | Deprecated. |
-b, --bundle | Add (or delete) a bundle. To specify multiple values, specify this flag multiple times on the command line—for example, --bundle foo --bundle bar . |
--bundles | Deprecated. |
-c, --config | Edit the Java system properties that affect the container (analogous to editing etc/config.properties in a root container). To edit multiple configuration properties, specify this flag multiple times on the command line—for example, --config Property=Value --config Property=Value . |
-s, --system | Edit the Java system properties that affect installed bundles (analogous to editing etc/system.properties in a root container). To edit multiple system properties, specify this flag multiple times on the command line—for example, --system Property=Value --system Property=Value . |
-o, --overrides | Add (or delete) a bundle override. A bundle override can be used to override the bundle version installed by a feature. For example, if a feature installs version 1.0.0 of a particular bundle, you could use a bundle override to install version 1.0.1 of the bundle instead. To specify multiple values, specify this flag multiple times on the command line—for example, --overrides BundleURL --overrides BundleURL . |
-l, --lib | Add (or delete) a library. To specify multiple values, specify this flag multiple times on the command line—for example, --lib LibURL --lib LibURL . |
--libs | Deprecated. |
-n, --endorsed | Add (or delete) an endorsed library. To specify multiple values, specify this flag multiple times on the command line—for example, --endorsed LibURL --endorsed LibURL . |
-x, --extension | Add (or delete) an extension library. To specify multiple values, specify this flag multiple times on the command line—for example, --extension LibURL --extension LibURL . |
--set | Set or create values (selected by default). |
--delete | Delete values. |
--append | When editing list values, append the specified value to the list. Can only be used in combination with the --config , --system , and --pid options. |
--remove | When editing list values, remove the specified value from the list. Can only be used in combination with the --config , --system , and --pid options. |
--delimiter | Specifies the delimiter to use in combination with the --append and --remove options. Default is , (comma). |
--resource | When editing with the visual text editor, specifies the name of the resource to edit. |
-i, --import-pid | Imports the PIDs that are edited, from local OSGi Config Admin. |
Profile | (Required) Name of the profile to edit. |
Version | Version of the profile to edit. Defaults to the current default version (use version-list to find the current default). |