Params for hosted instance deployment POST request.
| 359 | |
| 360 | |
| 361 | class DeploymentsPostParam(Base): |
| 362 | """Params for hosted instance deployment POST request.""" |
| 363 | |
| 364 | # Key is the name of the deployment, it becomes part of the URL |
| 365 | key: str = Field(..., regex=r"^[a-z0-9-]+$") |
| 366 | # Name of the app |
| 367 | app_name: str = Field(..., min_length=1) |
| 368 | # json encoded list of regions to deploy to |
| 369 | regions_json: str = Field(..., min_length=1) |
| 370 | # The app prefix, used on the server side only |
| 371 | app_prefix: str = Field(..., min_length=1) |
| 372 | # The version of nextpy CLI used to deploy |
| 373 | nextpy_version: str = Field(..., min_length=1) |
| 374 | # The number of CPUs |
| 375 | cpus: Optional[int] = None |
| 376 | # The memory in MB |
| 377 | memory_mb: Optional[int] = None |
| 378 | # Whether to auto start the hosted deployment |
| 379 | auto_start: Optional[bool] = None |
| 380 | # Whether to auto stop the hosted deployment when idling |
| 381 | auto_stop: Optional[bool] = None |
| 382 | # The frontend hostname to deploy to. This is used to deploy at hostname not in the regular domain. |
| 383 | frontend_hostname: Optional[str] = None |
| 384 | # The description of the deployment |
| 385 | description: Optional[str] = None |
| 386 | # The json encoded list of environment variables |
| 387 | envs_json: Optional[str] = None |
| 388 | # The command line prefix for tracing |
| 389 | nextpy_cli_entrypoint: Optional[str] = None |
| 390 | # The metrics endpoint |
| 391 | metrics_endpoint: Optional[str] = None |
| 392 | |
| 393 | |
| 394 | def deploy( |