Skip to content

Commit

Permalink
fix: set integrationID instead of accountID
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Dec 5, 2024
1 parent 4276727 commit 186f9a9
Showing 2 changed files with 26 additions and 26 deletions.
50 changes: 25 additions & 25 deletions pkg/sdk/es/resources_clients.go
Original file line number Diff line number Diff line change
@@ -121,9 +121,9 @@ func ListConnector(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDa
plugin.Logger(ctx).Error("ListConnector NewSelfClientCached", "error", err)
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
plugin.Logger(ctx).Error("ListConnector GetConfigTableValueOrNil for OpenGovernanceConfigKeyAccountID", "error", err)
plugin.Logger(ctx).Error("ListConnector GetConfigTableValueOrNil for OpenGovernanceConfigKeyIntegrationID", "error", err)
return nil, err
}
encodedResourceCollectionFilters, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyResourceCollectionFilters)
@@ -137,7 +137,7 @@ func ListConnector(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDa
return nil, err
}

paginator, err := k.NewConnectorPaginator(essdk.BuildFilter(ctx, d.QueryContext, listConnectorFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
paginator, err := k.NewConnectorPaginator(essdk.BuildFilter(ctx, d.QueryContext, listConnectorFilters, integrationID, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
if err != nil {
plugin.Logger(ctx).Error("ListConnector NewConnectorPaginator", "error", err)
return nil, err
@@ -187,7 +187,7 @@ func GetConnector(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDat
if err != nil {
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
return nil, err
}
@@ -201,7 +201,7 @@ func GetConnector(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDat
}

limit := int64(1)
paginator, err := k.NewConnectorPaginator(essdk.BuildFilter(ctx, d.QueryContext, getConnectorFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), &limit)
paginator, err := k.NewConnectorPaginator(essdk.BuildFilter(ctx, d.QueryContext, getConnectorFilters, integrationID, encodedResourceCollectionFilters, clientType), &limit)
if err != nil {
return nil, err
}
@@ -332,9 +332,9 @@ func ListModel(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData)
plugin.Logger(ctx).Error("ListModel NewSelfClientCached", "error", err)
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
plugin.Logger(ctx).Error("ListModel GetConfigTableValueOrNil for OpenGovernanceConfigKeyAccountID", "error", err)
plugin.Logger(ctx).Error("ListModel GetConfigTableValueOrNil for OpenGovernanceConfigKeyIntegrationID", "error", err)
return nil, err
}
encodedResourceCollectionFilters, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyResourceCollectionFilters)
@@ -348,7 +348,7 @@ func ListModel(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData)
return nil, err
}

paginator, err := k.NewModelPaginator(essdk.BuildFilter(ctx, d.QueryContext, listModelFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
paginator, err := k.NewModelPaginator(essdk.BuildFilter(ctx, d.QueryContext, listModelFilters, integrationID, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
if err != nil {
plugin.Logger(ctx).Error("ListModel NewModelPaginator", "error", err)
return nil, err
@@ -396,7 +396,7 @@ func GetModel(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (
if err != nil {
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
return nil, err
}
@@ -410,7 +410,7 @@ func GetModel(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (
}

limit := int64(1)
paginator, err := k.NewModelPaginator(essdk.BuildFilter(ctx, d.QueryContext, getModelFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), &limit)
paginator, err := k.NewModelPaginator(essdk.BuildFilter(ctx, d.QueryContext, getModelFilters, integrationID, encodedResourceCollectionFilters, clientType), &limit)
if err != nil {
return nil, err
}
@@ -546,9 +546,9 @@ func ListDataset(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData
plugin.Logger(ctx).Error("ListDataset NewSelfClientCached", "error", err)
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
plugin.Logger(ctx).Error("ListDataset GetConfigTableValueOrNil for OpenGovernanceConfigKeyAccountID", "error", err)
plugin.Logger(ctx).Error("ListDataset GetConfigTableValueOrNil for OpenGovernanceConfigKeyIntegrationID", "error", err)
return nil, err
}
encodedResourceCollectionFilters, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyResourceCollectionFilters)
@@ -562,7 +562,7 @@ func ListDataset(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData
return nil, err
}

paginator, err := k.NewDatasetPaginator(essdk.BuildFilter(ctx, d.QueryContext, listDatasetFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
paginator, err := k.NewDatasetPaginator(essdk.BuildFilter(ctx, d.QueryContext, listDatasetFilters, integrationID, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
if err != nil {
plugin.Logger(ctx).Error("ListDataset NewDatasetPaginator", "error", err)
return nil, err
@@ -615,7 +615,7 @@ func GetDataset(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData)
if err != nil {
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
return nil, err
}
@@ -629,7 +629,7 @@ func GetDataset(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData)
}

limit := int64(1)
paginator, err := k.NewDatasetPaginator(essdk.BuildFilter(ctx, d.QueryContext, getDatasetFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), &limit)
paginator, err := k.NewDatasetPaginator(essdk.BuildFilter(ctx, d.QueryContext, getDatasetFilters, integrationID, encodedResourceCollectionFilters, clientType), &limit)
if err != nil {
return nil, err
}
@@ -762,9 +762,9 @@ func ListFineTunedModel(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr
plugin.Logger(ctx).Error("ListFineTunedModel NewSelfClientCached", "error", err)
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
plugin.Logger(ctx).Error("ListFineTunedModel GetConfigTableValueOrNil for OpenGovernanceConfigKeyAccountID", "error", err)
plugin.Logger(ctx).Error("ListFineTunedModel GetConfigTableValueOrNil for OpenGovernanceConfigKeyIntegrationID", "error", err)
return nil, err
}
encodedResourceCollectionFilters, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyResourceCollectionFilters)
@@ -778,7 +778,7 @@ func ListFineTunedModel(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr
return nil, err
}

paginator, err := k.NewFineTunedModelPaginator(essdk.BuildFilter(ctx, d.QueryContext, listFineTunedModelFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
paginator, err := k.NewFineTunedModelPaginator(essdk.BuildFilter(ctx, d.QueryContext, listFineTunedModelFilters, integrationID, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
if err != nil {
plugin.Logger(ctx).Error("ListFineTunedModel NewFineTunedModelPaginator", "error", err)
return nil, err
@@ -828,7 +828,7 @@ func GetFineTunedModel(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydra
if err != nil {
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
return nil, err
}
@@ -842,7 +842,7 @@ func GetFineTunedModel(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydra
}

limit := int64(1)
paginator, err := k.NewFineTunedModelPaginator(essdk.BuildFilter(ctx, d.QueryContext, getFineTunedModelFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), &limit)
paginator, err := k.NewFineTunedModelPaginator(essdk.BuildFilter(ctx, d.QueryContext, getFineTunedModelFilters, integrationID, encodedResourceCollectionFilters, clientType), &limit)
if err != nil {
return nil, err
}
@@ -976,9 +976,9 @@ func ListEmbedJob(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDat
plugin.Logger(ctx).Error("ListEmbedJob NewSelfClientCached", "error", err)
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
plugin.Logger(ctx).Error("ListEmbedJob GetConfigTableValueOrNil for OpenGovernanceConfigKeyAccountID", "error", err)
plugin.Logger(ctx).Error("ListEmbedJob GetConfigTableValueOrNil for OpenGovernanceConfigKeyIntegrationID", "error", err)
return nil, err
}
encodedResourceCollectionFilters, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyResourceCollectionFilters)
@@ -992,7 +992,7 @@ func ListEmbedJob(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDat
return nil, err
}

paginator, err := k.NewEmbedJobPaginator(essdk.BuildFilter(ctx, d.QueryContext, listEmbedJobFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
paginator, err := k.NewEmbedJobPaginator(essdk.BuildFilter(ctx, d.QueryContext, listEmbedJobFilters, integrationID, encodedResourceCollectionFilters, clientType), d.QueryContext.Limit)
if err != nil {
plugin.Logger(ctx).Error("ListEmbedJob NewEmbedJobPaginator", "error", err)
return nil, err
@@ -1043,7 +1043,7 @@ func GetEmbedJob(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData
if err != nil {
return nil, err
}
accountId, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyAccountID)
integrationID, err := sc.GetConfigTableValueOrNil(ctx, steampipesdk.OpenGovernanceConfigKeyIntegrationID)
if err != nil {
return nil, err
}
@@ -1057,7 +1057,7 @@ func GetEmbedJob(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData
}

limit := int64(1)
paginator, err := k.NewEmbedJobPaginator(essdk.BuildFilter(ctx, d.QueryContext, getEmbedJobFilters, "cohereai", accountId, encodedResourceCollectionFilters, clientType), &limit)
paginator, err := k.NewEmbedJobPaginator(essdk.BuildFilter(ctx, d.QueryContext, getEmbedJobFilters, integrationID, encodedResourceCollectionFilters, clientType), &limit)
if err != nil {
return nil, err
}
2 changes: 1 addition & 1 deletion steampipe-plugin-cohereai/docs/index.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ brand_color: "#FF7759"
display_name: "CohereAI"
short_name: "cohereai"
description: "Steampipe plugin to query generations, classifications and more from CohereAI."
og_description: "Query CohereAI with SQL! Open source CLI. No DB required."
platform_description: "Query CohereAI with SQL! Open source CLI. No DB required."
og_image: "/images/plugins/Mr-Destructive/cohereai-social-graphic.png"
---

0 comments on commit 186f9a9

Please sign in to comment.