sp.listStreamProcessors()
定義
バージョン 7.0 で追加: Returns documents for each named Stream Processor on the current Stream Processing Instance. Each document provides descriptive information including the name, current state, and pipeline of a stream processor.
互換性
構文
sp.listStreamProcessors()
メソッドの構文は次のとおりです。
sp.listStreamProcessors( { <filter> } )
コマンドフィールド
sp.listStreamProcessors()
は次のフィールドを取ります。
フィールド | タイプ | 必要性 | 説明 |
---|---|---|---|
| ドキュメント | 任意 | Document specifying which fields to filter stream processors on. If you provide a filter, the command will only return those processors which match the values for all the fields you specify. |
動作
sp.listStreamProcessors()
returns documents describing all of
the named stream processors on the current stream processing instance
to STDOUT
.
アクセス制御
sp.listStreamProcessors()
を実行しているユーザーにはatlasAdmin
ロールが必要です。
例
The following example shows an expected response from
sp.listStreamProcessors()
when the command is called without any
filter:
sp.listStreamProcessors()
1 { 2 id: '0135', 3 name: "proc01", 4 last_modified: ISODate("2023-03-20T20:15:54.601Z"), 5 state: "RUNNING", 6 error_msg: '', 7 pipeline: [ 8 { 9 $source: { 10 connectionName: "myKafka", 11 topic: "stuff" 12 } 13 }, 14 { 15 $match: { 16 temperature: 46 17 } 18 }, 19 { 20 $emit: { 21 connectionName: "mySink", 22 topic: "output", 23 } 24 } 25 ], 26 lastStateChange: ISODate("2023-03-20T20:15:59.442Z") 27 }, 28 { 29 id: '0218', 30 name: "proc02", 31 last_modified: ISODate("2023-03-21T20:17:33.601Z"), 32 state: "STOPPED", 33 error_msg: '', 34 pipeline: [ 35 { 36 $source: { 37 connectionName: "myKafka", 38 topic: "things" 39 } 40 }, 41 { 42 $match: { 43 temperature: 41 44 } 45 }, 46 { 47 $emit: { 48 connectionName: "mySink", 49 topic: "results", 50 } 51 } 52 ], 53 lastStateChange: ISODate("2023-03-21T20:18:26.139Z") 54 }
The following example shows an expected response if you invoke
sp.listStreamProcessors()
filtering for only those stream
processors with a state
of running
.
sp.listStreamProcessors({"state": "running"})
1 { 2 id: '0135', 3 name: "proc01", 4 last_modified: ISODate("2023-03-20T20:15:54.601Z"), 5 state: "RUNNING", 6 error_msg: '', 7 pipeline: [ 8 { 9 $source: { 10 connectionName: "myKafka", 11 topic: "stuff" 12 } 13 }, 14 { 15 $match: { 16 temperature: 46 17 } 18 }, 19 { 20 $emit: { 21 connectionName: "mySink", 22 topic: "output", 23 } 24 } 25 ], 26 lastStateChange: ISODate("2023-03-20T20:15:59.442Z") 27 }