[wildfly-dev] HTTP Management API

Arun Gupta arun.gupta at gmail.com
Wed Jan 8 00:46:25 EST 2014


I realized I was doing something basic incorrectly ;)

For a standalone instance, should it not show the default data source:

-- cut here --
[standalone at localhost:9990 subsystem=datasources] ls

data-source

jdbc-driver

xa-data-source

installed-drivers=[{"driver-name" => "h2","deployment-name" =>
undefined,"driver-module-name" => "com.h2database.h2","module-slot" =>
"main","driver-datasource-class-name" =>
"","driver-xa-datasource-class-name" =>
"org.h2.jdbcx.JdbcDataSource","driver-class-name" =>
"org.h2.Driver","driver-major-version" => 1,"driver-minor-version" =>
3,"jdbc-compliant" => true}]
-- cut here --

How do I know which commands are targeted to domain host controller ?

product-name, product-version, profile-name are returning "undefined".

Is there a typical set of operations that can be incorporated in a
WildFly hands-on lab for standalone and domain host controller ?

Arun

On Tue, Jan 7, 2014 at 6:13 PM, Brian Stansberry
<brian.stansberry at redhat.com> wrote:
> Are you connecting to a domain host controller? The examples are for a
> standalone server.
>
> On 1/7/14, 7:24 PM, Arun Gupta wrote:
>> Hi there ...
>>
>> I'm trying some samples from:
>>
>> https://docs.jboss.org/author/display/WFLY8/The+HTTP+management+API
>>
>> and have questions/comments.
>>
>> 1). First one is giving:
>>
>> curl --digest -L -D - http://localhost:9990/management --header
>> "Content-Type: application/json" -d
>> '{"operation":"read-attribute","name":"server-state","json.pretty":1}'
>> -u u3:p3
>> HTTP/1.1 401 Unauthorized
>> Connection: keep-alive
>> WWW-Authenticate: Digest
>> realm="ManagementRealm",domain="/management",nonce="n6l3IRhNwTwNMTM4OTE0MjA3MTE4N55G54PM/ll8QrzSK+RrvTM=",opaque="00000000000000000000000000000000",algorithm=MD5
>> Content-Length: 77
>> Content-Type: text/html
>>
>> HTTP/1.1 500 Internal Server Error
>> Connection: keep-alive
>> Authentication-Info:
>> nextnonce="I7Yrew1s+j4NMTM4OTE0MjA3MTE4NxXgrLGjS/rWgbUveRrchio="
>> Content-Type: text/plain;utf-8
>> Content-Length: 128
>>
>> {
>>      "outcome" : "failed",
>>      "failure-description" : "JBAS014792: Unknown attribute server-state",
>>      "rolled-back" : true
>> }
>>
>> http://wildscribe.github.io/Wildfly/8.0.0.CR1/index.html shows
>> server-state as a valid attribute.
>>
>> Similar error for:
>>
>> "JBAS014792: Unknown attribute profile-name"
>>
>> Reading product-name and product-version returns:
>>
>> {"outcome" : "success", "result" : null}
>>
>> "name" attribute returns:
>>
>> {"outcome" : "success", "result" : "Unnamed Domain"}
>>
>> 2). curl --digest -L -D - http://localhost:9990/management --header
>> "Content-Type: application/json" -d
>> '{"operation":"whoami","json.pretty":1}' -u u3:p3
>>
>> does not return pretty JSON and instead returns:
>>
>> {"outcome" : "success", "result" : {"identity" : {"username" : "u3",
>> "realm" : "ManagementRealm"}}}
>>
>> release-name and release-version returned correct values.
>>
>> 3). I think a restart-server operation would be useful.
>>
>> 4). Why is the following command failing:
>>
>>   curl --digest -D - http://localhost:9990/management --header
>> "Content-Type: application/json" -d '{"operation":"read-resource",
>> "address":["subsystem","data-sources"], "json.pretty":1}' -u u3:p3
>> HTTP/1.1 401 Unauthorized
>> Connection: keep-alive
>> WWW-Authenticate: Digest
>> realm="ManagementRealm",domain="/management",nonce="2oB+bvt990QNMTM4OTE0MzQ4Nzc0NkxPJHWOl6yAkN/F7PGdbYo=",opaque="00000000000000000000000000000000",algorithm=MD5
>> Content-Length: 77
>> Content-Type: text/html
>>
>> HTTP/1.1 500 Internal Server Error
>> Connection: keep-alive
>> Authentication-Info:
>> nextnonce="JXNHCPPtBVwNMTM4OTE0MzQ4Nzc0N5YLxVykiaapgV5zTDnV++I="
>> Content-Type: text/plain;utf-8
>> Content-Length: 184
>>
>> {
>>      "outcome" : "failed",
>>      "failure-description" : "JBAS014883: No resource definition is
>> registered for address [(\"subsystem\" => \"data-sources\")]",
>>      "rolled-back" : true
>> }
>>
>> Even though there is a default data source already registered. The
>> management model
>>
>> Either I'm not doing something basic correctly, the management model
>> is out of sync, or the API is not fully implemented.
>>
>> Comments ?
>>
>> Thanks,
>> Arun
>>
>
>
> --
> Brian Stansberry
> Senior Principal Software Engineer
> JBoss by Red Hat
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev



-- 
http://blog.arungupta.me
http://twitter.com/arungupta


More information about the wildfly-dev mailing list