control-center/serviced — pull request #1021 by wplu (2014-09-13 04:45:51+00:00)
Title: allow service specifier to suffix match path in service tree

This enhancement is helpful if a deployment has hierarchical services like, multiple zenoss collectors. It allows the user to start/stop 'collector1' collector easily with 'serviced service start collector1' and 'serviced service stop collector1'

DEMO:
```
# plu@plu-9: serviced service list
NAME	SERVICEID	INST	IMAGEID	POOL	DSTATE	LAUNCH	DEPID
└─Zenoss.core.full	2zg7c7hmk0cgw5rk9yzeg2k54	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─zenactiond	2pz01ugrccg8if0jajte5u1ka	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─zeneventserver	58128zxxcmg1bszac50brjgmv	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─localhost	5ii3qc8on22zt2bqk2sjkkx1o	0	default	0	auto	HBase
│ ├─zenhub	3n9tau98plrqizghcakyc6doh	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ └─localhost	f0j7svnrywq00c40gaqlgoi7g	0	default	0	auto	HBase
│ ├─zenstatus	110aurudghsd75mz0x5607xqa	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zentrap	1v7vb1fxo5mn33qnnjncohqbr	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zminion	38q5hrdpqu0bawge5uk7rwxlh	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zenperfsnmp	3vflja392kksdgkujtlzsfj7b	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zensyslog	4if1oq68u8dqd92cpegz242jp	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zenmodeler	5e2tgcqsfk5nlhxpbsnnmzfwc	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zenping	7e2l1wb5yoxek0t60wx0408dn	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zenprocess	7xwzygd4ahypeh4n6cnec9qh3	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zenjmx	8xvc5w7etlet0k7j6fli4iswi	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zencommand	anzd11zr7gquqzfinz0ngj5nl	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─MetricShipper	b7swbk35kzo03yfaj7cow2kwd	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ ├─zenpython	bh7q8bq66wszv9b4gpgxehp9k	1	.../2zg7c7h.../devimg	default	0	auto	HBase
│ └─collectorredis	dcmp0xaz9w1gd2mpbe2rmulbx	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─zeneventd	62fihtydiuhq2ucnmsf3f7t79	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─MetricShipper	6ti5jbyh6xftweeobwmguxk6r	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─RabbitMQ	7utdjol9id78gb1q788izd2c2	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─Zope	89z8xxzh6o7ltx2yemf3w91yd	2	.../2zg7c7h.../devimg	default	0	auto	HBase
├─CentralQuery	8sw840zqs9d9ohfksakgzn6tm	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─MySQL	8uth3wzcnrtn32azn0s2lgjuf	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─opentsdb	9vrunxcdw10hlcuga7bobu9m3	0	default	0	auto	HBase
│ ├─writer	3nvi1ujzjp2r0mb8ocq5ytj86	1	.../2zg7c7h.../opentsdb	default	0	auto	HBase
│ └─reader	aq6wn22m2jqlwqcsgxvv1vru3	1	.../2zg7c7h.../opentsdb	default	0	auto	HBase
├─redis	9y8tp5ysg64w2hpola5twauzi	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─zenjobs	beh5xyjls2x9iehm7u470dqyg	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─Zauth	d0oyxb1p5rw3api86v4gh7pl8	1	.../2zg7c7h.../devimg	default	0	auto	HBase
├─HBase	d5cnp53f4935x1zd1wb9dwkke	0	default	0	auto	HBase
│ ├─HMaster	aaqczfvj0dzmjxstb0tl7x38m	1	.../2zg7c7h.../hbase	default	0	auto	HBase
│ ├─RegionServer	c843hspfvk498wurzafltm5hw	3	.../2zg7c7h.../hbase	default	0	auto	HBase
│ └─ZooKeeper	dcl8zjwicylinzvmp8bf4m784	3	.../2zg7c7h.../hbase	default	0	auto	HBase
├─MetricConsumer	eyicjjyu2njzrgoo7rbio8rf4	1	.../2zg7c7h.../devimg	default	0	auto	HBase
└─memcached	jej5try1sso1bqa8xf04a0es	1	.../2zg7c7h.../devimg	default	0	auto	HBase

# plu@plu-9: serviced service list metricshipper
NAME	SERVICEID	DEPID	POOL/PATH
MetricShipper	6ti5jbyh6xftweeobwmguxk6r	HBase	default/zenoss.core.full/metricshipper
MetricShipper	b7swbk35kzo03yfaj7cow2kwd	HBase	default/zenoss.core.full/localhost/localhost/metricshipper
multiple results found; select one from list

# plu@plu-9: serviced service list localhost/metricshipper | head
{
"ID": "b7swbk35kzo03yfaj7cow2kwd",
"Name": "MetricShipper",
"Title": "",
"Version": "",
"Context": null,
"Startup": "su - zenoss -c \"cd /opt/zenoss \u0026\u0026 /bin/supervisord -n -c etc/metricshipper/supervisord.conf\"",
"Description": "Relay metric data to CentralQuery",
"Tags": [
"daemon",
```

DEMO:
```
# plu@plu-9: serviced -v=2 service list metricshipper
I0912 23:36:21.225904 26490 service.go:331] service: Zenoss.core.full 2zg7c7hmk0cgw5rk9yzeg2k54 path: zenoss.core.full
I0912 23:36:21.226112 26490 service.go:331] service: HMaster aaqczfvj0dzmjxstb0tl7x38m path: zenoss.core.full/hbase/hmaster
I0912 23:36:21.226142 26490 service.go:331] service: reader aq6wn22m2jqlwqcsgxvv1vru3 path: zenoss.core.full/opentsdb/reader
I0912 23:36:21.226171 26490 service.go:331] service: writer 3nvi1ujzjp2r0mb8ocq5ytj86 path: zenoss.core.full/opentsdb/writer
I0912 23:36:21.226200 26490 service.go:331] service: opentsdb 9vrunxcdw10hlcuga7bobu9m3 path: zenoss.core.full/opentsdb
I0912 23:36:21.226228 26490 service.go:331] service: HBase d5cnp53f4935x1zd1wb9dwkke path: zenoss.core.full/hbase
I0912 23:36:21.226261 26490 service.go:331] service: Zope 89z8xxzh6o7ltx2yemf3w91yd path: zenoss.core.full/zope
I0912 23:36:21.226302 26490 service.go:331] service: Zauth d0oyxb1p5rw3api86v4gh7pl8 path: zenoss.core.full/zauth
I0912 23:36:21.226344 26490 service.go:331] service: zenjobs beh5xyjls2x9iehm7u470dqyg path: zenoss.core.full/zenjobs
I0912 23:36:21.226389 26490 service.go:331] service: zeneventd 62fihtydiuhq2ucnmsf3f7t79 path: zenoss.core.full/zeneventd
I0912 23:36:21.226432 26490 service.go:331] service: MySQL 8uth3wzcnrtn32azn0s2lgjuf path: zenoss.core.full/mysql
I0912 23:36:21.226465 26490 service.go:331] service: RegionServer c843hspfvk498wurzafltm5hw path: zenoss.core.full/hbase/regionserver
I0912 23:36:21.226496 26490 service.go:331] service: ZooKeeper dcl8zjwicylinzvmp8bf4m784 path: zenoss.core.full/hbase/zookeeper
I0912 23:36:21.226535 26490 service.go:331] service: RabbitMQ 7utdjol9id78gb1q788izd2c2 path: zenoss.core.full/rabbitmq
I0912 23:36:21.226580 26490 service.go:331] service: memcached jej5try1sso1bqa8xf04a0es path: zenoss.core.full/memcached
I0912 23:36:21.226612 26490 service.go:331] service: redis 9y8tp5ysg64w2hpola5twauzi path: zenoss.core.full/redis
I0912 23:36:21.226642 26490 service.go:331] service: zeneventserver 58128zxxcmg1bszac50brjgmv path: zenoss.core.full/zeneventserver
I0912 23:36:21.226674 26490 service.go:331] service: zencommand anzd11zr7gquqzfinz0ngj5nl path: zenoss.core.full/localhost/localhost/zencommand
I0912 23:36:21.226709 26490 service.go:331] service: MetricConsumer eyicjjyu2njzrgoo7rbio8rf4 path: zenoss.core.full/metricconsumer
I0912 23:36:21.226739 26490 service.go:331] service: CentralQuery 8sw840zqs9d9ohfksakgzn6tm path: zenoss.core.full/centralquery
I0912 23:36:21.226768 26490 service.go:331] service: zenactiond 2pz01ugrccg8if0jajte5u1ka path: zenoss.core.full/zenactiond
I0912 23:36:21.226808 26490 service.go:331] service: MetricShipper 6ti5jbyh6xftweeobwmguxk6r path: zenoss.core.full/metricshipper
I0912 23:36:21.226837 26490 service.go:331] service: localhost 5ii3qc8on22zt2bqk2sjkkx1o path: zenoss.core.full/localhost
I0912 23:36:21.226879 26490 service.go:331] service: localhost f0j7svnrywq00c40gaqlgoi7g path: zenoss.core.full/localhost/localhost
I0912 23:36:21.226922 26490 service.go:331] service: collectorredis dcmp0xaz9w1gd2mpbe2rmulbx path: zenoss.core.full/localhost/localhost/collectorredis
I0912 23:36:21.226955 26490 service.go:331] service: zenmodeler 5e2tgcqsfk5nlhxpbsnnmzfwc path: zenoss.core.full/localhost/localhost/zenmodeler
I0912 23:36:21.226989 26490 service.go:331] service: zenping 7e2l1wb5yoxek0t60wx0408dn path: zenoss.core.full/localhost/localhost/zenping
I0912 23:36:21.227023 26490 service.go:331] service: zenperfsnmp 3vflja392kksdgkujtlzsfj7b path: zenoss.core.full/localhost/localhost/zenperfsnmp
I0912 23:36:21.227056 26490 service.go:331] service: zenprocess 7xwzygd4ahypeh4n6cnec9qh3 path: zenoss.core.full/localhost/localhost/zenprocess
I0912 23:36:21.227087 26490 service.go:331] service: zenjmx 8xvc5w7etlet0k7j6fli4iswi path: zenoss.core.full/localhost/localhost/zenjmx
I0912 23:36:21.227120 26490 service.go:331] service: zenpython bh7q8bq66wszv9b4gpgxehp9k path: zenoss.core.full/localhost/localhost/zenpython
I0912 23:36:21.227168 26490 service.go:331] service: zenstatus 110aurudghsd75mz0x5607xqa path: zenoss.core.full/localhost/localhost/zenstatus
I0912 23:36:21.227214 26490 service.go:331] service: zminion 38q5hrdpqu0bawge5uk7rwxlh path: zenoss.core.full/localhost/localhost/zminion
I0912 23:36:21.227250 26490 service.go:331] service: MetricShipper b7swbk35kzo03yfaj7cow2kwd path: zenoss.core.full/localhost/localhost/metricshipper
I0912 23:36:21.227292 26490 service.go:331] service: zenhub 3n9tau98plrqizghcakyc6doh path: zenoss.core.full/localhost/zenhub
I0912 23:36:21.227325 26490 service.go:331] service: zensyslog 4if1oq68u8dqd92cpegz242jp path: zenoss.core.full/localhost/localhost/zensyslog
I0912 23:36:21.227359 26490 service.go:331] service: zentrap 1v7vb1fxo5mn33qnnjncohqbr path: zenoss.core.full/localhost/localhost/zentrap
NAME	SERVICEID	DEPID	POOL/PATH
MetricShipper	6ti5jbyh6xftweeobwmguxk6r	HBase	default/zenoss.core.full/metricshipper
MetricShipper	b7swbk35kzo03yfaj7cow2kwd	HBase	default/zenoss.core.full/localhost/localhost/metricshipper
multiple results found; select one from list

```