How to get interface addresses using the Management CLI

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get interface addresses using the Management CLI

Misty Stanley-Jones
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@localhost:9999 /] :read-children-names(child-type=interface)
{
    "outcome" => "success",
    "result" => [
        "management",
        "public"
    ]
}



[domain@localhost:9999 /] :read-children-attributes(child-type=interface)
Failed to get the list of supported operation properties.


[domain@localhost:9999 /] :read-children-resources(child-type=interface)
{
    "outcome" => "success",
    "result" => {
        "management" => {
            "criteria" => undefined,
            "name" => "management"
        },
        "public" => {
            "criteria" => undefined,
            "name" => "public"
        }
    }
}



[domain@localhost:9999 interfaces] /interface=management:read-resource
{
    "outcome" => "success",
    "result" => {
        "criteria" => undefined,
        "name" => "management"
    }
}



[domain@localhost:9999 interfaces] /interface=management:read-children-resources
{
    "outcome" => "failed",
    "failure-description" => "child-type may not be null.",
    "rolled-back" => true
}



[domain@localhost:9999 interfaces] /interface=management:read-children-resources(recursive=true)
{
    "outcome" => "failed",
    "failure-description" => "child-type may not be null.",
    "rolled-back" => true
}




[domain@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
}



--
Misty Stanley-Jones, RHCE
Content Author, ECS Brisbane
☺: misty (Freenode IRC) ✉: [hidden email] ☏: + 61 7 3514 8105 ☏: 88105

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to get interface addresses using the Management CLI

Brian Stansberry
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@localhost:9999 /] cd interface=public
[standalone@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@localhost:9999 interface=public]
:read-attribute(name=resolved-address)
{
     "outcome" => "success",
     "result" => "127.0.0.1"
}
[standalone@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@localhost:9999 /] :read-children-names(child-type=interface)
> {
>      "outcome" =>  "success",
>      "result" =>  [
>          "management",
>          "public"
>      ]
> }
>
>
>
> [domain@localhost:9999 /] :read-children-attributes(child-type=interface)
> Failed to get the list of supported operation properties.
>
>
> [domain@localhost:9999 /] :read-children-resources(child-type=interface)
> {
>      "outcome" =>  "success",
>      "result" =>  {
>          "management" =>  {
>              "criteria" =>  undefined,
>              "name" =>  "management"
>          },
>          "public" =>  {
>              "criteria" =>  undefined,
>              "name" =>  "public"
>          }
>      }
> }
>
>
>
> [domain@localhost:9999 interfaces] /interface=management:read-resource
> {
>      "outcome" =>  "success",
>      "result" =>  {
>          "criteria" =>  undefined,
>          "name" =>  "management"
>      }
> }
>
>
>
> [domain@localhost:9999 interfaces] /interface=management:read-children-resources
> {
>      "outcome" =>  "failed",
>      "failure-description" =>  "child-type may not be null.",
>      "rolled-back" =>  true
> }
>
>
>
> [domain@localhost:9999 interfaces] /interface=management:read-children-resources(recursive=true)
> {
>      "outcome" =>  "failed",
>      "failure-description" =>  "child-type may not be null.",
>      "rolled-back" =>  true
> }
>
>
>
>
> [domain@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
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev