Skip to content

Commit

Permalink
Merge pull request #1037 from threefoldtech/development_proxy_fix_typo
Browse files Browse the repository at this point in the history
fix field typo
  • Loading branch information
Omarabdul3ziz authored May 26, 2024
2 parents 107dafb + 4d9dbb4 commit 5f3ea9e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 22 deletions.
13 changes: 8 additions & 5 deletions grid-proxy/docs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions grid-proxy/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"created_at"
],
"type": "string",
"description": "Sort by specific contract filed",
"description": "Sort by specific contract field",
"name": "sort_by",
"in": "query"
},
Expand Down Expand Up @@ -319,7 +319,7 @@
"dedicated"
],
"type": "string",
"description": "Sort by specific farm filed",
"description": "Sort by specific farm field",
"name": "sort_by",
"in": "query"
},
Expand Down Expand Up @@ -552,7 +552,7 @@
"extra_fee"
],
"type": "string",
"description": "Sort by specific gateway filed",
"description": "Sort by specific gateway field",
"name": "sort_by",
"in": "query"
},
Expand Down Expand Up @@ -834,7 +834,7 @@
"extra_fee"
],
"type": "string",
"description": "Sort by specific node filed",
"description": "Sort by specific node field",
"name": "sort_by",
"in": "query"
},
Expand Down Expand Up @@ -1353,7 +1353,7 @@
"twin_id"
],
"type": "string",
"description": "Sort by specific twin filed",
"description": "Sort by specific twin field",
"name": "sort_by",
"in": "query"
},
Expand Down Expand Up @@ -2016,6 +2016,9 @@
},
"twins": {
"type": "integer"
},
"workloads_number": {
"type": "integer"
}
}
},
Expand Down
12 changes: 7 additions & 5 deletions grid-proxy/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ definitions:
type: integer
twins:
type: integer
workloads_number:
type: integer
type: object
types.Twin:
properties:
Expand Down Expand Up @@ -439,7 +441,7 @@ paths:
in: query
name: randomize
type: boolean
- description: Sort by specific contract filed
- description: Sort by specific contract field
enum:
- twin_id
- contract_id
Expand Down Expand Up @@ -613,7 +615,7 @@ paths:
in: query
name: randomize
type: boolean
- description: Sort by specific farm filed
- description: Sort by specific farm field
enum:
- name
- farm_id
Expand Down Expand Up @@ -765,7 +767,7 @@ paths:
in: query
name: randomize
type: boolean
- description: Sort by specific gateway filed
- description: Sort by specific gateway field
enum:
- node_id
- farm_id
Expand Down Expand Up @@ -959,7 +961,7 @@ paths:
in: query
name: randomize
type: boolean
- description: Sort by specific node filed
- description: Sort by specific node field
enum:
- status
- node_id
Expand Down Expand Up @@ -1324,7 +1326,7 @@ paths:
in: query
name: randomize
type: boolean
- description: Sort by specific twin filed
- description: Sort by specific twin field
enum:
- relay
- public_key
Expand Down
10 changes: 5 additions & 5 deletions grid-proxy/internal/explorer/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
// @Param size query int false "Max result per page"
// @Param ret_count query bool false "Set farms' count on headers based on filter"
// @Param randomize query bool false "Get random patch of farms"
// @Param sort_by query string false "Sort by specific farm filed" Enums(name, farm_id, twin_id, public_ips, dedicated)
// @Param sort_by query string false "Sort by specific farm field" Enums(name, farm_id, twin_id, public_ips, dedicated)
// @Param sort_order query string false "The sorting order, default is 'asc'" Enums(desc, asc)
// @Param free_ips query int false "Min number of free ips in the farm"
// @Param total_ips query int false "Min number of total ips in the farm"
Expand Down Expand Up @@ -117,7 +117,7 @@ func (a *App) getStats(r *http.Request) (interface{}, mw.Response) {
// @Param size query int false "Max result per page"
// @Param ret_count query bool false "Set nodes' count on headers based on filter"
// @Param randomize query bool false "Get random patch of nodes"
// @Param sort_by query string false "Sort by specific node filed" Enums(status, node_id, farm_id, twin_id, uptime, created, updated_at, country, city, dedicated_farm, rent_contract_id, total_cru, total_mru, total_hru, total_sru, used_cru, used_mru, used_hru, used_sru, num_gpu, extra_fee)
// @Param sort_by query string false "Sort by specific node field" Enums(status, node_id, farm_id, twin_id, uptime, created, updated_at, country, city, dedicated_farm, rent_contract_id, total_cru, total_mru, total_hru, total_sru, used_cru, used_mru, used_hru, used_sru, num_gpu, extra_fee)
// @Param sort_order query string false "The sorting order, default is 'asc'" Enums(desc, asc)
// @Param balance query string false "a balance in usd, used to apply staking discount on nodes price"
// @Param free_mru query int false "Min free reservable mru in bytes"
Expand Down Expand Up @@ -172,7 +172,7 @@ func (a *App) getNodes(r *http.Request) (interface{}, mw.Response) {
// @Param size query int false "Max result per page"
// @Param ret_count query bool false "Set nodes' count on headers based on filter"
// @Param randomize query bool false "Get random patch of gateways"
// @Param sort_by query string false "Sort by specific gateway filed" Enums(node_id, farm_id, twin_id, uptime, created, updated_at, country, city, dedicated_farm, rent_contract_id, total_cru, total_mru, total_hru, total_sru, used_cru, used_mru, used_hru, used_sru, num_gpu, extra_fee)
// @Param sort_by query string false "Sort by specific gateway field" Enums(node_id, farm_id, twin_id, uptime, created, updated_at, country, city, dedicated_farm, rent_contract_id, total_cru, total_mru, total_hru, total_sru, used_cru, used_mru, used_hru, used_sru, num_gpu, extra_fee)
// @Param sort_order query string false "The sorting order, default is 'asc'" Enums(desc, asc)
// @Param free_mru query int false "Min free reservable mru in bytes"
// @Param free_hru query int false "Min free reservable hru in bytes"
Expand Down Expand Up @@ -297,7 +297,7 @@ func (a *App) getNodeStatus(r *http.Request) (interface{}, mw.Response) {
// @Param size query int false "Max result per page"
// @Param ret_count query bool false "Set twins' count on headers based on filter"
// @Param randomize query bool false "Get random patch of twins"
// @Param sort_by query string false "Sort by specific twin filed" Enums(relay, public_key, account_id, twin_id)
// @Param sort_by query string false "Sort by specific twin field" Enums(relay, public_key, account_id, twin_id)
// @Param sort_order query string false "The sorting order, default is 'asc'" Enums(desc, asc)
// @Param twin_id query int false "twin id"
// @Param account_id query string false "Account address"
Expand Down Expand Up @@ -337,7 +337,7 @@ func (a *App) listTwins(r *http.Request) (interface{}, mw.Response) {
// @Param size query int false "Max result per page"
// @Param ret_count query bool false "Set contracts' count on headers based on filter"
// @Param randomize query bool false "Get random patch of contracts"
// @Param sort_by query string false "Sort by specific contract filed" Enums(twin_id, contract_id, type, state, created_at)
// @Param sort_by query string false "Sort by specific contract field" Enums(twin_id, contract_id, type, state, created_at)
// @Param sort_order query string false "The sorting order, default is 'asc'" Enums(desc, asc)
// @Param contract_id query int false "contract id"
// @Param twin_id query int false "twin id"
Expand Down
4 changes: 2 additions & 2 deletions grid-proxy/pkg/types/limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// SortOrder is the direction of sorting
type SortOrder string

// SortBy is the sorted by filed
// SortBy is the sorted by field
type SortBy string

const (
Expand Down Expand Up @@ -55,7 +55,7 @@ func (sb SortBy) valid(typ interface{}) error {
}
}

return fmt.Errorf("%q is not a sort filed for %v type", sb, objType.Name())
return fmt.Errorf("%q is not a sort field for %v type", sb, objType.Name())
}

// Limit used for pagination
Expand Down

0 comments on commit 5f3ea9e

Please sign in to comment.