-
1. Re: Creating the default domain configuration from the CLI
jaikiran Sep 13, 2011 9:47 AM (in response to chrishiner)Chris Hiner wrote:
The only parts that don't work currently:
/profile=default:add()
/profile=ha:add()
Is that this issue http://community.jboss.org/thread/172087?tstart=30?
-
2. Re: Creating the default domain configuration from the CLI
chrishiner Sep 13, 2011 9:51 AM (in response to jaikiran)Yes. I just created AS7-1801 for that, as I mentioned in that thread.
-
3. Re: Creating the default domain configuration from the CLI
emuckenhuber Sep 13, 2011 10:07 AM (in response to chrishiner)Chris Hiner wrote:
Yes. I just created AS7-1801 for that, as I mentioned in that thread.
Thanks. Yeah, that should be fixed.
In the meatime you could try to use the batch mode of the CLI - which would create a composite operation and only try to persist the complete model after all operations complete successfully. In order to do that you would need to add 'batch' and 'run-batch' to the script. I haven't tired myself, but perhaps you want to give that a try.
-
4. Re: Creating the default domain configuration from the CLI
chrishiner Sep 13, 2011 12:25 PM (in response to emuckenhuber)That does work:
batch
/profile=exampleprofile:add()
/profile=exampleprofile/subsystem=ee:add()
run-batch
While I'm on the subject of CLI profile management:
/profile=exampleprofile:remove()
"failure-description" => {"domain-failure-description" => "subsytems are not empty"},
Since many of the subsystems don't have remove() operations yet, it's not possible to remove profiles.
Would it make sense for removing a profile to just remove all the subsystems in it?
-
5. Re: Creating the default domain configuration from the CLI
emuckenhuber Sep 13, 2011 1:00 PM (in response to chrishiner)Chris Hiner wrote:
That does work:
batch
/profile=exampleprofile:add()
/profile=exampleprofile/subsystem=ee:add()
run-batch
Yes, that's what i meant.
Chris Hiner wrote:
While I'm on the subject of CLI profile management:
/profile=exampleprofile:remove()
"failure-description" => {"domain-failure-description" => "subsytems are not empty"},
Since many of the subsystems don't have remove() operations yet, it's not possible to remove profiles.
Would it make sense for removing a profile to just remove all the subsystems in it?
Yes, having to remove a profile wouldn't make sense, just to remove a single subsystem. Unfortunately most of the subsystem remove operations are missing. We already have a open jira issue to track that: https://issues.jboss.org/browse/AS7-470
-
6. Re: Creating the default domain configuration from the CLI
chrishiner Sep 13, 2011 1:30 PM (in response to emuckenhuber)I'm working towards completely automating the creation and updating of all the configuration information so I can tie it into our existing deployment system, like we've done for several other application servers.
I was thinking that until all the subsystems have remove operations (and writable attributes or other operations to configure everything), it'd be simplest to just remove the entire profile (and all the subsystems) and recreate it with the new options. About the same amount of scripting compared to reading the existing configuration and figuring out what has changed or needs to be changed.
-
7. Re: Creating the default domain configuration from the CLI
mylos78 Sep 16, 2011 2:49 AM (in response to chrishiner)Hello,
thanks for the useful post. Have you perhaps managed to add the messaging subsystem (contained in the preview configuration file) via the CLI ? I'd like to add and remove it using CLI scripts. Any help ?
Thanks in advance
Mylos
-
8. Re: Creating the default domain configuration from the CLI
emuckenhuber Sep 16, 2011 5:59 AM (in response to mylos78)The next release of AS7 should contain a lot more management operations, particular in the messaging subsystem.
-
9. Re: Creating the default domain configuration from the CLI
emuckenhuber Sep 16, 2011 6:03 AM (in response to chrishiner)sounds interesting, perhaps you can let use know how that works out for you.
One thing which might i should have mention regarding composite operations (or a batch in the CLI) is that in case there is failure we rollback the complete composite operation / batch. This might be interesting for you as well.
-
10. Re: Creating the default domain configuration from the CLI
chrishiner Sep 16, 2011 8:41 AM (in response to mylos78)I did some initial work on the preview configuration parts as well, but I found more gaps in the management interface there.
Here's a file with the messaging and webservices subsystems. I didn't test these as much as the non-preview stuff, so you might find some issues.
The messaging subsystem does have a remove operation:
/profile=ha/subsystem=messaging:remove()
The messaging subsystem has lots of operations available. Seems to be one of the more complete subsystems when it comes to management operations.
-
create_preview_config.txt.zip 989 bytes
-
-
11. Re: Creating the default domain configuration from the CLI
chrishiner Sep 27, 2011 10:58 AM (in response to chrishiner)In domain-controller/src/main/java/org/jboss/as/domain/controller/operations/ProfileRemoveHandler.java I commented out these lines:
if (context.readModel(PathAddress.EMPTY_ADDRESS).get(SUBSYSTEM).keys().size() > 0) { // TODO replace with a reasonable check
throw new OperationFailedException(new ModelNode().set("subsytems are not empty"));
}
Now I can remove the whole profile and rebuild it via my script to workaround not being able to remove subsystems.