diff --git a/README.md b/README.md index 1205243..714d037 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.9.6 +- Package version: 4.9.7 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen @@ -100,6 +100,7 @@ Class | Method | HTTP request | Description *EXTERNALApi* | [**create_cserve_v3_deployment_deployments_cserve_v3_post**](docs/EXTERNALApi.md#create_cserve_v3_deployment_deployments_cserve_v3_post) | **POST** /deployments/cserve_v3 | Create Cserve V3 Deployment *EXTERNALApi* | [**create_inference_deployment_deployments_inference_post**](docs/EXTERNALApi.md#create_inference_deployment_deployments_inference_post) | **POST** /deployments/inference | Create Inference Deployment *EXTERNALApi* | [**create_inference_v3_deployment_deployments_inference_v3_post**](docs/EXTERNALApi.md#create_inference_v3_deployment_deployments_inference_v3_post) | **POST** /deployments/inference_v3 | Create Inference V3 Deployment +*EXTERNALApi* | [**create_job_deployment_deployments_job_post**](docs/EXTERNALApi.md#create_job_deployment_deployments_job_post) | **POST** /deployments/job | Create Job Deployment *EXTERNALApi* | [**create_new_organization_organizations_post**](docs/EXTERNALApi.md#create_new_organization_organizations_post) | **POST** /organizations | Create New Organization *EXTERNALApi* | [**delete_api_key_credentials_api_key_id_delete**](docs/EXTERNALApi.md#delete_api_key_credentials_api_key_id_delete) | **DELETE** /credentials/api-key/{id} | Delete Api Key *EXTERNALApi* | [**delete_user_vault_item_endpoint_user_vault_delete**](docs/EXTERNALApi.md#delete_user_vault_item_endpoint_user_vault_delete) | **DELETE** /user_vault | Delete User Vault Item Endpoint @@ -122,6 +123,7 @@ Class | Method | HTTP request | Description *EXTERNALApi* | [**get_hardware_instances_hardware_instances_get**](docs/EXTERNALApi.md#get_hardware_instances_hardware_instances_get) | **GET** /hardware-instances | Get Hardware Instances *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 *EXTERNALApi* | [**get_prebuilt_images_prebuilt_images_get**](docs/EXTERNALApi.md#get_prebuilt_images_prebuilt_images_get) | **GET** /prebuilt-images | Get Prebuilt Images *EXTERNALApi* | [**get_usage_daily_bills_get**](docs/EXTERNALApi.md#get_usage_daily_bills_get) | **GET** /daily_bills | Get Usage *EXTERNALApi* | [**get_usage_deployments_usage_deployment_id_get**](docs/EXTERNALApi.md#get_usage_deployments_usage_deployment_id_get) | **GET** /deployments/usage/{deployment_id} | Get Usage @@ -149,6 +151,7 @@ Class | Method | HTTP request | Description - [CServeRecipeResponse](docs/CServeRecipeResponse.md) - [CServeV2Recipe](docs/CServeV2Recipe.md) - [ClusterCapacityResponse](docs/ClusterCapacityResponse.md) + - [ConfigFileMount](docs/ConfigFileMount.md) - [CreateCServeV2DeploymentRequest](docs/CreateCServeV2DeploymentRequest.md) - [CreateCServeV2DeploymentResponse](docs/CreateCServeV2DeploymentResponse.md) - [CreateCServeV3DeploymentRequest](docs/CreateCServeV3DeploymentRequest.md) @@ -158,6 +161,8 @@ Class | Method | HTTP request | Description - [CreateInferenceDeploymentRequest](docs/CreateInferenceDeploymentRequest.md) - [CreateInferenceDeploymentResponse](docs/CreateInferenceDeploymentResponse.md) - [CreateInferenceV3DeploymentRequest](docs/CreateInferenceV3DeploymentRequest.md) + - [CreateJobDeploymentRequest](docs/CreateJobDeploymentRequest.md) + - [CreateJobDeploymentResponse](docs/CreateJobDeploymentResponse.md) - [CreateOrganizationRequest](docs/CreateOrganizationRequest.md) - [CreateOrganizationResponse](docs/CreateOrganizationResponse.md) - [CreateUrlRequest](docs/CreateUrlRequest.md) @@ -182,6 +187,7 @@ Class | Method | HTTP request | Description - [GetDeploymentUsageResponse](docs/GetDeploymentUsageResponse.md) - [GetInferenceDeploymentResponse](docs/GetInferenceDeploymentResponse.md) - [GetInferenceV3DeploymentResponse](docs/GetInferenceV3DeploymentResponse.md) + - [GetJobDeploymentResponse](docs/GetJobDeploymentResponse.md) - [GpuTypeCapacity](docs/GpuTypeCapacity.md) - [HTTPValidationError](docs/HTTPValidationError.md) - [HardwareInstanceResponse](docs/HardwareInstanceResponse.md) diff --git a/docs/ConfigFileMount.md b/docs/ConfigFileMount.md new file mode 100644 index 0000000..7610fa7 --- /dev/null +++ b/docs/ConfigFileMount.md @@ -0,0 +1,31 @@ +# ConfigFileMount + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | **str** | | +**mount_path** | **str** | | +**content** | **str** | | + +## Example + +```python +from platform_api_python_client.models.config_file_mount import ConfigFileMount + +# TODO update the JSON string below +json = "{}" +# create an instance of ConfigFileMount from a JSON string +config_file_mount_instance = ConfigFileMount.from_json(json) +# print the JSON string representation of the object +print(ConfigFileMount.to_json()) + +# convert the object into a dict +config_file_mount_dict = config_file_mount_instance.to_dict() +# create an instance of ConfigFileMount from a dict +config_file_mount_from_dict = ConfigFileMount.from_dict(config_file_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/docs/CreateInferenceV3DeploymentRequest.md b/docs/CreateInferenceV3DeploymentRequest.md index 503ee2a..7ce4404 100644 --- a/docs/CreateInferenceV3DeploymentRequest.md +++ b/docs/CreateInferenceV3DeploymentRequest.md @@ -28,6 +28,7 @@ Name | Type | Description | Notes **backend_protocol** | [**BackendProtocol**](BackendProtocol.md) | | [optional] **enable_logging** | **bool** | | [optional] [default to False] **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] +**config_file** | [**ConfigFileMount**](ConfigFileMount.md) | | [optional] ## Example diff --git a/docs/CreateJobDeploymentRequest.md b/docs/CreateJobDeploymentRequest.md new file mode 100644 index 0000000..2d2afe0 --- /dev/null +++ b/docs/CreateJobDeploymentRequest.md @@ -0,0 +1,39 @@ +# CreateJobDeploymentRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**cluster_id** | **int** | | +**hardware_instance_id** | **int** | | +**user_annotations** | **Dict[str, str]** | | [optional] +**image_url** | **str** | | +**image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] +**env_vars** | **Dict[str, str]** | | [optional] +**command** | **str** | | [optional] +**completions** | **int** | | [optional] [default to 1] +**parallelism** | **int** | | [optional] [default to 1] +**enable_logging** | **bool** | | [optional] [default to True] + +## Example + +```python +from platform_api_python_client.models.create_job_deployment_request import CreateJobDeploymentRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateJobDeploymentRequest from a JSON string +create_job_deployment_request_instance = CreateJobDeploymentRequest.from_json(json) +# print the JSON string representation of the object +print(CreateJobDeploymentRequest.to_json()) + +# convert the object into a dict +create_job_deployment_request_dict = create_job_deployment_request_instance.to_dict() +# create an instance of CreateJobDeploymentRequest from a dict +create_job_deployment_request_from_dict = CreateJobDeploymentRequest.from_dict(create_job_deployment_request_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/CreateJobDeploymentResponse.md b/docs/CreateJobDeploymentResponse.md new file mode 100644 index 0000000..0d1cbd2 --- /dev/null +++ b/docs/CreateJobDeploymentResponse.md @@ -0,0 +1,31 @@ +# CreateJobDeploymentResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**created_at** | **datetime** | | +**endpoint_url** | **str** | | + +## Example + +```python +from platform_api_python_client.models.create_job_deployment_response import CreateJobDeploymentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateJobDeploymentResponse from a JSON string +create_job_deployment_response_instance = CreateJobDeploymentResponse.from_json(json) +# print the JSON string representation of the object +print(CreateJobDeploymentResponse.to_json()) + +# convert the object into a dict +create_job_deployment_response_dict = create_job_deployment_response_instance.to_dict() +# create an instance of CreateJobDeploymentResponse from a dict +create_job_deployment_response_from_dict = CreateJobDeploymentResponse.from_dict(create_job_deployment_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/DeploymentResponse.md b/docs/DeploymentResponse.md index 8b8ee05..3a4bf11 100644 --- a/docs/DeploymentResponse.md +++ b/docs/DeploymentResponse.md @@ -37,6 +37,7 @@ Name | Type | Description | Notes **original_command** | **str** | | [optional] **image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] **backend_protocol** | [**BackendProtocol**](BackendProtocol.md) | | [optional] +**config_file** | [**ConfigFileMount**](ConfigFileMount.md) | | [optional] ## Example diff --git a/docs/DeploymentType.md b/docs/DeploymentType.md index fbbf195..7f29ad7 100644 --- a/docs/DeploymentType.md +++ b/docs/DeploymentType.md @@ -27,6 +27,8 @@ * `RAG` (value: `'rag'`) +* `JOB` (value: `'job'`) + [[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/EXTERNALApi.md b/docs/EXTERNALApi.md index d2bba61..9ed4f8f 100644 --- a/docs/EXTERNALApi.md +++ b/docs/EXTERNALApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**create_cserve_v3_deployment_deployments_cserve_v3_post**](EXTERNALApi.md#create_cserve_v3_deployment_deployments_cserve_v3_post) | **POST** /deployments/cserve_v3 | Create Cserve V3 Deployment [**create_inference_deployment_deployments_inference_post**](EXTERNALApi.md#create_inference_deployment_deployments_inference_post) | **POST** /deployments/inference | Create Inference Deployment [**create_inference_v3_deployment_deployments_inference_v3_post**](EXTERNALApi.md#create_inference_v3_deployment_deployments_inference_v3_post) | **POST** /deployments/inference_v3 | Create Inference V3 Deployment +[**create_job_deployment_deployments_job_post**](EXTERNALApi.md#create_job_deployment_deployments_job_post) | **POST** /deployments/job | Create Job Deployment [**create_new_organization_organizations_post**](EXTERNALApi.md#create_new_organization_organizations_post) | **POST** /organizations | Create New Organization [**delete_api_key_credentials_api_key_id_delete**](EXTERNALApi.md#delete_api_key_credentials_api_key_id_delete) | **DELETE** /credentials/api-key/{id} | Delete Api Key [**delete_user_vault_item_endpoint_user_vault_delete**](EXTERNALApi.md#delete_user_vault_item_endpoint_user_vault_delete) | **DELETE** /user_vault | Delete User Vault Item Endpoint @@ -32,6 +33,7 @@ Method | HTTP request | Description [**get_hardware_instances_hardware_instances_get**](EXTERNALApi.md#get_hardware_instances_hardware_instances_get) | **GET** /hardware-instances | Get Hardware Instances [**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 [**get_prebuilt_images_prebuilt_images_get**](EXTERNALApi.md#get_prebuilt_images_prebuilt_images_get) | **GET** /prebuilt-images | Get Prebuilt Images [**get_usage_daily_bills_get**](EXTERNALApi.md#get_usage_daily_bills_get) | **GET** /daily_bills | Get Usage [**get_usage_deployments_usage_deployment_id_get**](EXTERNALApi.md#get_usage_deployments_usage_deployment_id_get) | **GET** /deployments/usage/{deployment_id} | Get Usage @@ -518,6 +520,84 @@ 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) +# **create_job_deployment_deployments_job_post** +> CreateJobDeploymentResponse create_job_deployment_deployments_job_post(create_job_deployment_request) + +Create Job Deployment + +### Example + +* Bearer Authentication (HTTPBearer): + +```python +import platform_api_python_client +from platform_api_python_client.models.create_job_deployment_request import CreateJobDeploymentRequest +from platform_api_python_client.models.create_job_deployment_response import CreateJobDeploymentResponse +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) + create_job_deployment_request = platform_api_python_client.CreateJobDeploymentRequest() # CreateJobDeploymentRequest | + + try: + # Create Job Deployment + api_response = api_instance.create_job_deployment_deployments_job_post(create_job_deployment_request) + print("The response of EXTERNALApi->create_job_deployment_deployments_job_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EXTERNALApi->create_job_deployment_deployments_job_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_job_deployment_request** | [**CreateJobDeploymentRequest**](CreateJobDeploymentRequest.md)| | + +### Return type + +[**CreateJobDeploymentResponse**](CreateJobDeploymentResponse.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[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) + # **create_new_organization_organizations_post** > CreateOrganizationResponse create_new_organization_organizations_post(create_organization_request) @@ -2242,6 +2322,83 @@ 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_job_deployment_deployments_job_deployment_id_get** +> GetJobDeploymentResponse get_job_deployment_deployments_job_deployment_id_get(deployment_id) + +Get Job Deployment + +### Example + +* Bearer Authentication (HTTPBearer): + +```python +import platform_api_python_client +from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse +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) + deployment_id = 56 # int | + + try: + # Get Job Deployment + api_response = api_instance.get_job_deployment_deployments_job_deployment_id_get(deployment_id) + print("The response of EXTERNALApi->get_job_deployment_deployments_job_deployment_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EXTERNALApi->get_job_deployment_deployments_job_deployment_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deployment_id** | **int**| | + +### Return type + +[**GetJobDeploymentResponse**](GetJobDeploymentResponse.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 | - | +**422** | Validation Error | - | + +[[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_prebuilt_images_prebuilt_images_get** > ListPrebuiltImageResponse get_prebuilt_images_prebuilt_images_get(type=type) diff --git a/docs/GetInferenceV3DeploymentResponse.md b/docs/GetInferenceV3DeploymentResponse.md index 772664c..09b12fc 100644 --- a/docs/GetInferenceV3DeploymentResponse.md +++ b/docs/GetInferenceV3DeploymentResponse.md @@ -34,6 +34,7 @@ Name | Type | Description | Notes **backend_protocol** | [**BackendProtocol**](BackendProtocol.md) | | [optional] **enable_logging** | **bool** | | [optional] [default to True] **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] +**config_file** | [**ConfigFileMount**](ConfigFileMount.md) | | [optional] ## Example diff --git a/docs/GetJobDeploymentResponse.md b/docs/GetJobDeploymentResponse.md new file mode 100644 index 0000000..bd0cf42 --- /dev/null +++ b/docs/GetJobDeploymentResponse.md @@ -0,0 +1,47 @@ +# GetJobDeploymentResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**creator_email** | **str** | | +**cluster_id** | **int** | | +**id** | **int** | | +**name** | **str** | | +**endpoint_url** | **str** | | +**image_url** | **str** | | [optional] +**type** | [**DeploymentType**](DeploymentType.md) | | +**status** | [**DeploymentStatus**](DeploymentStatus.md) | | +**created_at** | **datetime** | | +**hardware_instance_id** | **int** | | +**revision_number** | **int** | | +**user_annotations** | **Dict[str, str]** | | [optional] +**env_vars** | **Dict[str, str]** | | [optional] +**command** | **List[str]** | | [optional] +**args** | **List[str]** | | [optional] +**completions** | **int** | | [optional] [default to 1] +**parallelism** | **int** | | [optional] [default to 1] +**image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] +**enable_logging** | **bool** | | [optional] [default to True] + +## Example + +```python +from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GetJobDeploymentResponse from a JSON string +get_job_deployment_response_instance = GetJobDeploymentResponse.from_json(json) +# print the JSON string representation of the object +print(GetJobDeploymentResponse.to_json()) + +# convert the object into a dict +get_job_deployment_response_dict = get_job_deployment_response_instance.to_dict() +# create an instance of GetJobDeploymentResponse from a dict +get_job_deployment_response_from_dict = GetJobDeploymentResponse.from_dict(get_job_deployment_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/PodStatus.md b/docs/PodStatus.md index c9baf19..85bcb99 100644 --- a/docs/PodStatus.md +++ b/docs/PodStatus.md @@ -23,6 +23,10 @@ * `NOTREADY` (value: `'NotReady'`) +* `COMPLETED` (value: `'Completed'`) + +* `FAILED` (value: `'Failed'`) + [[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/ServiceStatus.md b/docs/ServiceStatus.md index 58dea3f..d00600a 100644 --- a/docs/ServiceStatus.md +++ b/docs/ServiceStatus.md @@ -13,6 +13,8 @@ * `INITIALIZING` (value: `'Initializing'`) +* `CLEANEDUP` (value: `'CleanedUp'`) + * `ERROR` (value: `'Error'`) * `CREATECONTAINERCONFIGERROR` (value: `'CreateContainerConfigError'`) @@ -25,6 +27,10 @@ * `NOTREADY` (value: `'NotReady'`) +* `COMPLETED` (value: `'Completed'`) + +* `FAILED` (value: `'Failed'`) + * `SCALEDTOZERO` (value: `'ScaledToZero'`) * `UNKNOWN` (value: `'Unknown'`) diff --git a/platform_api_python_client/__init__.py b/platform_api_python_client/__init__.py index d14904c..35a4ddd 100644 --- a/platform_api_python_client/__init__.py +++ b/platform_api_python_client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "4.9.6" +__version__ = "4.9.7" # import apis into sdk package from platform_api_python_client.api.external_api import EXTERNALApi @@ -38,6 +38,7 @@ from platform_api_python_client.models.c_serve_recipe_response import CServeRecipeResponse from platform_api_python_client.models.c_serve_v2_recipe import CServeV2Recipe from platform_api_python_client.models.cluster_capacity_response import ClusterCapacityResponse +from platform_api_python_client.models.config_file_mount import ConfigFileMount from platform_api_python_client.models.create_c_serve_v2_deployment_request import CreateCServeV2DeploymentRequest from platform_api_python_client.models.create_c_serve_v2_deployment_response import CreateCServeV2DeploymentResponse from platform_api_python_client.models.create_c_serve_v3_deployment_request import CreateCServeV3DeploymentRequest @@ -47,6 +48,8 @@ from platform_api_python_client.models.create_inference_deployment_request import CreateInferenceDeploymentRequest from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse from platform_api_python_client.models.create_inference_v3_deployment_request import CreateInferenceV3DeploymentRequest +from platform_api_python_client.models.create_job_deployment_request import CreateJobDeploymentRequest +from platform_api_python_client.models.create_job_deployment_response import CreateJobDeploymentResponse from platform_api_python_client.models.create_organization_request import CreateOrganizationRequest from platform_api_python_client.models.create_organization_response import CreateOrganizationResponse from platform_api_python_client.models.create_url_request import CreateUrlRequest @@ -71,6 +74,7 @@ from platform_api_python_client.models.get_deployment_usage_response import GetDeploymentUsageResponse from platform_api_python_client.models.get_inference_deployment_response import GetInferenceDeploymentResponse from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse +from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse 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 diff --git a/platform_api_python_client/api/external_api.py b/platform_api_python_client/api/external_api.py index 8f25fbe..86ac3a0 100644 --- a/platform_api_python_client/api/external_api.py +++ b/platform_api_python_client/api/external_api.py @@ -30,6 +30,8 @@ from platform_api_python_client.models.create_inference_deployment_request import CreateInferenceDeploymentRequest from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse from platform_api_python_client.models.create_inference_v3_deployment_request import CreateInferenceV3DeploymentRequest +from platform_api_python_client.models.create_job_deployment_request import CreateJobDeploymentRequest +from platform_api_python_client.models.create_job_deployment_response import CreateJobDeploymentResponse from platform_api_python_client.models.create_organization_request import CreateOrganizationRequest from platform_api_python_client.models.create_organization_response import CreateOrganizationResponse from platform_api_python_client.models.create_url_request import CreateUrlRequest @@ -47,6 +49,7 @@ from platform_api_python_client.models.get_deployment_usage_response import GetDeploymentUsageResponse from platform_api_python_client.models.get_inference_deployment_response import GetInferenceDeploymentResponse from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse +from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse from platform_api_python_client.models.invite_user_request import InviteUserRequest 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 @@ -1727,6 +1730,280 @@ def _create_inference_v3_deployment_deployments_inference_v3_post_serialize( + @validate_call + def create_job_deployment_deployments_job_post( + self, + create_job_deployment_request: CreateJobDeploymentRequest, + _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, + ) -> CreateJobDeploymentResponse: + """Create Job Deployment + + + :param create_job_deployment_request: (required) + :type create_job_deployment_request: CreateJobDeploymentRequest + :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._create_job_deployment_deployments_job_post_serialize( + create_job_deployment_request=create_job_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateJobDeploymentResponse", + '422': "HTTPValidationError", + } + 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 create_job_deployment_deployments_job_post_with_http_info( + self, + create_job_deployment_request: CreateJobDeploymentRequest, + _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[CreateJobDeploymentResponse]: + """Create Job Deployment + + + :param create_job_deployment_request: (required) + :type create_job_deployment_request: CreateJobDeploymentRequest + :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._create_job_deployment_deployments_job_post_serialize( + create_job_deployment_request=create_job_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateJobDeploymentResponse", + '422': "HTTPValidationError", + } + 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 create_job_deployment_deployments_job_post_without_preload_content( + self, + create_job_deployment_request: CreateJobDeploymentRequest, + _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: + """Create Job Deployment + + + :param create_job_deployment_request: (required) + :type create_job_deployment_request: CreateJobDeploymentRequest + :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._create_job_deployment_deployments_job_post_serialize( + create_job_deployment_request=create_job_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateJobDeploymentResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_job_deployment_deployments_job_post_serialize( + self, + create_job_deployment_request, + _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 + if create_job_deployment_request is not None: + _body_params = create_job_deployment_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # 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] = [ + 'HTTPBearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/deployments/job', + 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 create_new_organization_organizations_post( self, @@ -7759,6 +8036,267 @@ def _get_inference_v3_deployment_deployments_inference_v3_deployment_id_get_seri + @validate_call + def get_job_deployment_deployments_job_deployment_id_get( + self, + deployment_id: StrictInt, + _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, + ) -> GetJobDeploymentResponse: + """Get Job Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :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_job_deployment_deployments_job_deployment_id_get_serialize( + deployment_id=deployment_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetJobDeploymentResponse", + '422': "HTTPValidationError", + } + 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_job_deployment_deployments_job_deployment_id_get_with_http_info( + self, + deployment_id: StrictInt, + _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[GetJobDeploymentResponse]: + """Get Job Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :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_job_deployment_deployments_job_deployment_id_get_serialize( + deployment_id=deployment_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetJobDeploymentResponse", + '422': "HTTPValidationError", + } + 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_job_deployment_deployments_job_deployment_id_get_without_preload_content( + self, + deployment_id: StrictInt, + _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 Job Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :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_job_deployment_deployments_job_deployment_id_get_serialize( + deployment_id=deployment_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetJobDeploymentResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_job_deployment_deployments_job_deployment_id_get_serialize( + self, + deployment_id, + _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 + if deployment_id is not None: + _path_params['deployment_id'] = deployment_id + # 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='/deployments/job/{deployment_id}', + 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_prebuilt_images_prebuilt_images_get( self, diff --git a/platform_api_python_client/api_client.py b/platform_api_python_client/api_client.py index 1d8da9c..e40307f 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.9.6/python' + self.user_agent = 'OpenAPI-Generator/4.9.7/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 916cdb6..19eccfe 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.9.6".\ + "SDK Package Version: 4.9.7".\ 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 86b9050..307ea46 100644 --- a/platform_api_python_client/models/__init__.py +++ b/platform_api_python_client/models/__init__.py @@ -21,6 +21,7 @@ from platform_api_python_client.models.c_serve_recipe_response import CServeRecipeResponse from platform_api_python_client.models.c_serve_v2_recipe import CServeV2Recipe from platform_api_python_client.models.cluster_capacity_response import ClusterCapacityResponse +from platform_api_python_client.models.config_file_mount import ConfigFileMount from platform_api_python_client.models.create_c_serve_v2_deployment_request import CreateCServeV2DeploymentRequest from platform_api_python_client.models.create_c_serve_v2_deployment_response import CreateCServeV2DeploymentResponse from platform_api_python_client.models.create_c_serve_v3_deployment_request import CreateCServeV3DeploymentRequest @@ -30,6 +31,8 @@ from platform_api_python_client.models.create_inference_deployment_request import CreateInferenceDeploymentRequest from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse from platform_api_python_client.models.create_inference_v3_deployment_request import CreateInferenceV3DeploymentRequest +from platform_api_python_client.models.create_job_deployment_request import CreateJobDeploymentRequest +from platform_api_python_client.models.create_job_deployment_response import CreateJobDeploymentResponse from platform_api_python_client.models.create_organization_request import CreateOrganizationRequest from platform_api_python_client.models.create_organization_response import CreateOrganizationResponse from platform_api_python_client.models.create_url_request import CreateUrlRequest @@ -54,6 +57,7 @@ from platform_api_python_client.models.get_deployment_usage_response import GetDeploymentUsageResponse from platform_api_python_client.models.get_inference_deployment_response import GetInferenceDeploymentResponse from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse +from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse 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 diff --git a/platform_api_python_client/models/config_file_mount.py b/platform_api_python_client/models/config_file_mount.py new file mode 100644 index 0000000..90b8c03 --- /dev/null +++ b/platform_api_python_client/models/config_file_mount.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, Field, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ConfigFileMount(BaseModel): + """ + ConfigFileMount + """ # noqa: E501 + filename: Annotated[str, Field(min_length=1, strict=True, max_length=253)] + mount_path: Annotated[str, Field(min_length=1, strict=True)] + content: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["filename", "mount_path", "content"] + + @field_validator('filename') + def filename_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-Z0-9._-]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9._-]+$/") + return value + + 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 ConfigFileMount 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 ConfigFileMount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filename": obj.get("filename"), + "mount_path": obj.get("mount_path"), + "content": obj.get("content") + }) + 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 604b84f..30b3135 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 @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from platform_api_python_client.models.backend_protocol import BackendProtocol +from platform_api_python_client.models.config_file_mount import ConfigFileMount from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials from typing import Optional, Set from typing_extensions import Self @@ -52,7 +53,8 @@ class CreateInferenceV3DeploymentRequest(BaseModel): backend_protocol: Optional[BackendProtocol] = None enable_logging: 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", "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", "session_affinity"] + config_file: Optional[ConfigFileMount] = None + __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "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", "session_affinity", "config_file"] @field_validator('name') def name_validate_regular_expression(cls, value): @@ -103,6 +105,9 @@ 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 config_file + if self.config_file: + _dict['config_file'] = self.config_file.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: @@ -168,6 +173,11 @@ def to_dict(self) -> Dict[str, Any]: if self.hf_token is None and "hf_token" in self.model_fields_set: _dict['hf_token'] = None + # set to None if config_file (nullable) is None + # and model_fields_set contains the field + if self.config_file is None and "config_file" in self.model_fields_set: + _dict['config_file'] = None + return _dict @classmethod @@ -202,7 +212,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hf_token": obj.get("hf_token"), "backend_protocol": obj.get("backend_protocol"), "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False, - "session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False + "session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False, + "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None }) return _obj diff --git a/platform_api_python_client/models/create_job_deployment_request.py b/platform_api_python_client/models/create_job_deployment_request.py new file mode 100644 index 0000000..db099a2 --- /dev/null +++ b/platform_api_python_client/models/create_job_deployment_request.py @@ -0,0 +1,139 @@ +# 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, 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 + +class CreateJobDeploymentRequest(BaseModel): + """ + CreateJobDeploymentRequest + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=20)] + cluster_id: StrictInt + hardware_instance_id: StrictInt + user_annotations: Optional[Dict[str, StrictStr]] = None + image_url: StrictStr + image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None + env_vars: Optional[Dict[str, StrictStr]] = None + command: Optional[StrictStr] = None + completions: Optional[StrictInt] = 1 + parallelism: Optional[StrictInt] = 1 + enable_logging: Optional[StrictBool] = True + __properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "image_url", "image_pull_secret_credentials", "env_vars", "command", "completions", "parallelism", "enable_logging"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-z][a-z0-9-]*$", value): + raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") + return value + + 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 CreateJobDeploymentRequest 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 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 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: + _dict['user_annotations'] = 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 env_vars (nullable) is None + # and model_fields_set contains the field + if self.env_vars is None and "env_vars" in self.model_fields_set: + _dict['env_vars'] = None + + # set to None if command (nullable) is None + # and model_fields_set contains the field + if self.command is None and "command" in self.model_fields_set: + _dict['command'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateJobDeploymentRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "cluster_id": obj.get("cluster_id"), + "hardware_instance_id": obj.get("hardware_instance_id"), + "user_annotations": obj.get("user_annotations"), + "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, + "env_vars": obj.get("env_vars"), + "command": obj.get("command"), + "completions": obj.get("completions") if obj.get("completions") is not None else 1, + "parallelism": obj.get("parallelism") if obj.get("parallelism") is not None else 1, + "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True + }) + return _obj + + diff --git a/platform_api_python_client/models/create_job_deployment_response.py b/platform_api_python_client/models/create_job_deployment_response.py new file mode 100644 index 0000000..6fbaa52 --- /dev/null +++ b/platform_api_python_client/models/create_job_deployment_response.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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateJobDeploymentResponse(BaseModel): + """ + CreateJobDeploymentResponse + """ # noqa: E501 + id: StrictInt + created_at: datetime + endpoint_url: StrictStr + __properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"] + + 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 CreateJobDeploymentResponse 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 CreateJobDeploymentResponse 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"), + "created_at": obj.get("created_at"), + "endpoint_url": obj.get("endpoint_url") + }) + return _obj + + diff --git a/platform_api_python_client/models/deployment_type.py b/platform_api_python_client/models/deployment_type.py index d338ae7..f1934f4 100644 --- a/platform_api_python_client/models/deployment_type.py +++ b/platform_api_python_client/models/deployment_type.py @@ -38,6 +38,7 @@ class DeploymentType(str, Enum): CSERVE_V3 = 'cserve_v3' DEPLOYMENT = 'deployment' RAG = 'rag' + JOB = 'job' @classmethod def from_json(cls, json_str: str) -> Self: 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 bf81245..1ab9da9 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 @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from platform_api_python_client.models.backend_protocol import BackendProtocol +from platform_api_python_client.models.config_file_mount import ConfigFileMount 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 @@ -60,7 +61,8 @@ class GetInferenceV3DeploymentResponse(BaseModel): backend_protocol: Optional[BackendProtocol] = None enable_logging: Optional[StrictBool] = True 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", "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", "session_affinity"] + config_file: Optional[ConfigFileMount] = 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", "session_affinity", "config_file"] model_config = ConfigDict( populate_by_name=True, @@ -104,6 +106,9 @@ 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 config_file + if self.config_file: + _dict['config_file'] = self.config_file.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: @@ -164,6 +169,11 @@ 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 config_file (nullable) is None + # and model_fields_set contains the field + if self.config_file is None and "config_file" in self.model_fields_set: + _dict['config_file'] = None + return _dict @classmethod @@ -204,7 +214,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None, "backend_protocol": obj.get("backend_protocol"), "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True, - "session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False + "session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False, + "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None }) return _obj diff --git a/platform_api_python_client/models/get_job_deployment_response.py b/platform_api_python_client/models/get_job_deployment_response.py new file mode 100644 index 0000000..064fef9 --- /dev/null +++ b/platform_api_python_client/models/get_job_deployment_response.py @@ -0,0 +1,160 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +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 + +class GetJobDeploymentResponse(BaseModel): + """ + GetJobDeploymentResponse + """ # noqa: E501 + creator_email: StrictStr + cluster_id: StrictInt + id: StrictInt + name: StrictStr + endpoint_url: StrictStr + image_url: Optional[StrictStr] = None + type: DeploymentType + status: DeploymentStatus + created_at: datetime + hardware_instance_id: StrictInt + revision_number: StrictInt + user_annotations: Optional[Dict[str, StrictStr]] = None + env_vars: Optional[Dict[str, StrictStr]] = None + command: Optional[List[StrictStr]] = None + args: Optional[List[StrictStr]] = None + completions: Optional[StrictInt] = 1 + parallelism: Optional[StrictInt] = 1 + 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", "env_vars", "command", "args", "completions", "parallelism", "image_pull_secret_credentials", "enable_logging"] + + 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 GetJobDeploymentResponse 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 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: + _dict['image_url'] = None + + # 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: + _dict['user_annotations'] = None + + # set to None if env_vars (nullable) is None + # and model_fields_set contains the field + if self.env_vars is None and "env_vars" in self.model_fields_set: + _dict['env_vars'] = None + + # set to None if command (nullable) is None + # and model_fields_set contains the field + if self.command is None and "command" in self.model_fields_set: + _dict['command'] = None + + # set to None if args (nullable) is None + # and model_fields_set contains the field + if self.args is None and "args" in self.model_fields_set: + _dict['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 + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetJobDeploymentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "creator_email": obj.get("creator_email"), + "cluster_id": obj.get("cluster_id"), + "id": obj.get("id"), + "name": obj.get("name"), + "endpoint_url": obj.get("endpoint_url"), + "image_url": obj.get("image_url"), + "type": obj.get("type"), + "status": obj.get("status"), + "created_at": obj.get("created_at"), + "hardware_instance_id": obj.get("hardware_instance_id"), + "revision_number": obj.get("revision_number"), + "user_annotations": obj.get("user_annotations"), + "env_vars": obj.get("env_vars"), + "command": obj.get("command"), + "args": obj.get("args"), + "completions": obj.get("completions") if obj.get("completions") is not None else 1, + "parallelism": obj.get("parallelism") if obj.get("parallelism") is not None else 1, + "image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None, + "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True + }) + return _obj + + diff --git a/platform_api_python_client/models/pod_status.py b/platform_api_python_client/models/pod_status.py index 15810cb..15bed96 100644 --- a/platform_api_python_client/models/pod_status.py +++ b/platform_api_python_client/models/pod_status.py @@ -36,6 +36,8 @@ class PodStatus(str, Enum): PROGRESSDEADLINEEXCEEDED = 'ProgressDeadlineExceeded' RUNNING = 'Running' NOTREADY = 'NotReady' + COMPLETED = 'Completed' + FAILED = 'Failed' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/platform_api_python_client/models/service_status.py b/platform_api_python_client/models/service_status.py index ee1dc81..d18dac5 100644 --- a/platform_api_python_client/models/service_status.py +++ b/platform_api_python_client/models/service_status.py @@ -31,12 +31,15 @@ class ServiceStatus(str, Enum): SCALINGUP = 'ScalingUp' PULLING = 'Pulling' INITIALIZING = 'Initializing' + CLEANEDUP = 'CleanedUp' ERROR = 'Error' CREATECONTAINERCONFIGERROR = 'CreateContainerConfigError' CRASHLOOPBACKOFF = 'CrashLoopBackOff' IMAGEPULLBACKOFF = 'ImagePullBackOff' PROGRESSDEADLINEEXCEEDED = 'ProgressDeadlineExceeded' NOTREADY = 'NotReady' + COMPLETED = 'Completed' + FAILED = 'Failed' SCALEDTOZERO = 'ScaledToZero' UNKNOWN = 'Unknown' diff --git a/pyproject.toml b/pyproject.toml index 79b1dd0..2ba0ffb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "platform_api_python_client" -version = "4.9.6" +version = "4.9.7" description = "Platform External API" authors = ["OpenAPI Generator Community "] license = "NoLicense" diff --git a/setup.py b/setup.py index c542048..55292c6 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.9.6" +VERSION = "4.9.7" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 1.25.3, < 3.0.0", diff --git a/test/test_config_file_mount.py b/test/test_config_file_mount.py new file mode 100644 index 0000000..bb52ab5 --- /dev/null +++ b/test/test_config_file_mount.py @@ -0,0 +1,56 @@ +# 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.config_file_mount import ConfigFileMount + +class TestConfigFileMount(unittest.TestCase): + """ConfigFileMount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConfigFileMount: + """Test ConfigFileMount + 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 `ConfigFileMount` + """ + model = ConfigFileMount() + if include_optional: + return ConfigFileMount( + filename = '20', + mount_path = '0', + content = '0' + ) + else: + return ConfigFileMount( + filename = '20', + mount_path = '0', + content = '0', + ) + """ + + def testConfigFileMount(self): + """Test ConfigFileMount""" + # 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_create_inference_v3_deployment_request.py b/test/test_create_inference_v3_deployment_request.py index 588bbe4..f7fe773 100644 --- a/test/test_create_inference_v3_deployment_request.py +++ b/test/test_create_inference_v3_deployment_request.py @@ -63,7 +63,11 @@ def make_instance(self, include_optional) -> CreateInferenceV3DeploymentRequest: hf_token = '', backend_protocol = 'HTTP', enable_logging = True, - session_affinity = True + session_affinity = True, + config_file = platform_api_python_client.models.config_file_mount.ConfigFileMount( + filename = '20', + mount_path = '0', + content = '0', ) ) else: return CreateInferenceV3DeploymentRequest( diff --git a/test/test_create_job_deployment_request.py b/test/test_create_job_deployment_request.py new file mode 100644 index 0000000..65cb1a0 --- /dev/null +++ b/test/test_create_job_deployment_request.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.create_job_deployment_request import CreateJobDeploymentRequest + +class TestCreateJobDeploymentRequest(unittest.TestCase): + """CreateJobDeploymentRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateJobDeploymentRequest: + """Test CreateJobDeploymentRequest + 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 `CreateJobDeploymentRequest` + """ + model = CreateJobDeploymentRequest() + if include_optional: + return CreateJobDeploymentRequest( + name = 'ar1c2v7s6djuy1zmetozkhdomha1b0', + cluster_id = 56, + hardware_instance_id = 56, + user_annotations = { + 'key' : '' + }, + image_url = '', + image_pull_secret_credentials = platform_api_python_client.models.image_pull_secret_credentials.ImagePullSecretCredentials( + username = '', + password = '', ), + env_vars = { + 'key' : '' + }, + command = '', + completions = 56, + parallelism = 56, + enable_logging = True + ) + else: + return CreateJobDeploymentRequest( + name = 'ar1c2v7s6djuy1zmetozkhdomha1b0', + cluster_id = 56, + hardware_instance_id = 56, + image_url = '', + ) + """ + + def testCreateJobDeploymentRequest(self): + """Test CreateJobDeploymentRequest""" + # 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_create_job_deployment_response.py b/test/test_create_job_deployment_response.py new file mode 100644 index 0000000..2f9bf01 --- /dev/null +++ b/test/test_create_job_deployment_response.py @@ -0,0 +1,56 @@ +# 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.create_job_deployment_response import CreateJobDeploymentResponse + +class TestCreateJobDeploymentResponse(unittest.TestCase): + """CreateJobDeploymentResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateJobDeploymentResponse: + """Test CreateJobDeploymentResponse + 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 `CreateJobDeploymentResponse` + """ + model = CreateJobDeploymentResponse() + if include_optional: + return CreateJobDeploymentResponse( + id = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + endpoint_url = '' + ) + else: + return CreateJobDeploymentResponse( + id = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + endpoint_url = '', + ) + """ + + def testCreateJobDeploymentResponse(self): + """Test CreateJobDeploymentResponse""" + # 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_deployment_response.py b/test/test_deployment_response.py index 6356d4e..8ea5d97 100644 --- a/test/test_deployment_response.py +++ b/test/test_deployment_response.py @@ -76,7 +76,11 @@ def make_instance(self, include_optional) -> DeploymentResponse: image_pull_secret_credentials = platform_api_python_client.models.image_pull_secret_credentials.ImagePullSecretCredentials( username = '', password = '', ), - backend_protocol = 'HTTP' + backend_protocol = 'HTTP', + config_file = platform_api_python_client.models.config_file_mount.ConfigFileMount( + filename = '20', + mount_path = '0', + content = '0', ) ) else: return DeploymentResponse( diff --git a/test/test_external_api.py b/test/test_external_api.py index 3b1813a..84f4739 100644 --- a/test/test_external_api.py +++ b/test/test_external_api.py @@ -68,6 +68,13 @@ def test_create_inference_v3_deployment_deployments_inference_v3_post(self) -> N """ pass + def test_create_job_deployment_deployments_job_post(self) -> None: + """Test case for create_job_deployment_deployments_job_post + + Create Job Deployment + """ + pass + def test_create_new_organization_organizations_post(self) -> None: """Test case for create_new_organization_organizations_post @@ -222,6 +229,13 @@ def test_get_inference_v3_deployment_deployments_inference_v3_deployment_id_get( """ pass + def test_get_job_deployment_deployments_job_deployment_id_get(self) -> None: + """Test case for get_job_deployment_deployments_job_deployment_id_get + + Get Job Deployment + """ + pass + def test_get_prebuilt_images_prebuilt_images_get(self) -> None: """Test case for get_prebuilt_images_prebuilt_images_get diff --git a/test/test_get_inference_v3_deployment_response.py b/test/test_get_inference_v3_deployment_response.py index fd708c7..cf5d347 100644 --- a/test/test_get_inference_v3_deployment_response.py +++ b/test/test_get_inference_v3_deployment_response.py @@ -73,7 +73,11 @@ def make_instance(self, include_optional) -> GetInferenceV3DeploymentResponse: password = '', ), backend_protocol = 'HTTP', enable_logging = True, - session_affinity = True + session_affinity = True, + config_file = platform_api_python_client.models.config_file_mount.ConfigFileMount( + filename = '20', + mount_path = '0', + content = '0', ) ) else: return GetInferenceV3DeploymentResponse( diff --git a/test/test_get_job_deployment_response.py b/test/test_get_job_deployment_response.py new file mode 100644 index 0000000..fcd9ec2 --- /dev/null +++ b/test/test_get_job_deployment_response.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 + + +import unittest + +from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse + +class TestGetJobDeploymentResponse(unittest.TestCase): + """GetJobDeploymentResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetJobDeploymentResponse: + """Test GetJobDeploymentResponse + 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 `GetJobDeploymentResponse` + """ + model = GetJobDeploymentResponse() + if include_optional: + return GetJobDeploymentResponse( + creator_email = '', + cluster_id = 56, + id = 56, + name = '', + endpoint_url = '', + image_url = '', + type = 'inference', + status = 'active', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + hardware_instance_id = 56, + revision_number = 56, + user_annotations = { + 'key' : '' + }, + env_vars = { + 'key' : '' + }, + command = [ + '' + ], + args = [ + '' + ], + completions = 56, + parallelism = 56, + image_pull_secret_credentials = platform_api_python_client.models.image_pull_secret_credentials.ImagePullSecretCredentials( + username = '', + password = '', ), + enable_logging = True + ) + else: + return GetJobDeploymentResponse( + creator_email = '', + cluster_id = 56, + id = 56, + name = '', + endpoint_url = '', + type = 'inference', + status = 'active', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + hardware_instance_id = 56, + revision_number = 56, + ) + """ + + def testGetJobDeploymentResponse(self): + """Test GetJobDeploymentResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()