Skip to content

Commit

Permalink
fix: fix endpoint url to list
Browse files Browse the repository at this point in the history
Signed-off-by: FogDong <fog@bentoml.com>
  • Loading branch information
FogDong committed Feb 22, 2024
1 parent 3bf2302 commit dab5f5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bentoml/_internal/cloud/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def to_dict(self) -> dict[str, t.Any]:
"name": self.name,
"bento": self.get_bento(refetch=False),
"cluster": self.cluster,
"endpoint_url": self._urls[0] if self._urls else None,
"endpoint_urls": self._urls if self._urls else None,
"admin_console": self.admin_console,
"created_at": self.created_at,
"created_by": self.created_by,
Expand Down Expand Up @@ -430,12 +430,12 @@ def get_status(self, refetch: bool = True) -> DeploymentState:
updated_at=updated_at,
)

def get_endpoint_url(self, refetch: bool = True) -> str:
def get_endpoint_urls(self, refetch: bool = True) -> list[str]:
if refetch:
self._refetch()
if self._urls is None or len(self._urls) != 1:
raise BentoMLException("Deployment endpoint url is not ready")
return self._urls[0]
return self._urls

def get_bento(self, refetch: bool = True) -> str:
target = self._refetch_target(refetch)
Expand Down

0 comments on commit dab5f5f

Please sign in to comment.