御世話になります。
soracom というMVNOのサービスを利用しています。
soracom は、キャリアの通信サービスを提供する会社です。
soracom では、simカードを販売し、購入した利用者がそのsimの情報を遠隔的に操作できます。
今回質問する内容は、その遠隔的に操作する際に、soracom が提供している cliのコマンド方法になります。
具体的には、コマンドでjsonデータを渡す際のエラー原因についてです。
そのため、soracom の知識がない方でも、もしかしたら原因が分かるかもしれません。
実際にエラーが発生したコマンドは、イベントハンドラーという自動で何かをやってくれる機能の設定になります。
基本的なコマンドはこのようになります。
shell
1soracom event-handlers create --body @sample-event.json
sample-event.json が設定するイベントになります。
例えば以下になります。
json
1{ 2 "name": "sample_event", 3 "description": "sample_event", 4 "ruleConfig": { 5 "properties": { 6 "limitTotalTrafficMegaByte": 100, 7 "inactiveTimeoutDateConst": "BEGINNING_OF_NEXT_DAY" 8 }, 9 "type": "DailyTrafficRule" 10 }, 11 "actionConfigList": [{ 12 "type": "SendMailAction", 13 "properties": { 14 "to": "test@example.com", 15 "title": "test_email", 16 "message": "test message", 17 "executionDateTimeConst": "IMMEDIATELY" 18 } 19 }], 20 "status": "active", 21 "targetImsi": "440100000000000" 22}
これは、特定のSIMで(IMSI: 440100000000000)日次通信量が100MBを超えたとき、test@example.comにメールを送信する設定になります。
上記のsampleを起動するcliと同じ場所に置いています。
一応サポートセンターでのsampleのため起動できると考えていますが、以下のエラーが発生していまいます。
shell
1soracom event-handlers create --body @sample-event.json 2Error: open sample-event.json: The system cannot find the file specified. 3Usage: 4 soracom event-handlers create [flags] 5 6Flags: 7 --body string JSON string or @filename for API request body. 8 --description string 9 --name string 10 --status string 11 --target-group-id string 12 --target-imsi string 13 --target-operator-id string 14 15Global Flags: 16 --coverage-type string Specify coverage type 17 --profile string Specify profile name
私はsoracom のコマンド設定以前の基本的な間違いであると考えています。
もし原因につながるヒントがありましたら教えてください。
回答1件
あなたの回答
tips
プレビュー