Skip to content

Commit c0e8afe

Browse files
authored
feat(cockpit): add is_product filter to list datasource (#362)
1 parent 73d1d14 commit c0e8afe

File tree

6 files changed

+38
-0
lines changed

6 files changed

+38
-0
lines changed

scaleway-async/scaleway_async/cockpit/v1beta1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ async def list_datasources(
329329
order_by: ListDatasourcesRequestOrderBy = ListDatasourcesRequestOrderBy.CREATED_AT_ASC,
330330
project_id: Optional[str] = None,
331331
types: Optional[List[DatasourceType]] = None,
332+
is_managed_by_scaleway: Optional[bool] = None,
332333
) -> ListDatasourcesResponse:
333334
"""
334335
Get a list of datasources for the specified Project ID.
@@ -337,6 +338,7 @@ async def list_datasources(
337338
:param order_by: How the response is ordered.
338339
:param project_id: ID of the Project.
339340
:param types: Filter by datasource types.
341+
:param is_managed_by_scaleway: Filter by managed datasources.
340342
:return: :class:`ListDatasourcesResponse <ListDatasourcesResponse>`
341343
342344
Usage:
@@ -349,6 +351,7 @@ async def list_datasources(
349351
"GET",
350352
f"/cockpit/v1beta1/datasources",
351353
params={
354+
"is_managed_by_scaleway": is_managed_by_scaleway,
352355
"order_by": order_by,
353356
"page": page,
354357
"page_size": page_size or self.client.default_page_size,
@@ -368,6 +371,7 @@ async def list_datasources_all(
368371
order_by: Optional[ListDatasourcesRequestOrderBy] = None,
369372
project_id: Optional[str] = None,
370373
types: Optional[List[DatasourceType]] = None,
374+
is_managed_by_scaleway: Optional[bool] = None,
371375
) -> List[Datasource]:
372376
"""
373377
Get a list of datasources for the specified Project ID.
@@ -376,6 +380,7 @@ async def list_datasources_all(
376380
:param order_by: How the response is ordered.
377381
:param project_id: ID of the Project.
378382
:param types: Filter by datasource types.
383+
:param is_managed_by_scaleway: Filter by managed datasources.
379384
:return: :class:`List[ListDatasourcesResponse] <List[ListDatasourcesResponse]>`
380385
381386
Usage:
@@ -394,6 +399,7 @@ async def list_datasources_all(
394399
"order_by": order_by,
395400
"project_id": project_id,
396401
"types": types,
402+
"is_managed_by_scaleway": is_managed_by_scaleway,
397403
},
398404
)
399405

scaleway-async/scaleway_async/cockpit/v1beta1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ def unmarshal_Datasource(data: Any) -> Datasource:
153153
field = data.get("id", None)
154154
args["id"] = field
155155

156+
field = data.get("is_managed_by_scaleway", None)
157+
args["is_managed_by_scaleway"] = field
158+
156159
field = data.get("name", None)
157160
args["name"] = field
158161

scaleway-async/scaleway_async/cockpit/v1beta1/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ class Datasource:
230230
Datasource type.
231231
"""
232232

233+
is_managed_by_scaleway: bool
234+
"""
235+
Specifies that the datasource receives data from Scaleway products and is managed by Scaleway.
236+
"""
237+
233238

234239
@dataclass
235240
class GrafanaProductDashboard:
@@ -667,6 +672,11 @@ class ListDatasourcesRequest:
667672
Filter by datasource types.
668673
"""
669674

675+
is_managed_by_scaleway: Optional[bool]
676+
"""
677+
Filter by managed datasources.
678+
"""
679+
670680

671681
@dataclass
672682
class CreateTokenRequest:

scaleway/scaleway/cockpit/v1beta1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ def list_datasources(
329329
order_by: ListDatasourcesRequestOrderBy = ListDatasourcesRequestOrderBy.CREATED_AT_ASC,
330330
project_id: Optional[str] = None,
331331
types: Optional[List[DatasourceType]] = None,
332+
is_managed_by_scaleway: Optional[bool] = None,
332333
) -> ListDatasourcesResponse:
333334
"""
334335
Get a list of datasources for the specified Project ID.
@@ -337,6 +338,7 @@ def list_datasources(
337338
:param order_by: How the response is ordered.
338339
:param project_id: ID of the Project.
339340
:param types: Filter by datasource types.
341+
:param is_managed_by_scaleway: Filter by managed datasources.
340342
:return: :class:`ListDatasourcesResponse <ListDatasourcesResponse>`
341343
342344
Usage:
@@ -349,6 +351,7 @@ def list_datasources(
349351
"GET",
350352
f"/cockpit/v1beta1/datasources",
351353
params={
354+
"is_managed_by_scaleway": is_managed_by_scaleway,
352355
"order_by": order_by,
353356
"page": page,
354357
"page_size": page_size or self.client.default_page_size,
@@ -368,6 +371,7 @@ def list_datasources_all(
368371
order_by: Optional[ListDatasourcesRequestOrderBy] = None,
369372
project_id: Optional[str] = None,
370373
types: Optional[List[DatasourceType]] = None,
374+
is_managed_by_scaleway: Optional[bool] = None,
371375
) -> List[Datasource]:
372376
"""
373377
Get a list of datasources for the specified Project ID.
@@ -376,6 +380,7 @@ def list_datasources_all(
376380
:param order_by: How the response is ordered.
377381
:param project_id: ID of the Project.
378382
:param types: Filter by datasource types.
383+
:param is_managed_by_scaleway: Filter by managed datasources.
379384
:return: :class:`List[ListDatasourcesResponse] <List[ListDatasourcesResponse]>`
380385
381386
Usage:
@@ -394,6 +399,7 @@ def list_datasources_all(
394399
"order_by": order_by,
395400
"project_id": project_id,
396401
"types": types,
402+
"is_managed_by_scaleway": is_managed_by_scaleway,
397403
},
398404
)
399405

scaleway/scaleway/cockpit/v1beta1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ def unmarshal_Datasource(data: Any) -> Datasource:
153153
field = data.get("id", None)
154154
args["id"] = field
155155

156+
field = data.get("is_managed_by_scaleway", None)
157+
args["is_managed_by_scaleway"] = field
158+
156159
field = data.get("name", None)
157160
args["name"] = field
158161

scaleway/scaleway/cockpit/v1beta1/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ class Datasource:
230230
Datasource type.
231231
"""
232232

233+
is_managed_by_scaleway: bool
234+
"""
235+
Specifies that the datasource receives data from Scaleway products and is managed by Scaleway.
236+
"""
237+
233238

234239
@dataclass
235240
class GrafanaProductDashboard:
@@ -667,6 +672,11 @@ class ListDatasourcesRequest:
667672
Filter by datasource types.
668673
"""
669674

675+
is_managed_by_scaleway: Optional[bool]
676+
"""
677+
Filter by managed datasources.
678+
"""
679+
670680

671681
@dataclass
672682
class CreateTokenRequest:

0 commit comments

Comments
 (0)