[added] support for filtering by JS domain in server report jetstream
@@ -81,7 +81,7 @@ func (c *SrvReportCmd) reportJetStream(_ *kingpin.ParseContext) error {
return err
}
- res, err := c.doReq(&server.JSzOptions{Account: c.account}, "$SYS.REQ.SERVER.PING.JSZ", nc)
+ res, err := c.doReq(&server.JszEventOptions{server.JSzOptions{Account: c.account}, c.reqFilter()}, "$SYS.REQ.SERVER.PING.JSZ", nc)
if err != nil {
return err
}
@@ -500,11 +500,14 @@ func (c *SrvReportCmd) getConnz(current []*server.Connz, nc *nats.Conn, level in
if len(current) == 0 {
var initial []*server.Connz
- res, err := c.doReq(&server.ConnzOptions{
+ res, err := c.doReq(&server.ConnzEventOptions{
+ server.ConnzOptions{
Subscriptions: true,
SubscriptionsDetail: false,
Username: true,
Account: c.account,
+ },
+ c.reqFilter(),
}, "$SYS.REQ.SERVER.PING.CONNZ", nc)
if err != nil {
return nil, false, err
@@ -579,12 +582,15 @@ func (c *SrvReportCmd) getConnz(current []*server.Connz, nc *nats.Conn, level in
// We are here because we have only incomplete ones in the current set, get their next page and recurse
if len(incomplete) == len(current) {
for _, conn := range current {
- res, err := c.doReq(&server.ConnzOptions{
+ res, err := c.doReq(&server.ConnzEventOptions{
+ server.ConnzOptions{
Subscriptions: true,
SubscriptionsDetail: false,
Account: c.account,
Username: true,
Offset: conn.Offset + 1,
+ },
+ c.reqFilter(),
}, fmt.Sprintf("$SYS.REQ.SERVER.%s.CONNZ", conn.ID), nc)
if err != nil {
return nil, false, err
@@ -611,3 +617,7 @@ func (c *SrvReportCmd) getConnz(current []*server.Connz, nc *nats.Conn, level in
func (c *SrvReportCmd) doReq(req interface{}, subj string, nc *nats.Conn) ([][]byte, error) {
return doReq(req, subj, c.waitFor, nc)
}
+
+func (c *SrvReportCmd) reqFilter() server.EventFilterOptions {
+ return server.EventFilterOptions{Domain: config.JSDomain()}
+}
