From 52b1cb279c894dadb1bd772c6788a2d33635adef Mon Sep 17 00:00:00 2001 From: Omar Abdulaziz Date: Tue, 24 Sep 2024 16:59:31 +0300 Subject: [PATCH] - rename to rentable_or_rented_by filter - update changelog/chart version --- grid-proxy/CHANGELOG.md | 12 +++++++++--- grid-proxy/charts/gridproxy/Chart.yaml | 2 +- grid-proxy/docs/docs.go | 8 +++++++- grid-proxy/docs/swagger.json | 8 +++++++- grid-proxy/docs/swagger.yaml | 6 +++++- grid-proxy/internal/explorer/server.go | 2 +- grid-proxy/pkg/types/nodes.go | 4 ++-- 7 files changed, 32 insertions(+), 10 deletions(-) diff --git a/grid-proxy/CHANGELOG.md b/grid-proxy/CHANGELOG.md index 560fb860..6347e4fb 100644 --- a/grid-proxy/CHANGELOG.md +++ b/grid-proxy/CHANGELOG.md @@ -2,11 +2,17 @@ Check `/version` on any instance to know the version. -## Projects +## Releases -### 3.13 +### v0.15.17 -## Releases +--- + +- `fix` null consumption for twins doesn't contain contracts. +- `feat` add `rentable_or_rented_by` filter on nodes endpoint. +- `feat` add `free_farm_ips` field on node response. +- `feat` allow sorting by total/free/used ips on farm endpoint. +- `feat` add new `public_ips` endpoint. ### v0.15.14 diff --git a/grid-proxy/charts/gridproxy/Chart.yaml b/grid-proxy/charts/gridproxy/Chart.yaml index 34844950..43726208 100644 --- a/grid-proxy/charts/gridproxy/Chart.yaml +++ b/grid-proxy/charts/gridproxy/Chart.yaml @@ -20,6 +20,6 @@ version: 1.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 0.15.14 +appVersion: 0.15.17 # make sure to update the changelog with the changes in this release diff --git a/grid-proxy/docs/docs.go b/grid-proxy/docs/docs.go index b45996a5..c3ad86e7 100644 --- a/grid-proxy/docs/docs.go +++ b/grid-proxy/docs/docs.go @@ -1126,7 +1126,7 @@ const docTemplate = `{ { "type": "integer", "description": "rented by a twin id or available to rent", - "name": "rentable_by", + "name": "rentable_or_rented_by", "in": "query" }, { @@ -1831,6 +1831,9 @@ const docTemplate = `{ "farmName": { "type": "string" }, + "farm_free_ips": { + "type": "integer" + }, "farmingPolicyId": { "type": "integer" }, @@ -2026,6 +2029,9 @@ const docTemplate = `{ "farmName": { "type": "string" }, + "farm_free_ips": { + "type": "integer" + }, "farmingPolicyId": { "type": "integer" }, diff --git a/grid-proxy/docs/swagger.json b/grid-proxy/docs/swagger.json index 496f7511..198a2c57 100644 --- a/grid-proxy/docs/swagger.json +++ b/grid-proxy/docs/swagger.json @@ -1118,7 +1118,7 @@ { "type": "integer", "description": "rented by a twin id or available to rent", - "name": "rentable_by", + "name": "rentable_or_rented_by", "in": "query" }, { @@ -1823,6 +1823,9 @@ "farmName": { "type": "string" }, + "farm_free_ips": { + "type": "integer" + }, "farmingPolicyId": { "type": "integer" }, @@ -2018,6 +2021,9 @@ "farmName": { "type": "string" }, + "farm_free_ips": { + "type": "integer" + }, "farmingPolicyId": { "type": "integer" }, diff --git a/grid-proxy/docs/swagger.yaml b/grid-proxy/docs/swagger.yaml index 864640d0..5b2735e1 100644 --- a/grid-proxy/docs/swagger.yaml +++ b/grid-proxy/docs/swagger.yaml @@ -149,6 +149,8 @@ definitions: $ref: '#/definitions/types.Dmi' extraFee: type: integer + farm_free_ips: + type: integer farmId: type: integer farmName: @@ -277,6 +279,8 @@ definitions: $ref: '#/definitions/types.Dmi' extraFee: type: integer + farm_free_ips: + type: integer farmId: type: integer farmName: @@ -1199,7 +1203,7 @@ paths: type: integer - description: rented by a twin id or available to rent in: query - name: rentable_by + name: rentable_or_rented_by type: integer - description: List of farms separated by comma to fetch nodes from (e.g. '1,2,3') in: query diff --git a/grid-proxy/internal/explorer/server.go b/grid-proxy/internal/explorer/server.go index 44b92593..85860b0f 100644 --- a/grid-proxy/internal/explorer/server.go +++ b/grid-proxy/internal/explorer/server.go @@ -145,7 +145,7 @@ func (a *App) getStats(r *http.Request) (interface{}, mw.Response) { // @Param rented query bool false "Set to true to filter rented nodes" // @Param rented_by query int false "rented by twin id" // @Param available_for query int false "available for twin id" -// @Param rentable_by query int false "rented by a twin id or available to rent" +// @Param rentable_or_rented_by query int false "rented by a twin id or available to rent" // @Param farm_ids query string false "List of farms separated by comma to fetch nodes from (e.g. '1,2,3')" // @Param certification_type query string false "certificate type" Enums(Certified, DIY) // @Param has_gpu query bool false "filter nodes on whether they have GPU support or not" diff --git a/grid-proxy/pkg/types/nodes.go b/grid-proxy/pkg/types/nodes.go index 74001547..2fc9b392 100644 --- a/grid-proxy/pkg/types/nodes.go +++ b/grid-proxy/pkg/types/nodes.go @@ -143,8 +143,8 @@ type NodeFilter struct { OwnedBy *uint64 `schema:"owned_by,omitempty"` Rented *bool `schema:"rented,omitempty"` RentedBy *uint64 `schema:"rented_by,omitempty"` - RentableOrRentedBy *uint64 `schema:"rentable_by,omitempty"` // rented by twin or rentable - AvailableFor *uint64 `schema:"available_for,omitempty"` // rented by twin or free + RentableOrRentedBy *uint64 `schema:"rentable_or_rented_by,omitempty"` // rented by twin or rentable + AvailableFor *uint64 `schema:"available_for,omitempty"` // rented by twin or free NodeID *uint64 `schema:"node_id,omitempty"` NodeIDs []uint64 `schema:"node_ids,omitempty"` TwinID *uint64 `schema:"twin_id,omitempty"`