From 3270e65a9b997ac6696dc958a086bea90861075e Mon Sep 17 00:00:00 2001 From: platform CI Date: Thu, 20 Aug 2026 20:45:35 +0000 Subject: [PATCH] Update clients to latest platform release (4.26.1) --- README.md | 6 +- docs/CreateCServeV3DeploymentRequest.md | 1 - docs/CreateComputeDeploymentRequest.md | 1 + docs/CreateInferenceV3DeploymentRequest.md | 1 - docs/DeploymentResponse.md | 2 +- docs/EXTERNALApi.md | 73 ++++++ docs/GetCServeV3DeploymentResponse.md | 1 - docs/GetComputeDeploymentResponse.md | 1 + docs/GetInferenceV3DeploymentResponse.md | 1 - docs/HardwarePresetResponse.md | 37 +++ docs/ListHardwarePresetResponse.md | 29 +++ docs/VolumeMount.md | 31 +++ platform_api_python_client/__init__.py | 5 +- .../api/external_api.py | 244 ++++++++++++++++++ platform_api_python_client/api_client.py | 2 +- platform_api_python_client/configuration.py | 2 +- platform_api_python_client/models/__init__.py | 3 + .../create_c_serve_v3_deployment_request.py | 9 +- .../create_compute_deployment_request.py | 14 +- .../create_inference_v3_deployment_request.py | 9 +- .../get_c_serve_v3_deployment_response.py | 9 +- .../models/get_compute_deployment_response.py | 12 +- .../get_inference_v3_deployment_response.py | 9 +- .../models/hardware_preset_response.py | 108 ++++++++ .../models/list_hardware_preset_response.py | 95 +++++++ .../models/volume_mount.py | 92 +++++++ pyproject.toml | 2 +- setup.py | 2 +- ...st_create_c_serve_v3_deployment_request.py | 1 - .../test_create_compute_deployment_request.py | 8 +- ..._create_inference_v3_deployment_request.py | 1 - test/test_deployment_response.py | 7 +- test/test_external_api.py | 7 + ...test_get_c_serve_v3_deployment_response.py | 1 - test/test_get_compute_deployment_response.py | 6 + ...st_get_inference_v3_deployment_response.py | 1 - test/test_hardware_preset_response.py | 71 +++++ test/test_list_hardware_preset_response.py | 78 ++++++ test/test_volume_mount.py | 55 ++++ 39 files changed, 985 insertions(+), 52 deletions(-) create mode 100644 docs/HardwarePresetResponse.md create mode 100644 docs/ListHardwarePresetResponse.md create mode 100644 docs/VolumeMount.md create mode 100644 platform_api_python_client/models/hardware_preset_response.py create mode 100644 platform_api_python_client/models/list_hardware_preset_response.py create mode 100644 platform_api_python_client/models/volume_mount.py create mode 100644 test/test_hardware_preset_response.py create mode 100644 test/test_list_hardware_preset_response.py create mode 100644 test/test_volume_mount.py diff --git a/README.md b/README.md index 06d5b5e..abe1838 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.1.0 -- Package version: 4.25.0 +- Package version: 4.26.1 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen @@ -132,6 +132,7 @@ Class | Method | HTTP request | Description *EXTERNALApi* | [**get_deployments_deployments_get**](docs/EXTERNALApi.md#get_deployments_deployments_get) | **GET** /deployments | Get Deployments *EXTERNALApi* | [**get_dynamo_deployment_deployments_dynamo_deployment_id_get**](docs/EXTERNALApi.md#get_dynamo_deployment_deployments_dynamo_deployment_id_get) | **GET** /deployments/dynamo/{deployment_id} | Get Dynamo Deployment *EXTERNALApi* | [**get_hardware_instances_hardware_instances_get**](docs/EXTERNALApi.md#get_hardware_instances_hardware_instances_get) | **GET** /hardware-instances | Get Hardware Instances +*EXTERNALApi* | [**get_hardware_presets_hardware_presets_get**](docs/EXTERNALApi.md#get_hardware_presets_hardware_presets_get) | **GET** /hardware-presets | Get Hardware Presets *EXTERNALApi* | [**get_inference_deployment_deployments_inference_deployment_id_get**](docs/EXTERNALApi.md#get_inference_deployment_deployments_inference_deployment_id_get) | **GET** /deployments/inference/{deployment_id} | Get Inference Deployment *EXTERNALApi* | [**get_inference_v3_deployment_deployments_inference_v3_deployment_id_get**](docs/EXTERNALApi.md#get_inference_v3_deployment_deployments_inference_v3_deployment_id_get) | **GET** /deployments/inference_v3/{deployment_id} | Get Inference V3 Deployment *EXTERNALApi* | [**get_job_deployment_deployments_job_deployment_id_get**](docs/EXTERNALApi.md#get_job_deployment_deployments_job_deployment_id_get) | **GET** /deployments/job/{deployment_id} | Get Job Deployment @@ -236,6 +237,7 @@ Class | Method | HTTP request | Description - [GpuTypeCapacity](docs/GpuTypeCapacity.md) - [HTTPValidationError](docs/HTTPValidationError.md) - [HardwareInstanceResponse](docs/HardwareInstanceResponse.md) + - [HardwarePresetResponse](docs/HardwarePresetResponse.md) - [ImagePullSecretCredentials](docs/ImagePullSecretCredentials.md) - [IngressNginx](docs/IngressNginx.md) - [InviteUserRequest](docs/InviteUserRequest.md) @@ -252,6 +254,7 @@ Class | Method | HTTP request | Description - [ListGetClusterResponse](docs/ListGetClusterResponse.md) - [ListGetDeploymentResponse](docs/ListGetDeploymentResponse.md) - [ListHardwareInstanceResponse](docs/ListHardwareInstanceResponse.md) + - [ListHardwarePresetResponse](docs/ListHardwarePresetResponse.md) - [ListPrebuiltImageResponse](docs/ListPrebuiltImageResponse.md) - [ListServiceAccountsResponse](docs/ListServiceAccountsResponse.md) - [ListUserVaultItemsResponse](docs/ListUserVaultItemsResponse.md) @@ -287,6 +290,7 @@ Class | Method | HTTP request | Description - [VaultScope](docs/VaultScope.md) - [VolumeAccessMode](docs/VolumeAccessMode.md) - [VolumeBackend](docs/VolumeBackend.md) + - [VolumeMount](docs/VolumeMount.md) - [VolumeStatus](docs/VolumeStatus.md) - [VolumeStatusResponse](docs/VolumeStatusResponse.md) diff --git a/docs/CreateCServeV3DeploymentRequest.md b/docs/CreateCServeV3DeploymentRequest.md index ef9681a..ccc39fa 100644 --- a/docs/CreateCServeV3DeploymentRequest.md +++ b/docs/CreateCServeV3DeploymentRequest.md @@ -19,7 +19,6 @@ Name | Type | Description | Notes **endpoint_certificate_authority** | **str** | | [optional] **min_replicas** | **int** | | **max_replicas** | **int** | | -**initial_replicas** | **int** | | [optional] **concurrency** | **int** | | [optional] **cooldown_period** | **int** | | [optional] **env_vars** | **Dict[str, str]** | | [optional] diff --git a/docs/CreateComputeDeploymentRequest.md b/docs/CreateComputeDeploymentRequest.md index 7989fa9..76f20a3 100644 --- a/docs/CreateComputeDeploymentRequest.md +++ b/docs/CreateComputeDeploymentRequest.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] **ssh_public_key** | **str** | | **enable_logging** | **bool** | | [optional] [default to False] +**volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] ## Example diff --git a/docs/CreateInferenceV3DeploymentRequest.md b/docs/CreateInferenceV3DeploymentRequest.md index 8abc3d5..b4d74f3 100644 --- a/docs/CreateInferenceV3DeploymentRequest.md +++ b/docs/CreateInferenceV3DeploymentRequest.md @@ -17,7 +17,6 @@ Name | Type | Description | Notes **port** | **int** | | **min_replicas** | **int** | | **max_replicas** | **int** | | -**initial_replicas** | **int** | | [optional] **concurrency** | **int** | | [optional] **cooldown_period** | **int** | | [optional] **healthcheck** | **str** | | [optional] diff --git a/docs/DeploymentResponse.md b/docs/DeploymentResponse.md index 88ead0f..e1916eb 100644 --- a/docs/DeploymentResponse.md +++ b/docs/DeploymentResponse.md @@ -34,7 +34,6 @@ Name | Type | Description | Notes **backend_protocol** | [**BackendProtocol**](BackendProtocol.md) | | [optional] **recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | | **cserve_version** | **str** | | [optional] -**initial_replicas** | **int** | | [optional] **session_affinity** | **bool** | Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state. | [optional] [default to False] **container_port** | **int** | | **healthcheck** | **str** | | [optional] @@ -45,6 +44,7 @@ Name | Type | Description | Notes **config_file** | [**ConfigFileMount**](ConfigFileMount.md) | | [optional] **metrics** | [**MetricsConfig**](MetricsConfig.md) | | [optional] **exposed_port** | **int** | | +**volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] **ssh_public_key** | **str** | | [optional] **ssh_password** | **str** | | [optional] diff --git a/docs/EXTERNALApi.md b/docs/EXTERNALApi.md index cbd63ed..0c0f311 100644 --- a/docs/EXTERNALApi.md +++ b/docs/EXTERNALApi.md @@ -42,6 +42,7 @@ Method | HTTP request | Description [**get_deployments_deployments_get**](EXTERNALApi.md#get_deployments_deployments_get) | **GET** /deployments | Get Deployments [**get_dynamo_deployment_deployments_dynamo_deployment_id_get**](EXTERNALApi.md#get_dynamo_deployment_deployments_dynamo_deployment_id_get) | **GET** /deployments/dynamo/{deployment_id} | Get Dynamo Deployment [**get_hardware_instances_hardware_instances_get**](EXTERNALApi.md#get_hardware_instances_hardware_instances_get) | **GET** /hardware-instances | Get Hardware Instances +[**get_hardware_presets_hardware_presets_get**](EXTERNALApi.md#get_hardware_presets_hardware_presets_get) | **GET** /hardware-presets | Get Hardware Presets [**get_inference_deployment_deployments_inference_deployment_id_get**](EXTERNALApi.md#get_inference_deployment_deployments_inference_deployment_id_get) | **GET** /deployments/inference/{deployment_id} | Get Inference Deployment [**get_inference_v3_deployment_deployments_inference_v3_deployment_id_get**](EXTERNALApi.md#get_inference_v3_deployment_deployments_inference_v3_deployment_id_get) | **GET** /deployments/inference_v3/{deployment_id} | Get Inference V3 Deployment [**get_job_deployment_deployments_job_deployment_id_get**](EXTERNALApi.md#get_job_deployment_deployments_job_deployment_id_get) | **GET** /deployments/job/{deployment_id} | Get Job Deployment @@ -3020,6 +3021,78 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_hardware_presets_hardware_presets_get** +> ListHardwarePresetResponse get_hardware_presets_hardware_presets_get() + +Get Hardware Presets + +### Example + +* Bearer Authentication (HTTPBearer): + +```python +import platform_api_python_client +from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse +from platform_api_python_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = platform_api_python_client.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: HTTPBearer +configuration = platform_api_python_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with platform_api_python_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = platform_api_python_client.EXTERNALApi(api_client) + + try: + # Get Hardware Presets + api_response = api_instance.get_hardware_presets_hardware_presets_get() + print("The response of EXTERNALApi->get_hardware_presets_hardware_presets_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EXTERNALApi->get_hardware_presets_hardware_presets_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ListHardwarePresetResponse**](ListHardwarePresetResponse.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_inference_deployment_deployments_inference_deployment_id_get** > GetInferenceDeploymentResponse get_inference_deployment_deployments_inference_deployment_id_get(deployment_id) diff --git a/docs/GetCServeV3DeploymentResponse.md b/docs/GetCServeV3DeploymentResponse.md index 57dd7fd..541f91e 100644 --- a/docs/GetCServeV3DeploymentResponse.md +++ b/docs/GetCServeV3DeploymentResponse.md @@ -21,7 +21,6 @@ Name | Type | Description | Notes **cserve_version** | **str** | | [optional] **min_replicas** | **int** | | **max_replicas** | **int** | | -**initial_replicas** | **int** | | [optional] **endpoint_certificate_authority** | **str** | | [optional] **endpoint_bearer_token** | **str** | | [optional] **concurrency** | **int** | | [optional] diff --git a/docs/GetComputeDeploymentResponse.md b/docs/GetComputeDeploymentResponse.md index b809bb8..55de2d3 100644 --- a/docs/GetComputeDeploymentResponse.md +++ b/docs/GetComputeDeploymentResponse.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **revision_number** | **int** | | **user_annotations** | **Dict[str, str]** | | [optional] **exposed_port** | **int** | | +**volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] **ssh_public_key** | **str** | | [optional] **ssh_password** | **str** | | [optional] **env_vars** | **Dict[str, str]** | | [optional] diff --git a/docs/GetInferenceV3DeploymentResponse.md b/docs/GetInferenceV3DeploymentResponse.md index 75b2c82..fa67454 100644 --- a/docs/GetInferenceV3DeploymentResponse.md +++ b/docs/GetInferenceV3DeploymentResponse.md @@ -20,7 +20,6 @@ Name | Type | Description | Notes **container_port** | **int** | | **min_replicas** | **int** | | **max_replicas** | **int** | | -**initial_replicas** | **int** | | [optional] **concurrency** | **int** | | [optional] **cooldown_period** | **int** | | [optional] [default to 1800] **healthcheck** | **str** | | [optional] diff --git a/docs/HardwarePresetResponse.md b/docs/HardwarePresetResponse.md new file mode 100644 index 0000000..d572138 --- /dev/null +++ b/docs/HardwarePresetResponse.md @@ -0,0 +1,37 @@ +# HardwarePresetResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**name** | **str** | | +**gpu_type** | **str** | | +**num_gpu** | **int** | | +**cpu** | **int** | | +**memory** | **int** | | +**accelerator_resource_key** | **str** | | +**node_affinity_labels** | **Dict[str, str]** | | +**accelerator_memory** | **int** | | [optional] + +## Example + +```python +from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of HardwarePresetResponse from a JSON string +hardware_preset_response_instance = HardwarePresetResponse.from_json(json) +# print the JSON string representation of the object +print(HardwarePresetResponse.to_json()) + +# convert the object into a dict +hardware_preset_response_dict = hardware_preset_response_instance.to_dict() +# create an instance of HardwarePresetResponse from a dict +hardware_preset_response_from_dict = HardwarePresetResponse.from_dict(hardware_preset_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListHardwarePresetResponse.md b/docs/ListHardwarePresetResponse.md new file mode 100644 index 0000000..2cd9a5f --- /dev/null +++ b/docs/ListHardwarePresetResponse.md @@ -0,0 +1,29 @@ +# ListHardwarePresetResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[HardwarePresetResponse]**](HardwarePresetResponse.md) | | + +## Example + +```python +from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListHardwarePresetResponse from a JSON string +list_hardware_preset_response_instance = ListHardwarePresetResponse.from_json(json) +# print the JSON string representation of the object +print(ListHardwarePresetResponse.to_json()) + +# convert the object into a dict +list_hardware_preset_response_dict = list_hardware_preset_response_instance.to_dict() +# create an instance of ListHardwarePresetResponse from a dict +list_hardware_preset_response_from_dict = ListHardwarePresetResponse.from_dict(list_hardware_preset_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VolumeMount.md b/docs/VolumeMount.md new file mode 100644 index 0000000..6e123fb --- /dev/null +++ b/docs/VolumeMount.md @@ -0,0 +1,31 @@ +# VolumeMount + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**volume_id** | **int** | | +**mount_path** | **str** | | +**read_only** | **bool** | | [optional] [default to False] + +## Example + +```python +from platform_api_python_client.models.volume_mount import VolumeMount + +# TODO update the JSON string below +json = "{}" +# create an instance of VolumeMount from a JSON string +volume_mount_instance = VolumeMount.from_json(json) +# print the JSON string representation of the object +print(VolumeMount.to_json()) + +# convert the object into a dict +volume_mount_dict = volume_mount_instance.to_dict() +# create an instance of VolumeMount from a dict +volume_mount_from_dict = VolumeMount.from_dict(volume_mount_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/platform_api_python_client/__init__.py b/platform_api_python_client/__init__.py index 996c84a..cf964a8 100644 --- a/platform_api_python_client/__init__.py +++ b/platform_api_python_client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "4.25.0" +__version__ = "4.26.1" # import apis into sdk package from platform_api_python_client.api.external_api import EXTERNALApi @@ -105,6 +105,7 @@ from platform_api_python_client.models.gpu_type_capacity import GpuTypeCapacity from platform_api_python_client.models.http_validation_error import HTTPValidationError from platform_api_python_client.models.hardware_instance_response import HardwareInstanceResponse +from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials from platform_api_python_client.models.ingress_nginx import IngressNginx from platform_api_python_client.models.invite_user_request import InviteUserRequest @@ -121,6 +122,7 @@ from platform_api_python_client.models.list_get_cluster_response import ListGetClusterResponse from platform_api_python_client.models.list_get_deployment_response import ListGetDeploymentResponse from platform_api_python_client.models.list_hardware_instance_response import ListHardwareInstanceResponse +from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse from platform_api_python_client.models.list_prebuilt_image_response import ListPrebuiltImageResponse from platform_api_python_client.models.list_service_accounts_response import ListServiceAccountsResponse from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse @@ -156,5 +158,6 @@ from platform_api_python_client.models.vault_scope import VaultScope from platform_api_python_client.models.volume_access_mode import VolumeAccessMode from platform_api_python_client.models.volume_backend import VolumeBackend +from platform_api_python_client.models.volume_mount import VolumeMount from platform_api_python_client.models.volume_status import VolumeStatus from platform_api_python_client.models.volume_status_response import VolumeStatusResponse diff --git a/platform_api_python_client/api/external_api.py b/platform_api_python_client/api/external_api.py index 0ccba88..3bf3981 100644 --- a/platform_api_python_client/api/external_api.py +++ b/platform_api_python_client/api/external_api.py @@ -70,6 +70,7 @@ from platform_api_python_client.models.list_get_cluster_response import ListGetClusterResponse from platform_api_python_client.models.list_get_deployment_response import ListGetDeploymentResponse from platform_api_python_client.models.list_hardware_instance_response import ListHardwareInstanceResponse +from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse from platform_api_python_client.models.list_prebuilt_image_response import ListPrebuiltImageResponse from platform_api_python_client.models.list_service_accounts_response import ListServiceAccountsResponse from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse @@ -10506,6 +10507,249 @@ def _get_hardware_instances_hardware_instances_get_serialize( + @validate_call + def get_hardware_presets_hardware_presets_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListHardwarePresetResponse: + """Get Hardware Presets + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_hardware_presets_hardware_presets_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListHardwarePresetResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_hardware_presets_hardware_presets_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListHardwarePresetResponse]: + """Get Hardware Presets + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_hardware_presets_hardware_presets_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListHardwarePresetResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_hardware_presets_hardware_presets_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Hardware Presets + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_hardware_presets_hardware_presets_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListHardwarePresetResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_hardware_presets_hardware_presets_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/hardware-presets', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_inference_deployment_deployments_inference_deployment_id_get( self, diff --git a/platform_api_python_client/api_client.py b/platform_api_python_client/api_client.py index 0cd9af5..68804be 100644 --- a/platform_api_python_client/api_client.py +++ b/platform_api_python_client/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/4.25.0/python' + self.user_agent = 'OpenAPI-Generator/4.26.1/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/platform_api_python_client/configuration.py b/platform_api_python_client/configuration.py index c9287f5..7a0ea28 100644 --- a/platform_api_python_client/configuration.py +++ b/platform_api_python_client/configuration.py @@ -392,7 +392,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.1.0\n"\ - "SDK Package Version: 4.25.0".\ + "SDK Package Version: 4.26.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/platform_api_python_client/models/__init__.py b/platform_api_python_client/models/__init__.py index 0d0c253..a2b7dee 100644 --- a/platform_api_python_client/models/__init__.py +++ b/platform_api_python_client/models/__init__.py @@ -88,6 +88,7 @@ from platform_api_python_client.models.gpu_type_capacity import GpuTypeCapacity from platform_api_python_client.models.http_validation_error import HTTPValidationError from platform_api_python_client.models.hardware_instance_response import HardwareInstanceResponse +from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials from platform_api_python_client.models.ingress_nginx import IngressNginx from platform_api_python_client.models.invite_user_request import InviteUserRequest @@ -104,6 +105,7 @@ from platform_api_python_client.models.list_get_cluster_response import ListGetClusterResponse from platform_api_python_client.models.list_get_deployment_response import ListGetDeploymentResponse from platform_api_python_client.models.list_hardware_instance_response import ListHardwareInstanceResponse +from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse from platform_api_python_client.models.list_prebuilt_image_response import ListPrebuiltImageResponse from platform_api_python_client.models.list_service_accounts_response import ListServiceAccountsResponse from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse @@ -139,5 +141,6 @@ from platform_api_python_client.models.vault_scope import VaultScope from platform_api_python_client.models.volume_access_mode import VolumeAccessMode from platform_api_python_client.models.volume_backend import VolumeBackend +from platform_api_python_client.models.volume_mount import VolumeMount from platform_api_python_client.models.volume_status import VolumeStatus from platform_api_python_client.models.volume_status_response import VolumeStatusResponse diff --git a/platform_api_python_client/models/create_c_serve_v3_deployment_request.py b/platform_api_python_client/models/create_c_serve_v3_deployment_request.py index e4556e9..73f6167 100644 --- a/platform_api_python_client/models/create_c_serve_v3_deployment_request.py +++ b/platform_api_python_client/models/create_c_serve_v3_deployment_request.py @@ -42,14 +42,13 @@ class CreateCServeV3DeploymentRequest(BaseModel): endpoint_certificate_authority: Optional[StrictStr] = None min_replicas: StrictInt max_replicas: StrictInt - initial_replicas: Optional[StrictInt] = None concurrency: Optional[StrictInt] = None cooldown_period: Optional[StrictInt] = None env_vars: Optional[Dict[str, StrictStr]] = None enable_logging: Optional[StrictBool] = True enable_node_model_cache: Optional[StrictBool] = False session_affinity: Optional[StrictBool] = Field(default=False, description="Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state.") - __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"] + __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -135,11 +134,6 @@ def to_dict(self) -> Dict[str, Any]: if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set: _dict['endpoint_certificate_authority'] = None - # set to None if initial_replicas (nullable) is None - # and model_fields_set contains the field - if self.initial_replicas is None and "initial_replicas" in self.model_fields_set: - _dict['initial_replicas'] = None - # set to None if concurrency (nullable) is None # and model_fields_set contains the field if self.concurrency is None and "concurrency" in self.model_fields_set: @@ -176,7 +170,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "endpoint_certificate_authority": obj.get("endpoint_certificate_authority"), "min_replicas": obj.get("min_replicas"), "max_replicas": obj.get("max_replicas"), - "initial_replicas": obj.get("initial_replicas"), "concurrency": obj.get("concurrency"), "cooldown_period": obj.get("cooldown_period"), "env_vars": obj.get("env_vars"), diff --git a/platform_api_python_client/models/create_compute_deployment_request.py b/platform_api_python_client/models/create_compute_deployment_request.py index 8027a74..9499943 100644 --- a/platform_api_python_client/models/create_compute_deployment_request.py +++ b/platform_api_python_client/models/create_compute_deployment_request.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials +from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self @@ -37,7 +38,8 @@ class CreateComputeDeploymentRequest(BaseModel): image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None ssh_public_key: StrictStr enable_logging: Optional[StrictBool] = False - __properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "ssh_public_key", "enable_logging"] + volume_mounts: Optional[List[VolumeMount]] = None + __properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "ssh_public_key", "enable_logging", "volume_mounts"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -88,6 +90,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials if self.image_pull_secret_credentials: _dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list) + _items = [] + if self.volume_mounts: + for _item_volume_mounts in self.volume_mounts: + if _item_volume_mounts: + _items.append(_item_volume_mounts.to_dict()) + _dict['volume_mounts'] = _items # set to None if user_annotations (nullable) is None # and model_fields_set contains the field if self.user_annotations is None and "user_annotations" in self.model_fields_set: @@ -118,7 +127,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "image_url": obj.get("image_url"), "image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None, "ssh_public_key": obj.get("ssh_public_key"), - "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False + "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False, + "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None }) return _obj diff --git a/platform_api_python_client/models/create_inference_v3_deployment_request.py b/platform_api_python_client/models/create_inference_v3_deployment_request.py index 91a7408..28eacfa 100644 --- a/platform_api_python_client/models/create_inference_v3_deployment_request.py +++ b/platform_api_python_client/models/create_inference_v3_deployment_request.py @@ -43,7 +43,6 @@ class CreateInferenceV3DeploymentRequest(BaseModel): port: Annotated[int, Field(le=65535, strict=True, ge=1)] min_replicas: StrictInt max_replicas: StrictInt - initial_replicas: Optional[StrictInt] = None concurrency: Optional[StrictInt] = None cooldown_period: Optional[StrictInt] = None healthcheck: Optional[StrictStr] = None @@ -58,7 +57,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel): session_affinity: Optional[StrictBool] = Field(default=False, description="Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state.") config_file: Optional[ConfigFileMount] = None metrics: Optional[MetricsConfig] = None - __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority", "hf_token", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"] + __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority", "hf_token", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -135,11 +134,6 @@ def to_dict(self) -> Dict[str, Any]: if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set: _dict['image_pull_secret_credentials'] = None - # set to None if initial_replicas (nullable) is None - # and model_fields_set contains the field - if self.initial_replicas is None and "initial_replicas" in self.model_fields_set: - _dict['initial_replicas'] = None - # set to None if concurrency (nullable) is None # and model_fields_set contains the field if self.concurrency is None and "concurrency" in self.model_fields_set: @@ -214,7 +208,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "port": obj.get("port"), "min_replicas": obj.get("min_replicas"), "max_replicas": obj.get("max_replicas"), - "initial_replicas": obj.get("initial_replicas"), "concurrency": obj.get("concurrency"), "cooldown_period": obj.get("cooldown_period"), "healthcheck": obj.get("healthcheck"), diff --git a/platform_api_python_client/models/get_c_serve_v3_deployment_response.py b/platform_api_python_client/models/get_c_serve_v3_deployment_response.py index de83b5c..8489d45 100644 --- a/platform_api_python_client/models/get_c_serve_v3_deployment_response.py +++ b/platform_api_python_client/models/get_c_serve_v3_deployment_response.py @@ -46,7 +46,6 @@ class GetCServeV3DeploymentResponse(BaseModel): cserve_version: Optional[StrictStr] = None min_replicas: StrictInt max_replicas: StrictInt - initial_replicas: Optional[StrictInt] = None endpoint_certificate_authority: Optional[StrictStr] = None endpoint_bearer_token: Optional[StrictStr] = None concurrency: Optional[StrictInt] = None @@ -55,7 +54,7 @@ class GetCServeV3DeploymentResponse(BaseModel): enable_logging: Optional[StrictBool] = True enable_node_model_cache: Optional[StrictBool] = False session_affinity: Optional[StrictBool] = Field(default=False, description="Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state.") - __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "recipe", "cserve_version", "min_replicas", "max_replicas", "initial_replicas", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"] + __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "recipe", "cserve_version", "min_replicas", "max_replicas", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"] model_config = ConfigDict( populate_by_name=True, @@ -114,11 +113,6 @@ def to_dict(self) -> Dict[str, Any]: if self.cserve_version is None and "cserve_version" in self.model_fields_set: _dict['cserve_version'] = None - # set to None if initial_replicas (nullable) is None - # and model_fields_set contains the field - if self.initial_replicas is None and "initial_replicas" in self.model_fields_set: - _dict['initial_replicas'] = None - # set to None if endpoint_certificate_authority (nullable) is None # and model_fields_set contains the field if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set: @@ -162,7 +156,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "cserve_version": obj.get("cserve_version"), "min_replicas": obj.get("min_replicas"), "max_replicas": obj.get("max_replicas"), - "initial_replicas": obj.get("initial_replicas"), "endpoint_certificate_authority": obj.get("endpoint_certificate_authority"), "endpoint_bearer_token": obj.get("endpoint_bearer_token"), "concurrency": obj.get("concurrency"), diff --git a/platform_api_python_client/models/get_compute_deployment_response.py b/platform_api_python_client/models/get_compute_deployment_response.py index 734917a..49a16c8 100644 --- a/platform_api_python_client/models/get_compute_deployment_response.py +++ b/platform_api_python_client/models/get_compute_deployment_response.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.deployment_status import DeploymentStatus from platform_api_python_client.models.deployment_type import DeploymentType from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials +from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self @@ -43,12 +44,13 @@ class GetComputeDeploymentResponse(BaseModel): revision_number: StrictInt user_annotations: Optional[Dict[str, StrictStr]] = None exposed_port: StrictInt + volume_mounts: Optional[List[VolumeMount]] = None ssh_public_key: Optional[StrictStr] = None ssh_password: Optional[StrictStr] = None env_vars: Optional[Dict[str, StrictStr]] = None image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None enable_logging: Optional[StrictBool] = True - __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "exposed_port", "ssh_public_key", "ssh_password", "env_vars", "image_pull_secret_credentials", "enable_logging"] + __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "exposed_port", "volume_mounts", "ssh_public_key", "ssh_password", "env_vars", "image_pull_secret_credentials", "enable_logging"] model_config = ConfigDict( populate_by_name=True, @@ -89,6 +91,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list) + _items = [] + if self.volume_mounts: + for _item_volume_mounts in self.volume_mounts: + if _item_volume_mounts: + _items.append(_item_volume_mounts.to_dict()) + _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials if self.image_pull_secret_credentials: _dict['image_pull_secret_credentials'] = self.image_pull_secret_credentials.to_dict() @@ -147,6 +156,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "revision_number": obj.get("revision_number"), "user_annotations": obj.get("user_annotations"), "exposed_port": obj.get("exposed_port"), + "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None, "ssh_public_key": obj.get("ssh_public_key"), "ssh_password": obj.get("ssh_password"), "env_vars": obj.get("env_vars"), diff --git a/platform_api_python_client/models/get_inference_v3_deployment_response.py b/platform_api_python_client/models/get_inference_v3_deployment_response.py index 6f7e946..bd9deec 100644 --- a/platform_api_python_client/models/get_inference_v3_deployment_response.py +++ b/platform_api_python_client/models/get_inference_v3_deployment_response.py @@ -48,7 +48,6 @@ class GetInferenceV3DeploymentResponse(BaseModel): container_port: StrictInt min_replicas: StrictInt max_replicas: StrictInt - initial_replicas: Optional[StrictInt] = None concurrency: Optional[StrictInt] = None cooldown_period: Optional[StrictInt] = 1800 healthcheck: Optional[StrictStr] = None @@ -65,7 +64,7 @@ class GetInferenceV3DeploymentResponse(BaseModel): session_affinity: Optional[StrictBool] = Field(default=False, description="Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state.") config_file: Optional[ConfigFileMount] = None metrics: Optional[MetricsConfig] = None - __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "container_port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "healthcheck", "endpoint_certificate_authority", "endpoint_bearer_token", "env_vars", "command", "command_args", "original_command", "image_pull_secret_credentials", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"] + __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "container_port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "endpoint_certificate_authority", "endpoint_bearer_token", "env_vars", "command", "command_args", "original_command", "image_pull_secret_credentials", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"] model_config = ConfigDict( populate_by_name=True, @@ -125,11 +124,6 @@ def to_dict(self) -> Dict[str, Any]: if self.user_annotations is None and "user_annotations" in self.model_fields_set: _dict['user_annotations'] = None - # set to None if initial_replicas (nullable) is None - # and model_fields_set contains the field - if self.initial_replicas is None and "initial_replicas" in self.model_fields_set: - _dict['initial_replicas'] = None - # set to None if concurrency (nullable) is None # and model_fields_set contains the field if self.concurrency is None and "concurrency" in self.model_fields_set: @@ -212,7 +206,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "container_port": obj.get("container_port"), "min_replicas": obj.get("min_replicas"), "max_replicas": obj.get("max_replicas"), - "initial_replicas": obj.get("initial_replicas"), "concurrency": obj.get("concurrency"), "cooldown_period": obj.get("cooldown_period") if obj.get("cooldown_period") is not None else 1800, "healthcheck": obj.get("healthcheck"), diff --git a/platform_api_python_client/models/hardware_preset_response.py b/platform_api_python_client/models/hardware_preset_response.py new file mode 100644 index 0000000..148f4a9 --- /dev/null +++ b/platform_api_python_client/models/hardware_preset_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Platform External API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HardwarePresetResponse(BaseModel): + """ + HardwarePresetResponse + """ # noqa: E501 + id: StrictInt + name: StrictStr + gpu_type: StrictStr + num_gpu: StrictInt + cpu: StrictInt + memory: StrictInt + accelerator_resource_key: StrictStr + node_affinity_labels: Dict[str, StrictStr] + accelerator_memory: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["id", "name", "gpu_type", "num_gpu", "cpu", "memory", "accelerator_resource_key", "node_affinity_labels", "accelerator_memory"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HardwarePresetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if accelerator_memory (nullable) is None + # and model_fields_set contains the field + if self.accelerator_memory is None and "accelerator_memory" in self.model_fields_set: + _dict['accelerator_memory'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HardwarePresetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "gpu_type": obj.get("gpu_type"), + "num_gpu": obj.get("num_gpu"), + "cpu": obj.get("cpu"), + "memory": obj.get("memory"), + "accelerator_resource_key": obj.get("accelerator_resource_key"), + "node_affinity_labels": obj.get("node_affinity_labels"), + "accelerator_memory": obj.get("accelerator_memory") + }) + return _obj + + diff --git a/platform_api_python_client/models/list_hardware_preset_response.py b/platform_api_python_client/models/list_hardware_preset_response.py new file mode 100644 index 0000000..b94c8c8 --- /dev/null +++ b/platform_api_python_client/models/list_hardware_preset_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Platform External API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListHardwarePresetResponse(BaseModel): + """ + ListHardwarePresetResponse + """ # noqa: E501 + results: List[HardwarePresetResponse] + __properties: ClassVar[List[str]] = ["results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListHardwarePresetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListHardwarePresetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [HardwarePresetResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/platform_api_python_client/models/volume_mount.py b/platform_api_python_client/models/volume_mount.py new file mode 100644 index 0000000..ef470ca --- /dev/null +++ b/platform_api_python_client/models/volume_mount.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Platform External API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VolumeMount(BaseModel): + """ + VolumeMount + """ # noqa: E501 + volume_id: StrictInt + mount_path: Annotated[str, Field(min_length=1, strict=True)] + read_only: Optional[StrictBool] = False + __properties: ClassVar[List[str]] = ["volume_id", "mount_path", "read_only"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VolumeMount from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VolumeMount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "volume_id": obj.get("volume_id"), + "mount_path": obj.get("mount_path"), + "read_only": obj.get("read_only") if obj.get("read_only") is not None else False + }) + return _obj + + diff --git a/pyproject.toml b/pyproject.toml index 5562839..17c096d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "platform_api_python_client" -version = "4.25.0" +version = "4.26.1" description = "Platform External API" authors = ["OpenAPI Generator Community "] license = "NoLicense" diff --git a/setup.py b/setup.py index d7ca34c..55d7007 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "platform-api-python-client" -VERSION = "4.25.0" +VERSION = "4.26.1" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 1.25.3, < 3.0.0", diff --git a/test/test_create_c_serve_v3_deployment_request.py b/test/test_create_c_serve_v3_deployment_request.py index 57ca158..82f8d2d 100644 --- a/test/test_create_c_serve_v3_deployment_request.py +++ b/test/test_create_c_serve_v3_deployment_request.py @@ -51,7 +51,6 @@ def make_instance(self, include_optional) -> CreateCServeV3DeploymentRequest: endpoint_certificate_authority = '', min_replicas = 56, max_replicas = 56, - initial_replicas = 56, concurrency = 56, cooldown_period = 56, env_vars = { diff --git a/test/test_create_compute_deployment_request.py b/test/test_create_compute_deployment_request.py index cc72613..2d663c4 100644 --- a/test/test_create_compute_deployment_request.py +++ b/test/test_create_compute_deployment_request.py @@ -47,7 +47,13 @@ def make_instance(self, include_optional) -> CreateComputeDeploymentRequest: username = '', password = '', ), ssh_public_key = '', - enable_logging = True + enable_logging = True, + volume_mounts = [ + platform_api_python_client.models.volume_mount.VolumeMount( + volume_id = 56, + mount_path = '0', + read_only = True, ) + ] ) else: return CreateComputeDeploymentRequest( diff --git a/test/test_create_inference_v3_deployment_request.py b/test/test_create_inference_v3_deployment_request.py index 46438e5..90d655c 100644 --- a/test/test_create_inference_v3_deployment_request.py +++ b/test/test_create_inference_v3_deployment_request.py @@ -51,7 +51,6 @@ def make_instance(self, include_optional) -> CreateInferenceV3DeploymentRequest: port = 1.0, min_replicas = 56, max_replicas = 56, - initial_replicas = 56, concurrency = 56, cooldown_period = 56, healthcheck = '', diff --git a/test/test_deployment_response.py b/test/test_deployment_response.py index 94b9c8d..47ced09 100644 --- a/test/test_deployment_response.py +++ b/test/test_deployment_response.py @@ -68,7 +68,6 @@ def make_instance(self, include_optional) -> DeploymentResponse: backend_protocol = 'HTTP', recipe = { }, cserve_version = '', - initial_replicas = 56, session_affinity = True, container_port = 56, healthcheck = '', @@ -90,6 +89,12 @@ def make_instance(self, include_optional) -> DeploymentResponse: port = 1.0, path = '/W(,j>6>eow3jCO&}nl`:&~', ), exposed_port = 56, + volume_mounts = [ + platform_api_python_client.models.volume_mount.VolumeMount( + volume_id = 56, + mount_path = '0', + read_only = True, ) + ], ssh_public_key = '', ssh_password = '' ) diff --git a/test/test_external_api.py b/test/test_external_api.py index d88780d..6be082e 100644 --- a/test/test_external_api.py +++ b/test/test_external_api.py @@ -292,6 +292,13 @@ def test_get_hardware_instances_hardware_instances_get(self) -> None: """ pass + def test_get_hardware_presets_hardware_presets_get(self) -> None: + """Test case for get_hardware_presets_hardware_presets_get + + Get Hardware Presets + """ + pass + def test_get_inference_deployment_deployments_inference_deployment_id_get(self) -> None: """Test case for get_inference_deployment_deployments_inference_deployment_id_get diff --git a/test/test_get_c_serve_v3_deployment_response.py b/test/test_get_c_serve_v3_deployment_response.py index 4a2cc05..55332d8 100644 --- a/test/test_get_c_serve_v3_deployment_response.py +++ b/test/test_get_c_serve_v3_deployment_response.py @@ -53,7 +53,6 @@ def make_instance(self, include_optional) -> GetCServeV3DeploymentResponse: cserve_version = '', min_replicas = 56, max_replicas = 56, - initial_replicas = 56, endpoint_certificate_authority = '', endpoint_bearer_token = '', concurrency = 56, diff --git a/test/test_get_compute_deployment_response.py b/test/test_get_compute_deployment_response.py index 8f8ef8f..2a38c36 100644 --- a/test/test_get_compute_deployment_response.py +++ b/test/test_get_compute_deployment_response.py @@ -50,6 +50,12 @@ def make_instance(self, include_optional) -> GetComputeDeploymentResponse: 'key' : '' }, exposed_port = 56, + volume_mounts = [ + platform_api_python_client.models.volume_mount.VolumeMount( + volume_id = 56, + mount_path = '0', + read_only = True, ) + ], ssh_public_key = '', ssh_password = '', env_vars = { diff --git a/test/test_get_inference_v3_deployment_response.py b/test/test_get_inference_v3_deployment_response.py index df6236a..be4853c 100644 --- a/test/test_get_inference_v3_deployment_response.py +++ b/test/test_get_inference_v3_deployment_response.py @@ -52,7 +52,6 @@ def make_instance(self, include_optional) -> GetInferenceV3DeploymentResponse: container_port = 56, min_replicas = 56, max_replicas = 56, - initial_replicas = 56, concurrency = 56, cooldown_period = 56, healthcheck = '', diff --git a/test/test_hardware_preset_response.py b/test/test_hardware_preset_response.py new file mode 100644 index 0000000..19fdeba --- /dev/null +++ b/test/test_hardware_preset_response.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Platform External API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse + +class TestHardwarePresetResponse(unittest.TestCase): + """HardwarePresetResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HardwarePresetResponse: + """Test HardwarePresetResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HardwarePresetResponse` + """ + model = HardwarePresetResponse() + if include_optional: + return HardwarePresetResponse( + id = 56, + name = '', + gpu_type = '', + num_gpu = 56, + cpu = 56, + memory = 56, + accelerator_resource_key = '', + node_affinity_labels = { + 'key' : '' + }, + accelerator_memory = 56 + ) + else: + return HardwarePresetResponse( + id = 56, + name = '', + gpu_type = '', + num_gpu = 56, + cpu = 56, + memory = 56, + accelerator_resource_key = '', + node_affinity_labels = { + 'key' : '' + }, + ) + """ + + def testHardwarePresetResponse(self): + """Test HardwarePresetResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_hardware_preset_response.py b/test/test_list_hardware_preset_response.py new file mode 100644 index 0000000..c724bf7 --- /dev/null +++ b/test/test_list_hardware_preset_response.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Platform External API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse + +class TestListHardwarePresetResponse(unittest.TestCase): + """ListHardwarePresetResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListHardwarePresetResponse: + """Test ListHardwarePresetResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListHardwarePresetResponse` + """ + model = ListHardwarePresetResponse() + if include_optional: + return ListHardwarePresetResponse( + results = [ + platform_api_python_client.models.hardware_preset_response.HardwarePresetResponse( + id = 56, + name = '', + gpu_type = '', + num_gpu = 56, + cpu = 56, + memory = 56, + accelerator_resource_key = '', + node_affinity_labels = { + 'key' : '' + }, + accelerator_memory = 56, ) + ] + ) + else: + return ListHardwarePresetResponse( + results = [ + platform_api_python_client.models.hardware_preset_response.HardwarePresetResponse( + id = 56, + name = '', + gpu_type = '', + num_gpu = 56, + cpu = 56, + memory = 56, + accelerator_resource_key = '', + node_affinity_labels = { + 'key' : '' + }, + accelerator_memory = 56, ) + ], + ) + """ + + def testListHardwarePresetResponse(self): + """Test ListHardwarePresetResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_volume_mount.py b/test/test_volume_mount.py new file mode 100644 index 0000000..649c273 --- /dev/null +++ b/test/test_volume_mount.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Platform External API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from platform_api_python_client.models.volume_mount import VolumeMount + +class TestVolumeMount(unittest.TestCase): + """VolumeMount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VolumeMount: + """Test VolumeMount + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VolumeMount` + """ + model = VolumeMount() + if include_optional: + return VolumeMount( + volume_id = 56, + mount_path = '0', + read_only = True + ) + else: + return VolumeMount( + volume_id = 56, + mount_path = '0', + ) + """ + + def testVolumeMount(self): + """Test VolumeMount""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()