Skip to content

Commit a6a7cf4

Browse files
wukathcopybara-github
authored andcommitted
chore: For bug bashing with staging express mode API
Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 895510871
1 parent 2b49163 commit a6a7cf4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/google/adk/cli/utils/gcp_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@
2929
from google.auth.transport.requests import Request
3030
from google.cloud import resourcemanager_v3
3131
import requests
32+
import logging
3233

33-
_VERTEX_AI_ENDPOINT = "https://{location}-aiplatform.googleapis.com/v1beta1"
34+
_VERTEX_AI_ENDPOINT = (
35+
"https://staging-{location}-aiplatform.sandbox.googleapis.com/v1beta1"
36+
)
3437

3538

3639
def check_adc() -> bool:
@@ -89,6 +92,7 @@ def _call_vertex_express_api(
8992
raise ValueError(f"Unsupported method: {method}")
9093

9194
response.raise_for_status()
95+
logging.info("API Response: %s", response.text)
9296
return response.json()
9397

9498

@@ -126,7 +130,7 @@ def check_express_eligibility(
126130
result = _call_vertex_express_api(
127131
"GET", "/Eligibility:check", location=location
128132
)
129-
return result.get("eligibility") == "IN_SCOPE"
133+
return result.get("eligibility") in ["IN_SCOPE", "ELIGIBLE"]
130134
except (requests.exceptions.HTTPError, KeyError) as e:
131135
return False
132136

0 commit comments

Comments
 (0)