tech.guitarrapc.cóm

Technical updates

SumoLogic API操作PowerShellモジュールを更新しました

SumoLogicについては、以前も紹介しました。

SumoLogic API を PowerShell で利用する

今回いくつかfunctionを追加しました。 これで、CoillectorとSourceに関しては、大体の操作がPowerShellでできるかなーとか。

Repository

GitHub Repository名を変更しました。

guitarrapc/PS-SumoLogicAPI

また、 Module名/psm1/Cmdlet名も全て変更しました。

インストール

GitHubからCloneして、リポジトリのinstall.batを実行するとModuleとして配置します。

Cmdlets

利用可能なCmdletは以下の通りです。

CommandType Name                             ModuleName
----------- ----                             ----------
Function    Get-SumoLogicCollectors          PS-SumoLogicAPI
Function    Get-SumoLogicCollectorsSource    PS-SumoLogicAPI
Function    Get-SumoLogicCredential          PS-SumoLogicAPI
Function    New-SumoLogicCredential          PS-SumoLogicAPI
Function    Remove-SumoLogicCollectors       PS-SumoLogicAPI
Function    Remove-SumoLogicCollectorsSource PS-SumoLogicAPI
Function    Set-SumoLogicCollectorsSource    PS-SumoLogicAPI

使い方

ReadMeにまとめておきました。

PS-SumoLogic - ReadMe

サンプル

サンプルコードも置いておきました。

サンプル

これまでとの変更点

  • Remove-* Cmdletを追加
  • Source関連Cmdletにparallelスイッチを追加
  • Remove-SumoLogicCollectors Cmdletにparallelスイッチを追加

parallelを付けると、 workflowにより5並列に実行されます。 非同期は作っていませんが通常のリクエストが5並列化されます。 しかし、 SumoLogic APIがpipelineにまとめられなくて困ってます。

最後に

Collectorが2個以上になるともうGUIとかありえませんね。 繰り返し実行もしたいわけで。 Pull Requestお待ちしています。