From 983ae41f4b79524ce96b47fdc970b04a08beb9fd Mon Sep 17 00:00:00 2001 From: Benjamin Einaudi Date: Wed, 21 Jan 2026 19:08:52 +0100 Subject: [PATCH] fixes(v3) put back 'get_routes' un AppManager Fixes #291 --- cloudfoundry_client/__init__.py | 2 +- cloudfoundry_client/v3/apps.py | 11 +++++++++++ pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cloudfoundry_client/__init__.py b/cloudfoundry_client/__init__.py index 97a568b..970ecdd 100644 --- a/cloudfoundry_client/__init__.py +++ b/cloudfoundry_client/__init__.py @@ -2,4 +2,4 @@ This module provides a client library for cloudfoundry_client v2/v3. """ -__version__ = "1.40.1" +__version__ = "1.40.2" diff --git a/cloudfoundry_client/v3/apps.py b/cloudfoundry_client/v3/apps.py index c3cc609..7054434 100644 --- a/cloudfoundry_client/v3/apps.py +++ b/cloudfoundry_client/v3/apps.py @@ -1,4 +1,10 @@ from typing import TYPE_CHECKING +import sys + +if sys.version_info < (3, 13): + from typing_extensions import deprecated +else: + from warnings import deprecated from cloudfoundry_client.common_objects import JsonObject, Pagination from cloudfoundry_client.v3.entities import EntityManager, Entity @@ -20,6 +26,11 @@ def remove(self, application_guid: str, asynchronous: bool = True) -> str | None def get_env(self, application_guid: str) -> JsonObject: return super()._get("%s%s/%s/env" % (self.target_endpoint, self.entity_uri, application_guid)) + @deprecated("use list_routes instead") + def get_routes(self, application_guid: str) -> JsonObject: + return super()._get( + "%s%s/%s/routes" % (self.target_endpoint, self.entity_uri, application_guid)) + def list_routes(self, application_guid: str, **kwargs) -> Pagination[Entity]: uri: str = "%s/%s/routes" % (self.entity_uri, application_guid) return super()._list(requested_path=uri, **kwargs) diff --git a/pyproject.toml b/pyproject.toml index aacd1b2..8edb7ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ exclude = ''' [tool.poetry] name = "cloudfoundry_client" -version = "1.40.1" +version = "1.40.2" description = "A client library for CloudFoundry" authors = ["Benjamin Einaudi "] readme = "README.rst"