diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f1341d2..fb25a3f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -482,4 +482,9 @@ Bug fixing: #### resource/coralogix_events2metric * fixing `buckets` type-conversion bug (from float32 to float64). #### resource/coralogix_dashboard -* fixing `time_frame.relative.duration` flattening bug when set to `seconds:0`. \ No newline at end of file +* fixing `time_frame.relative.duration` flattening bug when set to `seconds:0`. + +## Release 1.11.12 +New Features: +#### resource/coralogix_dashboards_folder +* Adding support for `parent_id`. \ No newline at end of file diff --git a/coralogix/clientset/grpc/dashboards/folder.pb.go b/coralogix/clientset/grpc/dashboards/folder.pb.go index 411f40fa..27d5a436 100644 --- a/coralogix/clientset/grpc/dashboards/folder.pb.go +++ b/coralogix/clientset/grpc/dashboards/folder.pb.go @@ -26,8 +26,9 @@ type DashboardFolder struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + ParentId *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` } func (x *DashboardFolder) Reset() { @@ -76,6 +77,13 @@ func (x *DashboardFolder) GetName() *wrapperspb.StringValue { return nil } +func (x *DashboardFolder) GetParentId() *wrapperspb.StringValue { + if x != nil { + return x.ParentId + } + return nil +} + var File_com_coralogixapis_dashboards_v1_common_folder_proto protoreflect.FileDescriptor var file_com_coralogixapis_dashboards_v1_common_folder_proto_rawDesc = []byte{ @@ -86,15 +94,19 @@ var file_com_coralogixapis_dashboards_v1_common_folder_proto_rawDesc = []byte{ 0x6f, 0x67, 0x69, 0x78, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, - 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x71, 0x0a, - 0x0f, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, - 0x12, 0x2c, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x02, 0x69, 0x64, 0x12, 0x30, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x42, 0x03, 0x5a, 0x01, 0x2e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x01, + 0x0a, 0x0f, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x46, 0x6f, 0x6c, 0x64, 0x65, + 0x72, 0x12, 0x2c, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x39, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x04, 0x5a, 0x02, + 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -117,11 +129,12 @@ var file_com_coralogixapis_dashboards_v1_common_folder_proto_goTypes = []interfa var file_com_coralogixapis_dashboards_v1_common_folder_proto_depIdxs = []int32{ 1, // 0: com.coralogixapis.dashboards.v1.common.DashboardFolder.id:type_name -> google.protobuf.StringValue 1, // 1: com.coralogixapis.dashboards.v1.common.DashboardFolder.name:type_name -> google.protobuf.StringValue - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 1, // 2: com.coralogixapis.dashboards.v1.common.DashboardFolder.parent_id:type_name -> google.protobuf.StringValue + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_com_coralogixapis_dashboards_v1_common_folder_proto_init() } diff --git a/coralogix/resource_coralogix_dashboards_folder.go b/coralogix/resource_coralogix_dashboards_folder.go index cafd2c18..d954078f 100644 --- a/coralogix/resource_coralogix_dashboards_folder.go +++ b/coralogix/resource_coralogix_dashboards_folder.go @@ -56,8 +56,9 @@ func (r *DashboardsFolderResource) Configure(ctx context.Context, req resource.C } type DashboardsFolderResourceModel struct { - ID types.String `tfsdk:"id"` - Name types.String `tfsdk:"name"` + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + ParentId types.String `tfsdk:"parent_id"` } func (r *DashboardsFolderResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { @@ -79,6 +80,10 @@ func (r *DashboardsFolderResource) Schema(ctx context.Context, req resource.Sche Optional: true, MarkdownDescription: "Display name of the folder.", }, + "parent_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Parent folder id.", + }, }, } return @@ -138,15 +143,17 @@ func (r *DashboardsFolderResource) Create(ctx context.Context, req resource.Crea func flattenDashboardsFolder(folder *dashboards.DashboardFolder) DashboardsFolderResourceModel { return DashboardsFolderResourceModel{ - ID: wrapperspbStringToTypeString(folder.GetId()), - Name: wrapperspbStringToTypeString(folder.GetName()), + ID: wrapperspbStringToTypeString(folder.GetId()), + Name: wrapperspbStringToTypeString(folder.GetName()), + ParentId: wrapperspbStringToTypeString(folder.GetParentId()), } } func extractCreateDashboardsFolder(plan DashboardsFolderResourceModel) *dashboards.DashboardFolder { return &dashboards.DashboardFolder{ - Id: expandUuid(plan.ID), - Name: typeStringToWrapperspbString(plan.Name), + Id: expandUuid(plan.ID), + Name: typeStringToWrapperspbString(plan.Name), + ParentId: typeStringToWrapperspbString(plan.ParentId), } } diff --git a/docs/data-sources/dashboards_folder.md b/docs/data-sources/dashboards_folder.md index 53750e76..426357a7 100644 --- a/docs/data-sources/dashboards_folder.md +++ b/docs/data-sources/dashboards_folder.md @@ -22,3 +22,4 @@ description: |- ### Read-Only - `name` (String) Display name of the folder. +- `parent_id` (String) Parent folder id. diff --git a/docs/resources/api_key.md b/docs/resources/api_key.md index 58577179..424a1cc6 100644 --- a/docs/resources/api_key.md +++ b/docs/resources/api_key.md @@ -10,7 +10,19 @@ description: |- Coralogix Api keys. - +## Example Usage + +```hcl +resource "coralogix_api_key" "example" { + name = "My SCIM KEY" + owner = { + team_id : "" + } + active = true + hashed = false + roles = ["SCIM", "Legacy Api Key", "Role Management", "Send Data"] +} +``` ## Schema diff --git a/docs/resources/dashboards_folder.md b/docs/resources/dashboards_folder.md index d9d0dcde..618f84e4 100644 --- a/docs/resources/dashboards_folder.md +++ b/docs/resources/dashboards_folder.md @@ -11,8 +11,13 @@ description: |- ## Example Usage ```hcl -resource "coralogix_dashboards_folder" "this" { - name = "My Folder" +resource "coralogix_dashboards_folder" "example" { + name = "example" +} + +resource "coralogix_dashboards_folder" "example_2" { + name = "example2" + parent_id = coralogix_dashboards_folder.example.id } ``` @@ -24,6 +29,7 @@ resource "coralogix_dashboards_folder" "this" { ### Optional - `name` (String) Display name of the folder. +- `parent_id` (String) Parent folder id. ### Read-Only diff --git a/examples/apikeys/main.tf b/examples/apikeys/main.tf index 2552d275..0f97b757 100644 --- a/examples/apikeys/main.tf +++ b/examples/apikeys/main.tf @@ -19,7 +19,7 @@ resource "coralogix_api_key" "example" { } active = true hashed = false - roles = ["SCIM", "Legacy Api Key", "Role Management"] + roles = ["SCIM", "Legacy Api Key", "Role Management", "Send Data"] } data "coralogix_api_key" "same_key_by_id" { diff --git a/examples/dashboards_folder/main.tf b/examples/dashboards_folder/main.tf index dddfa290..487c48df 100644 --- a/examples/dashboards_folder/main.tf +++ b/examples/dashboards_folder/main.tf @@ -14,4 +14,9 @@ provider "coralogix" { resource "coralogix_dashboards_folder" "example" { name = "example" +} + +resource "coralogix_dashboards_folder" "example_2" { + name = "example2" + parent_id = coralogix_dashboards_folder.example.id } \ No newline at end of file