Skip to content

Commit

Permalink
SDK Refactor (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
wizedkyle authored Jan 8, 2022
1 parent 00c23eb commit b1c476d
Show file tree
Hide file tree
Showing 274 changed files with 3,221 additions and 2,202 deletions.
56 changes: 19 additions & 37 deletions .github/workflows/sumocli-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ jobs:
outputs:
releaseurl: ${{ steps.create_release.outputs.upload_url }}

build_docker_image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Run Docker Build
run: |
docker build --build-arg buildnumber=00001 --build-arg version=0.0.1 --tag sumocli-test .
build_windows:
name: Build Windows Binary
needs: create_github_release
Expand All @@ -42,40 +50,14 @@ jobs:
- name: Set Version Variable
run: |
echo "TAG=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
- name: Install AzureSignTool
shell: pwsh
run: dotnet tool install --global AzureSignTool --version 2.0.17
- name: Checkout Repo
uses: actions/checkout@v2
- name: Download Dependencies
run: go mod download
- name: Run Tests
run: go test ./...
- name: Build Sumocli
shell: pwsh
run: |
$build = $Env:GITHUB_RUN_NUMBER
$time = Get-Date
go build -ldflags `
"-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Version=${{ env.TAG }}' `
-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Build=$build' `
-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Date=$time'" `
./cmd/sumocli
- name: Signing Executable
shell: pwsh
run: |
azuresigntool sign --description-url "https://github.com/SumoLogic-Incubator/sumocli" --file-digest sha256 `
--azure-key-vault-url ${{ secrets.AZURE_KEY_VAULT_URL }} `
--azure-key-vault-client-id ${{ secrets.AZURE_KEY_VAULT_CLIENT_ID }} `
--azure-key-vault-client-secret ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }} `
--azure-key-vault-certificate ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE }} `
--timestamp-rfc3161 http://timestamp.sectigo.com `
--timestamp-digest sha256 `
sumocli.exe
- name: Zip Release
shell: pwsh
run: |
Compress-Archive -Path sumocli.exe -DestinationPath sumocli-windows-amd64.zip
- name: Build Binary
run: ./scripts/build.sh -b "" -v "" -w
- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
Expand Down Expand Up @@ -115,9 +97,9 @@ jobs:
$build = $Env:GITHUB_RUN_NUMBER
$time = Get-Date
go build -ldflags `
"-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Version=${{ env.TAG }}' `
-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Build=$build' `
-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Date=$time'" `
"-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Version=${{ env.TAG }}' `
-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Build=$build' `
-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Date=$time'" `
./cmd/sumocli
- name: Zip Releases
run: |
Expand Down Expand Up @@ -161,9 +143,9 @@ jobs:
$build = $Env:GITHUB_RUN_NUMBER
$time = Get-Date
go build -ldflags `
"-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Version=${{ env.TAG }}' `
-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Build=$build' `
-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Date=$time'" `
"-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Version=${{ env.TAG }}' `
-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Build=$build' `
-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Date=$time'" `
./cmd/sumocli
env:
GOOS: darwin
Expand Down Expand Up @@ -236,9 +218,9 @@ jobs:
run: |
time=$(date)
go build -ldflags \
"-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Version=${{ env.TAG }}' \
-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Build=$GITHUB_RUN_NUMBER' \
-X 'github.com/SumoLogic-Incubator/sumocli/internal/build.Date=$time'" \
"-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Version=${{ env.TAG }}' \
-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Build=$GITHUB_RUN_NUMBER' \
-X 'github.com/SumoLogic-Labs/sumocli/internal/build.Date=$time'" \
./cmd/sumocli
env:
GOOS: darwin
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
dist/
sumocli.exedist/
/.idea


9 changes: 5 additions & 4 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,22 @@ You can find further information about the Sumo Logic APIs in their [documentati
| Ingest Budgets | :white_check_mark: | |
| Ingest Budgets v2 | :white_check_mark: | |
| Log Search Estimated Usage | | Functionality is still in development. |
| Lookup Tables | :white_check_mark: | |
| Lookup Tables | :white_check_mark: | |
| Metrics Query (Beta) | | |
| Metrics Searches (Beta) | | Functionality is still in development. |
| Monitors | | Functionality is still in development. |
| Organizations | | Functionality is still in development. |
| Organizations | :white_check_mark: | |
| Partitions | :white_check_mark: | |
| Password Policy | :white_check_mark: | |
| Permissions | :white_check_mark: | |
| Policies | | Functionality is still in development. |
| Policies | :white_check_mark: | |
| Roles | :white_check_mark: | |
| SAML Configuration | :white_check_mark: | |
| Scheduled Views | :white_check_mark: | |
| Service Allowlist | :white_check_mark: | |
| Sources | :white_check_mark: | Simple commands like get, list, delete are supported. Support for creating different sources are listed under Sumo Logic Sources Support. |
| Tokens | :white_check_mark: | |
| Transformation Rules (Beta) | | Functionality is still in development. |
| Transformation Rules (Beta) | :white_check_mark: | |
| Users | :white_check_mark: | |

## Sumo Logic Sources Support
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.16.6-alpine
FROM golang:1.17.1-alpine
ARG buildnumber=DEV
ARG version=DEV
LABEL maintainer="Kyle Jackson <[email protected]>"

ENV DEV=true

WORKDIR $GOPATH/src/github.com/SumoLogic-Incubator/sumocli
WORKDIR $GOPATH/src/github.com/SumoLogic-Labs/sumocli
COPY . .
RUN chmod +x ./scripts/build.sh
RUN ./scripts/build.sh
RUN chmod +x ./scripts/docker-build.sh
RUN ./scripts/docker-build.sh -b $buildnumber -v $version -d

ENTRYPOINT ["/go/bin/sumocli"]
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,42 @@
A CLI application that lets you manage/automate your Sumo Logic tenancy.

Sumocli is currently in development so there could be bugs/incomplete functionality.
GA will be v1.0.0 which I am expecting to be ready for release towards the end of 2021.
GA will be v1.0.0 which I am expecting to be ready for release in Q1 2022.
## Installation

### Recommended
Download the binary for your platform from the Releases page.
### Linux
You can install sumocli via apt on debian based linux distributions by running the following commands:

```
apt-get update
```

### macOS


### Windows



### Docker

Each version of Sumocli is published on [Docker Hub](https://hub.docker.com/r/SumoLogic-Incubator/sumocli).
Each version of Sumocli is published on [Docker Hub](https://hub.docker.com/r/wizedkyle/sumocli).

Pull the latest image:

`docker pull SumoLogic-Incubator/sumocli:latest`
`docker pull wiedkyle/sumocli:latest`

Pull a specific version image:

`docker pull SumoLogic-Incubator/sumocli:v0.11.0`
`docker pull wizedkyle/sumocli:v0.11.0`

### Build Yourself
You can build the sumocli application for your platform by performing the following steps:

Clone the sumocli repo

`git clone https://github.com/SumoLogic-Incubator/sumocli`
`git clone https://github.com/SumoLogic-Labs/sumocli`

The repo is using Go modules so you can run go build:

Expand Down
21 changes: 0 additions & 21 deletions api/dynamic-parsing.go

This file was deleted.

25 changes: 0 additions & 25 deletions api/field-extraction-rules.go

This file was deleted.

29 changes: 0 additions & 29 deletions api/field-management.go

This file was deleted.

55 changes: 0 additions & 55 deletions api/folders.go

This file was deleted.

41 changes: 0 additions & 41 deletions api/health-events.go

This file was deleted.

Loading

0 comments on commit b1c476d

Please sign in to comment.