-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* patch - metric and logs archive
- Loading branch information
Showing
34 changed files
with
4,194 additions
and
886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package clientset | ||
|
||
import ( | ||
"context" | ||
|
||
archiveLogs "terraform-provider-coralogix/coralogix/clientset/grpc/archive-logs" | ||
) | ||
|
||
type ArchiveLogsClient struct { | ||
callPropertiesCreator *CallPropertiesCreator | ||
} | ||
|
||
func (c ArchiveLogsClient) UpdateArchiveLogs(ctx context.Context, req *archiveLogs.SetTargetRequest) (*archiveLogs.SetTargetResponse, error) { | ||
callProperties, err := c.callPropertiesCreator.GetCallProperties(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
conn := callProperties.Connection | ||
defer conn.Close() | ||
client := archiveLogs.NewTargetServiceClient(conn) | ||
|
||
return client.SetTarget(callProperties.Ctx, req, callProperties.CallOptions...) | ||
} | ||
|
||
func (c ArchiveLogsClient) GetArchiveLogs(ctx context.Context) (*archiveLogs.GetTargetResponse, error) { | ||
callProperties, err := c.callPropertiesCreator.GetCallProperties(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
conn := callProperties.Connection | ||
defer conn.Close() | ||
client := archiveLogs.NewTargetServiceClient(conn) | ||
|
||
return client.GetTarget(callProperties.Ctx, &archiveLogs.GetTargetRequest{}, callProperties.CallOptions...) | ||
} | ||
|
||
func NewArchiveLogsClient(c *CallPropertiesCreator) *ArchiveLogsClient { | ||
return &ArchiveLogsClient{callPropertiesCreator: c} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package clientset | ||
|
||
import ( | ||
"context" | ||
|
||
"google.golang.org/protobuf/types/known/emptypb" | ||
archiveMetrics "terraform-provider-coralogix/coralogix/clientset/grpc/archive-metrics" | ||
) | ||
|
||
type ArchiveMetricsClient struct { | ||
callPropertiesCreator *CallPropertiesCreator | ||
} | ||
|
||
func (c ArchiveMetricsClient) UpdateArchiveMetrics(ctx context.Context, req *archiveMetrics.ConfigureTenantRequest) (*emptypb.Empty, error) { | ||
callProperties, err := c.callPropertiesCreator.GetCallProperties(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
conn := callProperties.Connection | ||
defer conn.Close() | ||
client := archiveMetrics.NewMetricsConfiguratorPublicServiceClient(conn) | ||
|
||
return client.ConfigureTenant(callProperties.Ctx, req, callProperties.CallOptions...) | ||
} | ||
|
||
func (c ArchiveMetricsClient) GetArchiveMetrics(ctx context.Context) (*archiveMetrics.GetTenantConfigResponseV2, error) { | ||
callProperties, err := c.callPropertiesCreator.GetCallProperties(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
conn := callProperties.Connection | ||
defer conn.Close() | ||
client := archiveMetrics.NewMetricsConfiguratorPublicServiceClient(conn) | ||
|
||
return client.GetTenantConfig(callProperties.Ctx, &emptypb.Empty{}, callProperties.CallOptions...) | ||
} | ||
|
||
func NewArchiveMetricsClient(c *CallPropertiesCreator) *ArchiveMetricsClient { | ||
return &ArchiveMetricsClient{callPropertiesCreator: c} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.