Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions docs/data-sources/view.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "coralogix_view Data Source - terraform-provider-coralogix"
subcategory: ""
description: |-

---

# coralogix_view (Data Source)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) id

### Read-Only

- `filters` (Attributes) (see [below for nested schema](#nestedatt--filters))
- `folder_id` (String) Unique identifier for folders
- `name` (String) View name
- `search_query` (Attributes) (see [below for nested schema](#nestedatt--search_query))
- `time_selection` (Attributes) (see [below for nested schema](#nestedatt--time_selection))

<a id="nestedatt--filters"></a>
### Nested Schema for `filters`

Read-Only:

- `filters` (Attributes List) (see [below for nested schema](#nestedatt--filters--filters))

<a id="nestedatt--filters--filters"></a>
### Nested Schema for `filters.filters`

Read-Only:

- `name` (String) Filter name
- `selected_values` (Map of Boolean) Filter selected values



<a id="nestedatt--search_query"></a>
### Nested Schema for `search_query`

Read-Only:

- `query` (String)


<a id="nestedatt--time_selection"></a>
### Nested Schema for `time_selection`

Read-Only:

- `custom_selection` (Attributes) (see [below for nested schema](#nestedatt--time_selection--custom_selection))
- `quick_selection` (Attributes) (see [below for nested schema](#nestedatt--time_selection--quick_selection))

<a id="nestedatt--time_selection--custom_selection"></a>
### Nested Schema for `time_selection.custom_selection`

Read-Only:

- `from_time` (String)
- `to_time` (String)


<a id="nestedatt--time_selection--quick_selection"></a>
### Nested Schema for `time_selection.quick_selection`

Read-Only:

- `seconds` (Number) Folder name
24 changes: 24 additions & 0 deletions docs/data-sources/views_folder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "coralogix_views_folder Data Source - terraform-provider-coralogix"
subcategory: ""
description: |-

---

# coralogix_views_folder (Data Source)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) id

### Read-Only

- `name` (String) Name of the views-folder
81 changes: 81 additions & 0 deletions docs/resources/view.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "coralogix_view Resource - terraform-provider-coralogix"
subcategory: ""
description: |-

---

# coralogix_view (Resource)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) View name
- `time_selection` (Attributes) (see [below for nested schema](#nestedatt--time_selection))

### Optional

- `filters` (Attributes) (see [below for nested schema](#nestedatt--filters))
- `folder_id` (String) Unique identifier for folders
- `search_query` (Attributes) (see [below for nested schema](#nestedatt--search_query))

### Read-Only

- `id` (String) id

<a id="nestedatt--time_selection"></a>
### Nested Schema for `time_selection`

Optional:

- `custom_selection` (Attributes) (see [below for nested schema](#nestedatt--time_selection--custom_selection))
- `quick_selection` (Attributes) (see [below for nested schema](#nestedatt--time_selection--quick_selection))

<a id="nestedatt--time_selection--custom_selection"></a>
### Nested Schema for `time_selection.custom_selection`

Required:

- `from_time` (String)
- `to_time` (String)


<a id="nestedatt--time_selection--quick_selection"></a>
### Nested Schema for `time_selection.quick_selection`

Required:

- `seconds` (Number) Folder name



<a id="nestedatt--filters"></a>
### Nested Schema for `filters`

Optional:

- `filters` (Attributes List) (see [below for nested schema](#nestedatt--filters--filters))

<a id="nestedatt--filters--filters"></a>
### Nested Schema for `filters.filters`

Required:

- `name` (String) Filter name
- `selected_values` (Map of Boolean) Filter selected values



<a id="nestedatt--search_query"></a>
### Nested Schema for `search_query`

Required:

- `query` (String)
24 changes: 24 additions & 0 deletions docs/resources/views_folder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "coralogix_views_folder Resource - terraform-provider-coralogix"
subcategory: ""
description: |-

---

# coralogix_views_folder (Resource)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Name of the views-folder

### Read-Only

- `id` (String) id
44 changes: 44 additions & 0 deletions examples/resources/coralogix_view/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
terraform {
required_providers {
coralogix = {
version = "~> 2.0"
source = "coralogix/coralogix"
}
}
}

provider "coralogix" {
#api_key = "<add your api key here or add env variable CORALOGIX_API_KEY>"
#env = "<add the environment you want to work at or add env variable CORALOGIX_ENV>"
}

resource "coralogix_view" "example_view" {
name = "Example View"
time_selection = {
custom_selection = {
from_time = "2023-01-01T00:00:00Z"
to_time = "2023-01-02T00:00:00Z"
}
}
search_query = {
query = "error OR warning"
}
filters = {
filters = [
{
name = "severity"
selected_values = {
"ERROR" = true
"WARNING" = true
}
},
{
name = "application"
selected_values = {
"my-app" = true
"another-app" = true
}
}
]
}
}
27 changes: 27 additions & 0 deletions examples/resources/coralogix_views_folder/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
terraform {
required_providers {
coralogix = {
version = "~> 2.0"
source = "coralogix/coralogix"
}
}
}

provider "coralogix" {
#api_key = "<add your api key here or add env variable CORALOGIX_API_KEY>"
#env = "<add the environment you want to work at or add env variable CORALOGIX_ENV>"
}

resource "coralogix_views_folder" "example_view_folder" {
name = "Example View Folder"
}

resource "coralogix_view" "example_view" {
name = "Example View"
time_selection = {
quick_selection = {
seconds = 3600
}
}
folder_id = coralogix_views_folder.example_view_folder.id
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/coralogix/grpc-g

require (
github.com/ahmetalpbalkan/go-linq v3.0.0+incompatible
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251016142149-cfbf6680f3aa
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251020091618-075a0c2c07d9
github.com/google/uuid v1.6.0
github.com/grafana/grafana-api-golang-client v0.27.0
github.com/hashicorp/terraform-plugin-docs v0.20.1
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251013075013-a70c0bbaecaf h1:TnlB5YHvpQctMhhh2/eqCFnxz8qr9nfzOPI31ESeuUM=
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251013075013-a70c0bbaecaf/go.mod h1:rxWZfvnH6aXq2zZildOH98EzTLrzQIPSKffz4kf8bkY=
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251015105058-3e0ead18dfb8 h1:tdoMTI+K5c79TPh7TaMQ1EPJeK66p7zSZIMaIf5f1eU=
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251015105058-3e0ead18dfb8/go.mod h1:rxWZfvnH6aXq2zZildOH98EzTLrzQIPSKffz4kf8bkY=
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251016142149-cfbf6680f3aa h1:e4ZtOfkzOtY4+ZkRA2wmTG5+GgyNm40VxTW8N+nbYV0=
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251016142149-cfbf6680f3aa/go.mod h1:Q7eSBDvWFb6JNfigQXGoWO3XIs6ap1CXfElaZeUrZec=
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251020091618-075a0c2c07d9 h1:aPHnQzRcxUfg8A8ch9bbhl6EA7TAO8ckPivp/Lw25lA=
github.com/coralogix/coralogix-management-sdk v1.9.3-0.20251020091618-075a0c2c07d9/go.mod h1:Q7eSBDvWFb6JNfigQXGoWO3XIs6ap1CXfElaZeUrZec=
github.com/coralogix/grpc-gateway/v2 v2.0.0-20251015134251-4d8694a21a7c h1:aOfG9Pwe7Fp/m+tdybObODwgeK5st/+9df/QUw0dzBQ=
github.com/coralogix/grpc-gateway/v2 v2.0.0-20251015134251-4d8694a21a7c/go.mod h1:bqGO/kNOHTFiDIfPmXLQcox10aWQs5Q3b9sXUFoaFFk=
github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s=
Expand Down
13 changes: 13 additions & 0 deletions internal/clientset/clientset.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
ipaccess "github.com/coralogix/coralogix-management-sdk/go/openapi/gen/ip_access_service"

cxsdkOpenapi "github.com/coralogix/coralogix-management-sdk/go/openapi/cxsdk"
views "github.com/coralogix/coralogix-management-sdk/go/openapi/gen/views_service"

cxsdk "github.com/coralogix/coralogix-management-sdk/go"
)
Expand Down Expand Up @@ -51,6 +52,8 @@ type ClientSet struct {
groupGrpc *cxsdk.GroupsClient
notifications *cxsdk.NotificationsClient
ipaccess *ipaccess.IPAccessServiceAPIService
views *views.ViewsServiceAPIService
viewsFolders *cxsdk.ViewFoldersClient

grafana *GrafanaClient
groups *GroupsClient
Expand Down Expand Up @@ -164,6 +167,14 @@ func (c *ClientSet) LegacySLOs() *cxsdk.LegacySLOsClient {
return c.legacySlos
}

func (c *ClientSet) Views() *views.ViewsServiceAPIService {
return c.views
}

func (c *ClientSet) ViewsFolders() *cxsdk.ViewFoldersClient {
return c.viewsFolders
}

func NewClientSet(region string, apiKey string, targetUrl string) *ClientSet {
apiKeySdk := cxsdk.NewSDKCallPropertiesCreatorTerraform(strings.ToLower(region), cxsdk.NewAuthContext(apiKey, apiKey), TF_PROVIDER_VERSION)
apikeyCPC := NewCallPropertiesCreator(targetUrl, apiKey)
Expand Down Expand Up @@ -197,6 +208,8 @@ func NewClientSet(region string, apiKey string, targetUrl string) *ClientSet {
groupGrpc: cxsdk.NewGroupsClient(apiKeySdk),
notifications: cxsdk.NewNotificationsClient(apiKeySdk),
ipaccess: cxsdkOpenapi.NewIPAccessClient(oasTfCPC),
views: cxsdkOpenapi.NewViewsClient(oasTfCPC),
viewsFolders: cxsdk.NewViewFoldersClient(apiKeySdk),

grafana: NewGrafanaClient(apikeyCPC),
groups: NewGroupsClient(apikeyCPC),
Expand Down
Loading
Loading