Dan Price wrote:
> On Sun 27 Apr 2008 at 06:00PM, Stephen Hahn wrote:
>
>>>>
>>>>
>>> Excellent, thank you. I have put together a JSON interface available
>>> to any HTTP capable client for remote installation of packages. I
>>> typically manage about 100 systems. The ability for me to install
>>> from one server will save me quite a bit of time. I had something
>>> similar with the old packaging system but the commands were too
>>> verbose and asked too many questions. So far the new system is much
>>> better for me on this issue.
>>>
>> So, since you're one of the first people to attempt to automate use of
>> pkg(1), what output would you like to see, or to see omitted? (We are
>> in complete accord about "no questions".) Dan has already made the
>> output sensitive to whether it is outputting to a tty or not, but
>> further output modifications are certainly possible.
>>
>
> Also, it would be lovely if you could share the code.
>
>
I can and I will as soon as more of it is working.
> I'm a little fuzzy on what you're doing here (is it "push" or "pull"?)
> but it seems like something that many other folks might be interested
> in. I'd like to see it, if only to study it in terms of gathering
> requirements.
>
It is push. Each target has a secure web service that can be secured
with various security policies(Mostly about the authentication)
Here are a few samples ( I have not enabled Client side SSL certs
and authentication tokens on the REST call)
Get info on a package ( the option format is for debugging,
normally you get back a mime type of application/json)
I start an advanced web server tool kit on a target node with
java -jar ..... (Supports SSL, client side SSL and
Authentication tokens, turned off for development)
http://bco21.central.sun.com:9081/install.html?pkg=SUNWzsh
( needs to be cleaned up, get rid of html, do true REST)
This is what you get back a applicaton/json mime type file (the
.html name will change)
{ "stdout":"Download: SUNWzsh ... Done\nInstall Phase ...
Done\n","stderr":"","code":"0" }
http://bco21.central.sun.com:9081/getinfo.html?pkg=SUNWzsh&format=jsontext
( Displays the response on the web page, a service would not specify
format)
{
"Branch": "0.86",
"stdout": " Name: SUNWzsh\n Summary: Z shell (zsh)\n
State: Installed\n Authority: opensolaris.org (preferred)\n Version:
4.3.4\n Build Release: 5.11\n Branch: 0.86\nPackaging Date: Tue Apr 22
22:50:41 2008\n Size: 4.0 MB\n FMRI: pkg:/[EMAIL
PROTECTED],5.11-0.86:20080422T225041Z\n",
"stderr": "",
"code": "0",
"Packaging Date": "Tue Apr 22 22:50:41 2008",
"Summary": "Z shell (zsh)",
"Name": "SUNWzsh",
"State": "Installed",
"Authority": "opensolaris.org (preferred)",
"Version": "4.3.4",
"Build Release": "5.11",
"FMRI": "pkg:/[EMAIL PROTECTED],5.11-0.86:20080422T225041Z",
"Size": "4.0 MB"
I didn't provide the uninstall syntax. If this is interesting and useful
to you I will set up another machine with your own version. I will
eventually lock bco21 down. Once you have this service up any web developer
using standard widgets like YUI, Dojo, can develop custom applications
using the authority and the target node.
I have YUI examples for paginating through the 1000+ entries but I need to find
more
meta data to make make it interesting. Is it ever necessary to show depedency
data?
Is dependency information available?
Rinaldo
}
> As an aside, I'd like every command to have a parseable output mode; for
> now, the command output is highly unstable, and we've been changing it
> pretty regularly: just be warned :)
>
Noted and not a problem. I think I will add some startup tests to
verify that known things are
returning expected results.
> -dp
>
>
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss