Commit 3d6d09a
authored
feat: refactor CLI to use direct API calls (GoogleCloudPlatform#713)
* feat: refactor CLI to use direct API calls
- Add get_project_number() function using Resource Manager API
- Replace gcloud projects describe calls with direct API calls in cicd.py
- Add _build_api_headers() helper in register_gemini_enterprise.py
- Include User-Agent and x-goog-api-client headers in Discovery Engine API calls
* fix: improve error handling and make API helper functions public
- Make get_user_agent and get_x_goog_api_client_header public in gcp.py
- Add RESOURCE_MANAGER_API_BASE constant for API endpoint URL
- Use specific exceptions (PermissionError, ValueError) in get_project_number
- Update cicd.py to handle new exception types from get_project_number
- Update register_gemini_enterprise.py to use public function names
* fix: remove extra ::: from development guide1 parent cc37d9f commit 3d6d09a
File tree
5 files changed
+108
-43
lines changed- agent_starter_pack/cli
- commands
- utils
- docs
- guide
5 files changed
+108
-43
lines changedLines changed: 33 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
298 | 302 | | |
299 | 303 | | |
300 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
301 | 331 | | |
302 | 332 | | |
303 | 333 | | |
| |||
604 | 634 | | |
605 | 635 | | |
606 | 636 | | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
| 637 | + | |
611 | 638 | | |
612 | 639 | | |
613 | 640 | | |
| |||
937 | 964 | | |
938 | 965 | | |
939 | 966 | | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
| 967 | + | |
945 | 968 | | |
946 | 969 | | |
947 | 970 | | |
| |||
1106 | 1129 | | |
1107 | 1130 | | |
1108 | 1131 | | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
| 1132 | + | |
1114 | 1133 | | |
1115 | 1134 | | |
1116 | 1135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 153 | + | |
164 | 154 | | |
165 | 155 | | |
166 | 156 | | |
| |||
219 | 209 | | |
220 | 210 | | |
221 | 211 | | |
222 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
223 | 220 | | |
224 | 221 | | |
225 | 222 | | |
| |||
477 | 474 | | |
478 | 475 | | |
479 | 476 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
| 477 | + | |
490 | 478 | | |
491 | 479 | | |
492 | 480 | | |
| |||
507 | 495 | | |
508 | 496 | | |
509 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
510 | 503 | | |
511 | 504 | | |
512 | 505 | | |
513 | 506 | | |
514 | 507 | | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
515 | 513 | | |
516 | 514 | | |
517 | 515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | | - | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | | - | |
| 62 | + | |
60 | 63 | | |
61 | | - | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
115 | | - | |
116 | | - | |
| 118 | + | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| |||
268 | 271 | | |
269 | 272 | | |
270 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments