From 5b817eb93c770f066f3a080b09e7bc1338279eaf Mon Sep 17 00:00:00 2001 From: platform CI Date: Wed, 27 Aug 2025 04:28:15 +0000 Subject: [PATCH] Update clients to latest platform release (4.1.8) --- README.md | 4 +- docs/CreateCServeV3DeploymentRequest.md | 2 + docs/CreateInferenceV3DeploymentRequest.md | 3 + docs/DeploymentResponse.md | 1 + docs/EXTERNALApi.md | 9 +- docs/GetInferenceV3DeploymentResponse.md | 1 + docs/ImagePullSecretCredentials.md | 30 ++++++ docs/RolloutStatus.md | 2 +- docs/RolloutStrategyParams.md | 30 ++++++ platform_api_python_client/__init__.py | 4 +- .../api/external_api.py | 29 ++++++ platform_api_python_client/api_client.py | 2 +- platform_api_python_client/configuration.py | 2 +- platform_api_python_client/models/__init__.py | 2 + .../create_c_serve_v3_deployment_request.py | 16 ++- .../create_inference_v3_deployment_request.py | 27 ++++- .../get_inference_v3_deployment_response.py | 15 ++- .../models/image_pull_secret_credentials.py | 89 +++++++++++++++++ .../models/rollout_status.py | 2 +- .../models/rollout_strategy_params.py | 99 +++++++++++++++++++ pyproject.toml | 2 +- setup.py | 2 +- ...st_create_c_serve_v3_deployment_request.py | 2 + ..._create_inference_v3_deployment_request.py | 5 + test/test_deployment_response.py | 5 +- ...st_get_inference_v3_deployment_response.py | 5 +- test/test_image_pull_secret_credentials.py | 54 ++++++++++ test/test_rollout_strategy_params.py | 52 ++++++++++ 28 files changed, 479 insertions(+), 17 deletions(-) create mode 100644 docs/ImagePullSecretCredentials.md create mode 100644 docs/RolloutStrategyParams.md create mode 100644 platform_api_python_client/models/image_pull_secret_credentials.py create mode 100644 platform_api_python_client/models/rollout_strategy_params.py create mode 100644 test/test_image_pull_secret_credentials.py create mode 100644 test/test_rollout_strategy_params.py diff --git a/README.md b/README.md index 019e0ed..902b4be 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.1.7 +- Package version: 4.1.8 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen @@ -186,6 +186,7 @@ Class | Method | HTTP request | Description - [GetRagDeploymentResponse](docs/GetRagDeploymentResponse.md) - [HTTPValidationError](docs/HTTPValidationError.md) - [HardwareInstanceResponse](docs/HardwareInstanceResponse.md) + - [ImagePullSecretCredentials](docs/ImagePullSecretCredentials.md) - [ListAPIKeyResponse](docs/ListAPIKeyResponse.md) - [ListCServeRecipeResponse](docs/ListCServeRecipeResponse.md) - [ListDailyBillResponse](docs/ListDailyBillResponse.md) @@ -201,6 +202,7 @@ Class | Method | HTTP request | Description - [PrebuiltImageResponse](docs/PrebuiltImageResponse.md) - [RevisionPodDetails](docs/RevisionPodDetails.md) - [RolloutStatus](docs/RolloutStatus.md) + - [RolloutStrategyParams](docs/RolloutStrategyParams.md) - [ServiceStatus](docs/ServiceStatus.md) - [UpdateDeploymentResponse](docs/UpdateDeploymentResponse.md) - [UpdateDeploymentStatusV3Request](docs/UpdateDeploymentStatusV3Request.md) diff --git a/docs/CreateCServeV3DeploymentRequest.md b/docs/CreateCServeV3DeploymentRequest.md index 5bb4711..457910f 100644 --- a/docs/CreateCServeV3DeploymentRequest.md +++ b/docs/CreateCServeV3DeploymentRequest.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**max_surge** | **int** | | [optional] +**max_unavailable** | **int** | | [optional] **name** | **str** | | **cluster_id** | **int** | | **hardware_instance_id** | **int** | | diff --git a/docs/CreateInferenceV3DeploymentRequest.md b/docs/CreateInferenceV3DeploymentRequest.md index ef32dd6..ce88cc3 100644 --- a/docs/CreateInferenceV3DeploymentRequest.md +++ b/docs/CreateInferenceV3DeploymentRequest.md @@ -5,10 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**max_surge** | **int** | | [optional] +**max_unavailable** | **int** | | [optional] **name** | **str** | | **cluster_id** | **int** | | **hardware_instance_id** | **int** | | **image_url** | **str** | | +**image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] **port** | **int** | | **min_replicas** | **int** | | **max_replicas** | **int** | | diff --git a/docs/DeploymentResponse.md b/docs/DeploymentResponse.md index 9378e81..0e97c76 100644 --- a/docs/DeploymentResponse.md +++ b/docs/DeploymentResponse.md @@ -29,6 +29,7 @@ Name | Type | Description | Notes **healthcheck** | **str** | | [optional] **command** | **List[str]** | | [optional] **command_args** | **List[str]** | | [optional] +**image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] ## Example diff --git a/docs/EXTERNALApi.md b/docs/EXTERNALApi.md index 245497c..67d5c99 100644 --- a/docs/EXTERNALApi.md +++ b/docs/EXTERNALApi.md @@ -2642,7 +2642,7 @@ 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) # **rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put** -> UpdateDeploymentResponse rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put(deployment_id, revision_number) +> UpdateDeploymentResponse rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put(deployment_id, revision_number, rollout_strategy_params=rollout_strategy_params) Rollout Existing Revision @@ -2654,6 +2654,7 @@ Change the selected revision for a deployment and apply the changes. ```python import platform_api_python_client +from platform_api_python_client.models.rollout_strategy_params import RolloutStrategyParams from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse from platform_api_python_client.rest import ApiException from pprint import pprint @@ -2680,10 +2681,11 @@ with platform_api_python_client.ApiClient(configuration) as api_client: api_instance = platform_api_python_client.EXTERNALApi(api_client) deployment_id = 56 # int | revision_number = 56 # int | + rollout_strategy_params = platform_api_python_client.RolloutStrategyParams() # RolloutStrategyParams | (optional) try: # Rollout Existing Revision - api_response = api_instance.rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put(deployment_id, revision_number) + api_response = api_instance.rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put(deployment_id, revision_number, rollout_strategy_params=rollout_strategy_params) print("The response of EXTERNALApi->rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put:\n") pprint(api_response) except Exception as e: @@ -2699,6 +2701,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **deployment_id** | **int**| | **revision_number** | **int**| | + **rollout_strategy_params** | [**RolloutStrategyParams**](RolloutStrategyParams.md)| | [optional] ### Return type @@ -2710,7 +2713,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details diff --git a/docs/GetInferenceV3DeploymentResponse.md b/docs/GetInferenceV3DeploymentResponse.md index 98e1e56..49cc5be 100644 --- a/docs/GetInferenceV3DeploymentResponse.md +++ b/docs/GetInferenceV3DeploymentResponse.md @@ -27,6 +27,7 @@ Name | Type | Description | Notes **env_vars** | **Dict[str, str]** | | [optional] **command** | **List[str]** | | [optional] **command_args** | **List[str]** | | [optional] +**image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] ## Example diff --git a/docs/ImagePullSecretCredentials.md b/docs/ImagePullSecretCredentials.md new file mode 100644 index 0000000..5c7d096 --- /dev/null +++ b/docs/ImagePullSecretCredentials.md @@ -0,0 +1,30 @@ +# ImagePullSecretCredentials + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | | +**password** | **str** | | + +## Example + +```python +from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePullSecretCredentials from a JSON string +image_pull_secret_credentials_instance = ImagePullSecretCredentials.from_json(json) +# print the JSON string representation of the object +print(ImagePullSecretCredentials.to_json()) + +# convert the object into a dict +image_pull_secret_credentials_dict = image_pull_secret_credentials_instance.to_dict() +# create an instance of ImagePullSecretCredentials from a dict +image_pull_secret_credentials_from_dict = ImagePullSecretCredentials.from_dict(image_pull_secret_credentials_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/RolloutStatus.md b/docs/RolloutStatus.md index a902dfe..d2451b9 100644 --- a/docs/RolloutStatus.md +++ b/docs/RolloutStatus.md @@ -11,7 +11,7 @@ * `DEGRADED` (value: `'Degraded'`) -* `UNKNOWN` (value: `'Unknown'`) +* `MISSING` (value: `'Missing'`) [[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/RolloutStrategyParams.md b/docs/RolloutStrategyParams.md new file mode 100644 index 0000000..e697f46 --- /dev/null +++ b/docs/RolloutStrategyParams.md @@ -0,0 +1,30 @@ +# RolloutStrategyParams + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max_surge** | **int** | | [optional] +**max_unavailable** | **int** | | [optional] + +## Example + +```python +from platform_api_python_client.models.rollout_strategy_params import RolloutStrategyParams + +# TODO update the JSON string below +json = "{}" +# create an instance of RolloutStrategyParams from a JSON string +rollout_strategy_params_instance = RolloutStrategyParams.from_json(json) +# print the JSON string representation of the object +print(RolloutStrategyParams.to_json()) + +# convert the object into a dict +rollout_strategy_params_dict = rollout_strategy_params_instance.to_dict() +# create an instance of RolloutStrategyParams from a dict +rollout_strategy_params_from_dict = RolloutStrategyParams.from_dict(rollout_strategy_params_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 c526470..6ff616a 100644 --- a/platform_api_python_client/__init__.py +++ b/platform_api_python_client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "4.1.7" +__version__ = "4.1.8" # import apis into sdk package from platform_api_python_client.api.external_api import EXTERNALApi @@ -74,6 +74,7 @@ from platform_api_python_client.models.get_rag_deployment_response import GetRagDeploymentResponse 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.image_pull_secret_credentials import ImagePullSecretCredentials from platform_api_python_client.models.list_api_key_response import ListAPIKeyResponse from platform_api_python_client.models.list_c_serve_recipe_response import ListCServeRecipeResponse from platform_api_python_client.models.list_daily_bill_response import ListDailyBillResponse @@ -89,6 +90,7 @@ from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse from platform_api_python_client.models.revision_pod_details import RevisionPodDetails from platform_api_python_client.models.rollout_status import RolloutStatus +from platform_api_python_client.models.rollout_strategy_params import RolloutStrategyParams from platform_api_python_client.models.service_status import ServiceStatus from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse from platform_api_python_client.models.update_deployment_status_v3_request import UpdateDeploymentStatusV3Request diff --git a/platform_api_python_client/api/external_api.py b/platform_api_python_client/api/external_api.py index f8c589f..39be120 100644 --- a/platform_api_python_client/api/external_api.py +++ b/platform_api_python_client/api/external_api.py @@ -60,6 +60,7 @@ from platform_api_python_client.models.list_prebuilt_image_response import ListPrebuiltImageResponse from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse from platform_api_python_client.models.metric import Metric +from platform_api_python_client.models.rollout_strategy_params import RolloutStrategyParams from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse from platform_api_python_client.models.update_deployment_status_v3_request import UpdateDeploymentStatusV3Request from platform_api_python_client.models.user_vault_item import UserVaultItem @@ -9189,6 +9190,7 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe self, deployment_id: StrictInt, revision_number: StrictInt, + rollout_strategy_params: Optional[RolloutStrategyParams] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9210,6 +9212,8 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe :type deployment_id: int :param revision_number: (required) :type revision_number: int + :param rollout_strategy_params: + :type rollout_strategy_params: RolloutStrategyParams :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 @@ -9235,6 +9239,7 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe _param = self._rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put_serialize( deployment_id=deployment_id, revision_number=revision_number, + rollout_strategy_params=rollout_strategy_params, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9261,6 +9266,7 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe self, deployment_id: StrictInt, revision_number: StrictInt, + rollout_strategy_params: Optional[RolloutStrategyParams] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9282,6 +9288,8 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe :type deployment_id: int :param revision_number: (required) :type revision_number: int + :param rollout_strategy_params: + :type rollout_strategy_params: RolloutStrategyParams :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 @@ -9307,6 +9315,7 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe _param = self._rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put_serialize( deployment_id=deployment_id, revision_number=revision_number, + rollout_strategy_params=rollout_strategy_params, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9333,6 +9342,7 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe self, deployment_id: StrictInt, revision_number: StrictInt, + rollout_strategy_params: Optional[RolloutStrategyParams] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9354,6 +9364,8 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe :type deployment_id: int :param revision_number: (required) :type revision_number: int + :param rollout_strategy_params: + :type rollout_strategy_params: RolloutStrategyParams :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 @@ -9379,6 +9391,7 @@ def rollout_existing_revision_deployments_revisions_deployment_id_revision_numbe _param = self._rollout_existing_revision_deployments_revisions_deployment_id_revision_number_put_serialize( deployment_id=deployment_id, revision_number=revision_number, + rollout_strategy_params=rollout_strategy_params, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9400,6 +9413,7 @@ def _rollout_existing_revision_deployments_revisions_deployment_id_revision_numb self, deployment_id, revision_number, + rollout_strategy_params, _request_auth, _content_type, _headers, @@ -9429,6 +9443,8 @@ def _rollout_existing_revision_deployments_revisions_deployment_id_revision_numb # process the header parameters # process the form parameters # process the body parameter + if rollout_strategy_params is not None: + _body_params = rollout_strategy_params # set the HTTP header `Accept` @@ -9439,6 +9455,19 @@ def _rollout_existing_revision_deployments_revisions_deployment_id_revision_numb ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ diff --git a/platform_api_python_client/api_client.py b/platform_api_python_client/api_client.py index f2d0daa..c862def 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.1.7/python' + self.user_agent = 'OpenAPI-Generator/4.1.8/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 74e05fd..a5da898 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.1.7".\ + "SDK Package Version: 4.1.8".\ 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 fe5ccf2..33fa5d6 100644 --- a/platform_api_python_client/models/__init__.py +++ b/platform_api_python_client/models/__init__.py @@ -57,6 +57,7 @@ from platform_api_python_client.models.get_rag_deployment_response import GetRagDeploymentResponse 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.image_pull_secret_credentials import ImagePullSecretCredentials from platform_api_python_client.models.list_api_key_response import ListAPIKeyResponse from platform_api_python_client.models.list_c_serve_recipe_response import ListCServeRecipeResponse from platform_api_python_client.models.list_daily_bill_response import ListDailyBillResponse @@ -72,6 +73,7 @@ from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse from platform_api_python_client.models.revision_pod_details import RevisionPodDetails from platform_api_python_client.models.rollout_status import RolloutStatus +from platform_api_python_client.models.rollout_strategy_params import RolloutStrategyParams from platform_api_python_client.models.service_status import ServiceStatus from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse from platform_api_python_client.models.update_deployment_status_v3_request import UpdateDeploymentStatusV3Request 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 d1cc185..d1a72a6 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 @@ -28,6 +28,8 @@ class CreateCServeV3DeploymentRequest(BaseModel): """ CreateCServeV3DeploymentRequest """ # noqa: E501 + max_surge: Optional[StrictInt] = None + max_unavailable: Optional[StrictInt] = None name: Annotated[str, Field(min_length=1, strict=True, max_length=20)] cluster_id: StrictInt hardware_instance_id: StrictInt @@ -41,7 +43,7 @@ class CreateCServeV3DeploymentRequest(BaseModel): initial_replicas: Optional[StrictInt] = None concurrency: Optional[StrictInt] = None env_vars: Optional[Dict[str, StrictStr]] = None - __properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "env_vars"] + __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "env_vars"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -92,6 +94,16 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of recipe if self.recipe: _dict['recipe'] = self.recipe.to_dict() + # set to None if max_surge (nullable) is None + # and model_fields_set contains the field + if self.max_surge is None and "max_surge" in self.model_fields_set: + _dict['max_surge'] = None + + # set to None if max_unavailable (nullable) is None + # and model_fields_set contains the field + if self.max_unavailable is None and "max_unavailable" in self.model_fields_set: + _dict['max_unavailable'] = None + # set to None if cserve_version (nullable) is None # and model_fields_set contains the field if self.cserve_version is None and "cserve_version" in self.model_fields_set: @@ -134,6 +146,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "max_surge": obj.get("max_surge"), + "max_unavailable": obj.get("max_unavailable"), "name": obj.get("name"), "cluster_id": obj.get("cluster_id"), "hardware_instance_id": obj.get("hardware_instance_id"), 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 9c0d4a6..2930ad8 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 @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator 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 typing import Optional, Set from typing_extensions import Self @@ -27,10 +28,13 @@ class CreateInferenceV3DeploymentRequest(BaseModel): """ CreateInferenceV3DeploymentRequest """ # noqa: E501 + max_surge: Optional[StrictInt] = None + max_unavailable: Optional[StrictInt] = None name: Annotated[str, Field(min_length=1, strict=True, max_length=20)] cluster_id: StrictInt hardware_instance_id: StrictInt image_url: StrictStr + image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None port: StrictInt min_replicas: StrictInt max_replicas: StrictInt @@ -41,7 +45,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel): command: Optional[StrictStr] = None endpoint_bearer_token: Optional[StrictStr] = None endpoint_certificate_authority: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "image_url", "port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority"] + __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -89,6 +93,24 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # 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() + # set to None if max_surge (nullable) is None + # and model_fields_set contains the field + if self.max_surge is None and "max_surge" in self.model_fields_set: + _dict['max_surge'] = None + + # set to None if max_unavailable (nullable) is None + # and model_fields_set contains the field + if self.max_unavailable is None and "max_unavailable" in self.model_fields_set: + _dict['max_unavailable'] = None + + # set to None if image_pull_secret_credentials (nullable) is None + # and model_fields_set contains the field + 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: @@ -136,10 +158,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "max_surge": obj.get("max_surge"), + "max_unavailable": obj.get("max_unavailable"), "name": obj.get("name"), "cluster_id": obj.get("cluster_id"), "hardware_instance_id": obj.get("hardware_instance_id"), "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, "port": obj.get("port"), "min_replicas": obj.get("min_replicas"), "max_replicas": obj.get("max_replicas"), 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 9705e7c..5f6e5b3 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 @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional 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 typing import Optional, Set from typing_extensions import Self @@ -51,7 +52,8 @@ class GetInferenceV3DeploymentResponse(BaseModel): env_vars: Optional[Dict[str, StrictStr]] = None command: Optional[List[StrictStr]] = None command_args: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "container_port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "healthcheck", "endpoint_certificate_authority", "endpoint_bearer_token", "env_vars", "command", "command_args"] + image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None + __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "container_port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "healthcheck", "endpoint_certificate_authority", "endpoint_bearer_token", "env_vars", "command", "command_args", "image_pull_secret_credentials"] model_config = ConfigDict( populate_by_name=True, @@ -92,6 +94,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # 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() # set to None if image_url (nullable) is None # and model_fields_set contains the field if self.image_url is None and "image_url" in self.model_fields_set: @@ -137,6 +142,11 @@ def to_dict(self) -> Dict[str, Any]: if self.command_args is None and "command_args" in self.model_fields_set: _dict['command_args'] = None + # set to None if image_pull_secret_credentials (nullable) is None + # and model_fields_set contains the field + if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set: + _dict['image_pull_secret_credentials'] = None + return _dict @classmethod @@ -170,7 +180,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "endpoint_bearer_token": obj.get("endpoint_bearer_token"), "env_vars": obj.get("env_vars"), "command": obj.get("command"), - "command_args": obj.get("command_args") + "command_args": obj.get("command_args"), + "image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None }) return _obj diff --git a/platform_api_python_client/models/image_pull_secret_credentials.py b/platform_api_python_client/models/image_pull_secret_credentials.py new file mode 100644 index 0000000..df2d96d --- /dev/null +++ b/platform_api_python_client/models/image_pull_secret_credentials.py @@ -0,0 +1,89 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ImagePullSecretCredentials(BaseModel): + """ + ImagePullSecretCredentials + """ # noqa: E501 + username: StrictStr + password: StrictStr + __properties: ClassVar[List[str]] = ["username", "password"] + + 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 ImagePullSecretCredentials 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 ImagePullSecretCredentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) + return _obj + + diff --git a/platform_api_python_client/models/rollout_status.py b/platform_api_python_client/models/rollout_status.py index e966244..a2b2c2d 100644 --- a/platform_api_python_client/models/rollout_status.py +++ b/platform_api_python_client/models/rollout_status.py @@ -30,7 +30,7 @@ class RolloutStatus(str, Enum): PAUSED = 'Paused' HEALTHY = 'Healthy' DEGRADED = 'Degraded' - UNKNOWN = 'Unknown' + MISSING = 'Missing' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/platform_api_python_client/models/rollout_strategy_params.py b/platform_api_python_client/models/rollout_strategy_params.py new file mode 100644 index 0000000..8880e23 --- /dev/null +++ b/platform_api_python_client/models/rollout_strategy_params.py @@ -0,0 +1,99 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RolloutStrategyParams(BaseModel): + """ + RolloutStrategyParams + """ # noqa: E501 + max_surge: Optional[StrictInt] = None + max_unavailable: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable"] + + 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 RolloutStrategyParams 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 max_surge (nullable) is None + # and model_fields_set contains the field + if self.max_surge is None and "max_surge" in self.model_fields_set: + _dict['max_surge'] = None + + # set to None if max_unavailable (nullable) is None + # and model_fields_set contains the field + if self.max_unavailable is None and "max_unavailable" in self.model_fields_set: + _dict['max_unavailable'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RolloutStrategyParams from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "max_surge": obj.get("max_surge"), + "max_unavailable": obj.get("max_unavailable") + }) + return _obj + + diff --git a/pyproject.toml b/pyproject.toml index 28cd2f3..eb2aa7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "platform_api_python_client" -version = "4.1.7" +version = "4.1.8" description = "Platform External API" authors = ["OpenAPI Generator Community "] license = "NoLicense" diff --git a/setup.py b/setup.py index f104f3a..908fad6 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.1.7" +VERSION = "4.1.8" 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 a14a9c0..acbab30 100644 --- a/test/test_create_c_serve_v3_deployment_request.py +++ b/test/test_create_c_serve_v3_deployment_request.py @@ -35,6 +35,8 @@ def make_instance(self, include_optional) -> CreateCServeV3DeploymentRequest: model = CreateCServeV3DeploymentRequest() if include_optional: return CreateCServeV3DeploymentRequest( + max_surge = 56, + max_unavailable = 56, name = 'ar1c2v7s6djuy1zmetozkhdomha1b0', cluster_id = 56, hardware_instance_id = 56, diff --git a/test/test_create_inference_v3_deployment_request.py b/test/test_create_inference_v3_deployment_request.py index a0b0c05..d41aff1 100644 --- a/test/test_create_inference_v3_deployment_request.py +++ b/test/test_create_inference_v3_deployment_request.py @@ -35,10 +35,15 @@ def make_instance(self, include_optional) -> CreateInferenceV3DeploymentRequest: model = CreateInferenceV3DeploymentRequest() if include_optional: return CreateInferenceV3DeploymentRequest( + max_surge = 56, + max_unavailable = 56, name = 'ar1c2v7s6djuy1zmetozkhdomha1b0', cluster_id = 56, hardware_instance_id = 56, image_url = '', + image_pull_secret_credentials = platform_api_python_client.models.image_pull_secret_credentials.ImagePullSecretCredentials( + username = '', + password = '', ), port = 56, min_replicas = 56, max_replicas = 56, diff --git a/test/test_deployment_response.py b/test/test_deployment_response.py index a60e50c..a1b2f9a 100644 --- a/test/test_deployment_response.py +++ b/test/test_deployment_response.py @@ -64,7 +64,10 @@ def make_instance(self, include_optional) -> DeploymentResponse: ], command_args = [ '' - ] + ], + image_pull_secret_credentials = platform_api_python_client.models.image_pull_secret_credentials.ImagePullSecretCredentials( + username = '', + password = '', ) ) else: return DeploymentResponse( diff --git a/test/test_get_inference_v3_deployment_response.py b/test/test_get_inference_v3_deployment_response.py index 6bcffb9..f801df5 100644 --- a/test/test_get_inference_v3_deployment_response.py +++ b/test/test_get_inference_v3_deployment_response.py @@ -62,7 +62,10 @@ def make_instance(self, include_optional) -> GetInferenceV3DeploymentResponse: ], command_args = [ '' - ] + ], + image_pull_secret_credentials = platform_api_python_client.models.image_pull_secret_credentials.ImagePullSecretCredentials( + username = '', + password = '', ) ) else: return GetInferenceV3DeploymentResponse( diff --git a/test/test_image_pull_secret_credentials.py b/test/test_image_pull_secret_credentials.py new file mode 100644 index 0000000..dc423e4 --- /dev/null +++ b/test/test_image_pull_secret_credentials.py @@ -0,0 +1,54 @@ +# 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.image_pull_secret_credentials import ImagePullSecretCredentials + +class TestImagePullSecretCredentials(unittest.TestCase): + """ImagePullSecretCredentials unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePullSecretCredentials: + """Test ImagePullSecretCredentials + 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 `ImagePullSecretCredentials` + """ + model = ImagePullSecretCredentials() + if include_optional: + return ImagePullSecretCredentials( + username = '', + password = '' + ) + else: + return ImagePullSecretCredentials( + username = '', + password = '', + ) + """ + + def testImagePullSecretCredentials(self): + """Test ImagePullSecretCredentials""" + # 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_rollout_strategy_params.py b/test/test_rollout_strategy_params.py new file mode 100644 index 0000000..995b241 --- /dev/null +++ b/test/test_rollout_strategy_params.py @@ -0,0 +1,52 @@ +# 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.rollout_strategy_params import RolloutStrategyParams + +class TestRolloutStrategyParams(unittest.TestCase): + """RolloutStrategyParams unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RolloutStrategyParams: + """Test RolloutStrategyParams + 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 `RolloutStrategyParams` + """ + model = RolloutStrategyParams() + if include_optional: + return RolloutStrategyParams( + max_surge = 56, + max_unavailable = 56 + ) + else: + return RolloutStrategyParams( + ) + """ + + def testRolloutStrategyParams(self): + """Test RolloutStrategyParams""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()