Skip to content

Commit

Permalink
Merge pull request #1 from logdna/nimbinatus-patch-1
Browse files Browse the repository at this point in the history
fix(WIP): add WIP note
  • Loading branch information
dm36 committed Oct 24, 2020
2 parents bab0a67 + d219bf3 commit b58063a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
44 changes: 44 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 2.1
tagged_build_filters: &tagged_build_filters
branches:
ignore: /.*/
tags:
only: /v[0-9]+\.[0-9]+\.[0-9]+/
test_build_filters: &test_build_filters
branches:
only: /.*/
tags:
ignore: /v[0-9]+\.[0-9]+\.[0-9]+/
jobs:
test:
docker:
- image: circleci/golang:1.14
steps:
- checkout
- run:
name: "Install test dependencies"
command: |
go get -u golang.org/x/lint/golint
go get github.com/mattn/goveralls
- run:
name: "Lint"
command: |
golint -set_exit_status **/*.go
- run:
name: "Run tests"
command: |
mkdir -p /tmp/artifacts
TF_ACC=1 go test -v -coverprofile=/tmp/artifacts/profile.out -covermode=count ./logdna
go tool cover -html=/tmp/artifacts/profile.out -o /tmp/artifacts/coverage.html
goveralls -coverprofile=/tmp/artifacts/profile.out -service=circleci -repotoken $COVERALLS_REPO_TOKEN
- store_artifacts:
path: /tmp/artifacts
workflows:
update:
jobs:
- test:
filters: *tagged_build_filters
test:
jobs:
- test:
filters: *test_build_filters
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# terraform-provider-logdna

🚧 Work in progress 🚧

## Example Terraform Configuration
```
provider "logdna" {
Expand Down Expand Up @@ -41,7 +43,7 @@ resource "logdna_view" "my_view" {
}
immediate = "false"
method = "post"
url = ""https://yourwebhook/endpoint""
url = "https://yourwebhook/endpoint"
terminal = "true"
triggerinterval = "15m"
triggerlimit = 15
Expand Down
4 changes: 2 additions & 2 deletions logdna/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Client struct {
httpClient *http.Client
}

// MakeRequestAlert does
// MakeRequestAlert makes a request to the config-api and parses and returns the response
func MakeRequestAlert(c *Client, url string, urlsuffix string, method string, payload viewPayload) (string, error) {
pbytes, err := json.Marshal(payload)
if err != nil {
Expand Down Expand Up @@ -92,7 +92,7 @@ func MakeRequestAlert(c *Client, url string, urlsuffix string, method string, pa
return result.Presetid, nil
}

// MakeRequestView does
// MakeRequestView makes a request to the config-api and parses and returns the response
func MakeRequestView(c *Client, url string, urlsuffix string, method string, payload viewPayload) (string, error) {
pbytes, err := json.Marshal(payload)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions logdna/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type config struct {
httpClient *http.Client
}

// Provider sets the schema to a servicekey and url and adds logdna_view as a resource
func Provider() *schema.Provider {
return &schema.Provider{
Schema: map[string]*schema.Schema{
Expand Down

0 comments on commit b58063a

Please sign in to comment.