From 84e88b353ceaea306551de3b44fe5c74f4307db9 Mon Sep 17 00:00:00 2001 From: qutech-machine Date: Thu, 27 Feb 2025 10:58:23 +0000 Subject: [PATCH] [QI2-1397] Pop batch job with id --- README.md | 4 +-- compute_api_client/api/batch_jobs_api.py | 40 +++++++++++++++++------- compute_api_client/docs/BatchJobsApi.md | 19 ++++++----- pyproject.toml | 2 +- 4 files changed, 44 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 50142ab..d39c48f 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ All URIs are relative to _http://localhost_ | _BatchJobsApi_ | [**peek_batch_job_batch_jobs_peek_patch**](compute_api_client/docs/BatchJobsApi.md#peek_batch_job_batch_jobs_peek_patch) | **PATCH** /batch_jobs/peek | Peek batch job | | _BatchJobsApi_ | [**pop_batch_job_batch_jobs_pop_patch**](compute_api_client/docs/BatchJobsApi.md#pop_batch_job_batch_jobs_pop_patch) | **PATCH** /batch_jobs/pop | Take batch job | | _BatchJobsApi_ | [**read_batch_jobs_batch_jobs_get**](compute_api_client/docs/BatchJobsApi.md#read_batch_jobs_batch_jobs_get) | **GET** /batch_jobs | List batch jobs | -| _BatchJobsApi_ | [**unpop_batch_job_batch_jobs_unpop_patch**](compute_api_client/docs/BatchJobsApi.md#unpop_batch_job_batch_jobs_unpop_patch) | **PATCH** /batch_jobs/unpop | Take batch job | +| _BatchJobsApi_ | [**unpop_batch_job_batch_jobs_id_unpop_patch**](compute_api_client/docs/BatchJobsApi.md#unpop_batch_job_batch_jobs_id_unpop_patch) | **PATCH** /batch_jobs/{id}/unpop | Take batch job | | _CommitsApi_ | [**compile_commit_commits_id_compile_post**](compute_api_client/docs/CommitsApi.md#compile_commit_commits_id_compile_post) | **POST** /commits/{id}/compile | Compile file in a commit | | _CommitsApi_ | [**create_commit_commits_post**](compute_api_client/docs/CommitsApi.md#create_commit_commits_post) | **POST** /commits | Create commit | | _CommitsApi_ | [**delete_commit_commits_id_delete**](compute_api_client/docs/CommitsApi.md#delete_commit_commits_id_delete) | **DELETE** /commits/{id} | Destroy commit | @@ -228,7 +228,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: accessCode -- **Authorization URL**: https://quantum-inspire-staging.eu.auth0.com/authorize +- **Authorization URL**: https://auth.qi2.quantum-inspire.com/realms/oidc_development/protocol/openid-connect/auth - **Scopes**: N/A diff --git a/compute_api_client/api/batch_jobs_api.py b/compute_api_client/api/batch_jobs_api.py index 1c7e09c..89fb9c4 100644 --- a/compute_api_client/api/batch_jobs_api.py +++ b/compute_api_client/api/batch_jobs_api.py @@ -1975,8 +1975,9 @@ def _read_batch_jobs_batch_jobs_get_serialize( @validate_call - async def unpop_batch_job_batch_jobs_unpop_patch( + async def unpop_batch_job_batch_jobs_id_unpop_patch( self, + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1994,6 +1995,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch( Unclaim batch job. + :param id: (required) + :type 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 @@ -2016,7 +2019,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch( :return: Returns the result object. """ # noqa: E501 - _param = self._unpop_batch_job_batch_jobs_unpop_patch_serialize( + _param = self._unpop_batch_job_batch_jobs_id_unpop_patch_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2025,7 +2029,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch( _response_types_map: Dict[str, Optional[str]] = { '200': "BatchJob", - '404': "HTTPNotFoundError" + '404': "HTTPNotFoundError", + '422': "HTTPValidationError" } response_data = await self.api_client.call_api( @@ -2040,8 +2045,9 @@ async def unpop_batch_job_batch_jobs_unpop_patch( @validate_call - async def unpop_batch_job_batch_jobs_unpop_patch_with_http_info( + async def unpop_batch_job_batch_jobs_id_unpop_patch_with_http_info( self, + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2059,6 +2065,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch_with_http_info( Unclaim batch job. + :param id: (required) + :type 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 @@ -2081,7 +2089,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._unpop_batch_job_batch_jobs_unpop_patch_serialize( + _param = self._unpop_batch_job_batch_jobs_id_unpop_patch_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2090,7 +2099,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "BatchJob", - '404': "HTTPNotFoundError" + '404': "HTTPNotFoundError", + '422': "HTTPValidationError" } response_data = await self.api_client.call_api( @@ -2105,8 +2115,9 @@ async def unpop_batch_job_batch_jobs_unpop_patch_with_http_info( @validate_call - async def unpop_batch_job_batch_jobs_unpop_patch_without_preload_content( + async def unpop_batch_job_batch_jobs_id_unpop_patch_without_preload_content( self, + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2124,6 +2135,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch_without_preload_content( Unclaim batch job. + :param id: (required) + :type 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 @@ -2146,7 +2159,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._unpop_batch_job_batch_jobs_unpop_patch_serialize( + _param = self._unpop_batch_job_batch_jobs_id_unpop_patch_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2155,7 +2169,8 @@ async def unpop_batch_job_batch_jobs_unpop_patch_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "BatchJob", - '404': "HTTPNotFoundError" + '404': "HTTPNotFoundError", + '422': "HTTPValidationError" } response_data = await self.api_client.call_api( @@ -2165,8 +2180,9 @@ async def unpop_batch_job_batch_jobs_unpop_patch_without_preload_content( return response_data.response - def _unpop_batch_job_batch_jobs_unpop_patch_serialize( + def _unpop_batch_job_batch_jobs_id_unpop_patch_serialize( self, + id, _request_auth, _content_type, _headers, @@ -2187,6 +2203,8 @@ def _unpop_batch_job_batch_jobs_unpop_patch_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -2208,7 +2226,7 @@ def _unpop_batch_job_batch_jobs_unpop_patch_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/batch_jobs/unpop', + resource_path='/batch_jobs/{id}/unpop', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/compute_api_client/docs/BatchJobsApi.md b/compute_api_client/docs/BatchJobsApi.md index 7c350e9..8071bd0 100644 --- a/compute_api_client/docs/BatchJobsApi.md +++ b/compute_api_client/docs/BatchJobsApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description [**peek_batch_job_batch_jobs_peek_patch**](BatchJobsApi.md#peek_batch_job_batch_jobs_peek_patch) | **PATCH** /batch_jobs/peek | Peek batch job [**pop_batch_job_batch_jobs_pop_patch**](BatchJobsApi.md#pop_batch_job_batch_jobs_pop_patch) | **PATCH** /batch_jobs/pop | Take batch job [**read_batch_jobs_batch_jobs_get**](BatchJobsApi.md#read_batch_jobs_batch_jobs_get) | **GET** /batch_jobs | List batch jobs -[**unpop_batch_job_batch_jobs_unpop_patch**](BatchJobsApi.md#unpop_batch_job_batch_jobs_unpop_patch) | **PATCH** /batch_jobs/unpop | Take batch job +[**unpop_batch_job_batch_jobs_id_unpop_patch**](BatchJobsApi.md#unpop_batch_job_batch_jobs_id_unpop_patch) | **PATCH** /batch_jobs/{id}/unpop | Take batch job # **create_batch_job_batch_jobs_post** @@ -511,8 +511,8 @@ 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) -# **unpop_batch_job_batch_jobs_unpop_patch** -> BatchJob unpop_batch_job_batch_jobs_unpop_patch() +# **unpop_batch_job_batch_jobs_id_unpop_patch** +> BatchJob unpop_batch_job_batch_jobs_id_unpop_patch(id) Take batch job @@ -550,20 +550,24 @@ configuration.api_key['backend'] = os.environ["API_KEY"] async with compute_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = compute_api_client.BatchJobsApi(api_client) + id = 56 # int | try: # Take batch job - api_response = await api_instance.unpop_batch_job_batch_jobs_unpop_patch() - print("The response of BatchJobsApi->unpop_batch_job_batch_jobs_unpop_patch:\n") + api_response = await api_instance.unpop_batch_job_batch_jobs_id_unpop_patch(id) + print("The response of BatchJobsApi->unpop_batch_job_batch_jobs_id_unpop_patch:\n") pprint(api_response) except Exception as e: - print("Exception when calling BatchJobsApi->unpop_batch_job_batch_jobs_unpop_patch: %s\n" % e) + print("Exception when calling BatchJobsApi->unpop_batch_job_batch_jobs_id_unpop_patch: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | ### Return type @@ -583,6 +587,7 @@ This endpoint does not need any parameter. |-------------|-------------|------------------| **200** | Successful Response | - | **404** | Not Found | - | +**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) diff --git a/pyproject.toml b/pyproject.toml index d698400..921d68c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "qi-compute-api-client" -version = "0.47.0" +version = "0.48.0" description = "An API client for the Compute Job Manager of Quantum Inspire." license = "Apache-2.0" authors = ["Quantum Inspire "]