wmill 1.570.0__tar.gz → 1.571.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wmill might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wmill
3
- Version: 1.570.0
3
+ Version: 1.571.0
4
4
  Summary: A client library for accessing Windmill server wrapping the Windmill client API
5
5
  Home-page: https://windmill.dev
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "wmill"
3
- version = "1.570.0"
3
+ version = "1.571.0"
4
4
  description = "A client library for accessing Windmill server wrapping the Windmill client API"
5
5
  license = "Apache-2.0"
6
6
  homepage = "https://windmill.dev"
@@ -534,6 +534,35 @@ class Windmill:
534
534
  json={"value": value},
535
535
  )
536
536
 
537
+ def list_resources(
538
+ self,
539
+ resource_type: str = None,
540
+ page: int = None,
541
+ per_page: int = None,
542
+ ) -> list[dict]:
543
+ """List resources from Windmill workspace.
544
+
545
+ Args:
546
+ resource_type: Optional resource type to filter by (e.g., "postgresql", "mysql", "s3")
547
+ page: Optional page number for pagination
548
+ per_page: Optional number of results per page
549
+
550
+ Returns:
551
+ List of resource dictionaries
552
+ """
553
+ params = {}
554
+ if resource_type is not None:
555
+ params["resource_type"] = resource_type
556
+ if page is not None:
557
+ params["page"] = page
558
+ if per_page is not None:
559
+ params["per_page"] = per_page
560
+
561
+ return self.get(
562
+ f"/w/{self.workspace}/resources/list",
563
+ params=params if params else None,
564
+ ).json()
565
+
537
566
  def set_state(self, value: Any):
538
567
  self.set_resource(value, path=self.state_path, resource_type="state")
539
568
 
@@ -1263,6 +1292,36 @@ def set_resource(path: str, value: Any, resource_type: str = "any") -> None:
1263
1292
  return _client.set_resource(value=value, path=path, resource_type=resource_type)
1264
1293
 
1265
1294
 
1295
+ @init_global_client
1296
+ def list_resources(
1297
+ resource_type: str = None,
1298
+ page: int = None,
1299
+ per_page: int = None,
1300
+ ) -> list[dict]:
1301
+ """List resources from Windmill workspace.
1302
+
1303
+ Args:
1304
+ resource_type: Optional resource type to filter by (e.g., "postgresql", "mysql", "s3")
1305
+ page: Optional page number for pagination
1306
+ per_page: Optional number of results per page
1307
+
1308
+ Returns:
1309
+ List of resource dictionaries
1310
+
1311
+ Example:
1312
+ >>> # Get all resources
1313
+ >>> all_resources = wmill.list_resources()
1314
+
1315
+ >>> # Get only PostgreSQL resources
1316
+ >>> pg_resources = wmill.list_resources(resource_type="postgresql")
1317
+ """
1318
+ return _client.list_resources(
1319
+ resource_type=resource_type,
1320
+ page=page,
1321
+ per_page=per_page,
1322
+ )
1323
+
1324
+
1266
1325
  @init_global_client
1267
1326
  def set_state(value: Any) -> None:
1268
1327
  """
File without changes
File without changes
File without changes
File without changes
File without changes