Skip to content

Commit

Permalink
[QI2-1397] Pop batch job with id
Browse files Browse the repository at this point in the history
  • Loading branch information
NischalQuTech committed Feb 27, 2025
1 parent ec88924 commit 84e88b3
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -228,7 +228,7 @@ Authentication schemes defined for the API: <a id="user_bearer"></a>

- **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

<a id="backend"></a>
Expand Down
40 changes: 29 additions & 11 deletions compute_api_client/api/batch_jobs_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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(
Expand All @@ -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)],
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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(
Expand All @@ -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)],
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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(
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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,
Expand Down
19 changes: 12 additions & 7 deletions compute_api_client/docs/BatchJobsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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)

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
Expand Down

0 comments on commit 84e88b3

Please sign in to comment.