Skip to content

Commit

Permalink
My simple caveman brain can't keep the orderBy vs orderHow straight.
Browse files Browse the repository at this point in the history
They are both strings so the compiler can't catch us/help us when these
get reversed.  We could make this separate type defs to help with that.

Looks like orderBy should be first in the arg list...so that's what i'm
trying to go with.
  • Loading branch information
dehort committed Jan 11, 2024
1 parent 49ba244 commit 69ba166
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deploy/clowdapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ objects:
- name: INVENTORY_CONNECTOR_PORT
value: ${INVENTORY_CONNECTOR_PORT}
- name: INVENTORY_CONNECTOR_ORDERED_HOW
value: "display_name"
value: "ASC"
- name: INVENTORY_CONNECTOR_ORDERED_BY
value: "display_name"

Expand Down
10 changes: 5 additions & 5 deletions internal/api/connectors/inventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ func NewInventoryClient(cfg *viper.Viper) InventoryConnector {
func (this *inventoryConnectorImpl) getHostDetails(
ctx context.Context,
IDs []string,
orderHow string,
orderBy string,
orderHow string,
limit int,
offset int,
) (details []HostOut, err error) {
Expand All @@ -147,8 +147,8 @@ func (this *inventoryConnectorImpl) getHostDetails(
func (this *inventoryConnectorImpl) getSystemProfileDetails(
ctx context.Context,
IDs []string,
orderHow string,
orderBy string,
orderHow string,
limit int,
offset int,
) (details map[string]HostSystemProfileOut, err error) {
Expand All @@ -173,9 +173,9 @@ func (this *inventoryConnectorImpl) getSystemProfileDetails(
return formatedResults, nil
}

func (this *inventoryConnectorImpl) GetHostConnectionDetails(ctx context.Context, IDs []string, order_how string, order_by string, limit int, offset int) (details []HostDetails, err error) {
func (this *inventoryConnectorImpl) GetHostConnectionDetails(ctx context.Context, IDs []string, order_by string, order_how string, limit int, offset int) (details []HostDetails, err error) {

hostResults, err := this.getHostDetails(ctx, IDs, order_how, order_by, limit, offset)
hostResults, err := this.getHostDetails(ctx, IDs, order_by, order_how, limit, offset)

if err != nil {
return nil, err
Expand All @@ -185,7 +185,7 @@ func (this *inventoryConnectorImpl) GetHostConnectionDetails(ctx context.Context
return nil, nil
}

systemProfileResults, err := this.getSystemProfileDetails(ctx, IDs, order_how, order_by, limit, offset)
systemProfileResults, err := this.getSystemProfileDetails(ctx, IDs, order_by, order_how, limit, offset)

if err != nil {
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func (this *controllers) ApiInternalHighlevelConnectionStatus(ctx echo.Context)
hostConnectorDetails, err := this.inventoryConnectorClient.GetHostConnectionDetails(
ctx.Request().Context(),
input.Hosts,
this.config.GetString("inventory.connector.ordered.how"),
this.config.GetString("inventory.connector.ordered.by"),
this.config.GetString("inventory.connector.ordered.how"),
this.config.GetInt("inventory.connector.limit"),
this.config.GetInt("inventory.connector.offset"),
)
Expand Down

0 comments on commit 69ba166

Please sign in to comment.