[jboss-as7-dev] How to get interface addresses using the Management CLI
Brian Stansberry
brian.stansberry at redhat.com
Tue Nov 1 21:37:46 EDT 2011
The attribute is named "resolved-address". It's a runtime attribute so
it does not show up in :read-resource by default. You have to add the
"include-runtime" parameter.
./jboss-admin.sh --connect
Connected to standalone controller at localhost:9999
[standalone at localhost:9999 /] cd interface=public
[standalone at localhost:9999 interface=public]
:read-resource(include-runtime=true)
{
"outcome" => "success",
"result" => {
"any" => undefined,
"any-address" => undefined,
"any-ipv4-address" => undefined,
"any-ipv6-address" => undefined,
"criteria" => [("inet-address" => expression
"${jboss.bind.address:127.0.0.1}")],
"inet-address" => expression "${jboss.bind.address:127.0.0.1}",
"link-local-address" => undefined,
"loopback" => undefined,
"loopback-address" => undefined,
"multicast" => undefined,
"name" => "public",
"nic" => undefined,
"nic-match" => undefined,
"not" => undefined,
"point-to-point" => undefined,
"public-address" => undefined,
"resolved-address" => "127.0.0.1",
"site-local-address" => undefined,
"subnet-match" => undefined,
"up" => undefined,
"virtual" => undefined
}
}
[standalone at localhost:9999 interface=public]
:read-attribute(name=resolved-address)
{
"outcome" => "success",
"result" => "127.0.0.1"
}
[standalone at localhost:9999 interface=public]
On 10/31/11 7:47 PM, Misty Stanley-Jones wrote:
> I am trying to find a way to get the addresses of the interfaces using the Management CLI. I thought this would be easy! I have tried all of these ways:
>
> [domain at localhost:9999 /] :read-children-names(child-type=interface)
> {
> "outcome" => "success",
> "result" => [
> "management",
> "public"
> ]
> }
>
>
>
> [domain at localhost:9999 /] :read-children-attributes(child-type=interface)
> Failed to get the list of supported operation properties.
>
>
> [domain at localhost:9999 /] :read-children-resources(child-type=interface)
> {
> "outcome" => "success",
> "result" => {
> "management" => {
> "criteria" => undefined,
> "name" => "management"
> },
> "public" => {
> "criteria" => undefined,
> "name" => "public"
> }
> }
> }
>
>
>
> [domain at localhost:9999 interfaces] /interface=management:read-resource
> {
> "outcome" => "success",
> "result" => {
> "criteria" => undefined,
> "name" => "management"
> }
> }
>
>
>
> [domain at localhost:9999 interfaces] /interface=management:read-children-resources
> {
> "outcome" => "failed",
> "failure-description" => "child-type may not be null.",
> "rolled-back" => true
> }
>
>
>
> [domain at localhost:9999 interfaces] /interface=management:read-children-resources(recursive=true)
> {
> "outcome" => "failed",
> "failure-description" => "child-type may not be null.",
> "rolled-back" => true
> }
>
>
>
>
> [domain at localhost:9999 interfaces] /interface=management:read-children-resources(child-type=inet-address)
> {
> "outcome" => "failed",
> "failure-description" => "No known child type named inet-address",
> "rolled-back" => true
> }
>
>
>
--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
More information about the jboss-as7-dev
mailing list