2.15.2 create-resource-ref
Creates a reference to a resource.
Synopsis
asadmin [asadmin-options] create-resource-ref [--help] [--target target] [--enabled={false|true}] reference_name
Storage location
Application Server installation directory/javaee/glassfish/bin
Function
The create-resource-ref subcommand creates a reference from a cluster or an unclustered server instance to a previously created resource. The target instance or instances making up the cluster need not be running or available for this subcommand to succeed. If one or more instances are not available, they will receive the new resource the next time they start.
This subcommand is supported in remote mode only.
Precondition
DAS has to be in a running state.
Arguments
- --help | -?
-
Displays the help text for the subcommand.
- --target target
-
Specifies the target for which you are creating the resource reference.
Type: String
The following values can be specified:
-
server
Creates the resource reference for the default server instance. This is the default target.
-
cluster_name
Creates the resource reference for every server instance in the cluster.
-
instance_name
Creates the resource reference for the named unclustered server instance.
Default value: server
-
- --enabled={false|true}
-
Indicates whether the resource should be enabled. This value will take effect only if the resource is enabled at the global level.
Type: Boolean
The following values can be specified:
-
true
-
false
Default value: true
-
- reference_name
-
Specifies the name or JNDI name of the resource.
Type: String
The following values can be specified:
-
Name or JNDI name of the resource
Default value: N/A
-
Examples
The following example creates a reference to the JDBC resource named jdbc/DerbyPool on the cluster Cluster1.
asadmin create-resource-ref --target Cluster1 jdbc/DerbyPool
Exit Status
Exit Status |
Explanation |
---|---|
0 |
command executed successfully. |
1 |
error in executing the command. |