|
| 1 | +# Copyright 2025 Scaleway |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
1 | 14 | import json |
2 | 15 | import randomname |
3 | 16 |
|
|
29 | 42 | from quantum_as_a_service_api_client.api.platforms.list_platforms import ( |
30 | 43 | sync as _list_platforms_sync, |
31 | 44 | ) |
| 45 | +from quantum_as_a_service_api_client.api.platforms.get_platform import ( |
| 46 | + sync as _get_platform_sync, |
| 47 | +) |
32 | 48 | from quantum_as_a_service_api_client.api.jobs.create_job import ( |
33 | 49 | sync as _create_job_sync, |
34 | 50 | ) |
@@ -56,7 +72,14 @@ def __init__(self, project_id: str, secret_key: str, url: str = __DEFAULT_URL): |
56 | 72 | verify_ssl="https" in url, |
57 | 73 | ) |
58 | 74 |
|
59 | | - def list_platforms(self, name: Optional[str]) -> List[ScalewayQaasV1Alpha1Platform]: |
| 75 | + def get_platform(self, platform_id: str) -> ScalewayQaasV1Alpha1Platform: |
| 76 | + platform = _get_platform_sync(client=self.__client, platform_id=platform_id) |
| 77 | + |
| 78 | + return platform |
| 79 | + |
| 80 | + def list_platforms( |
| 81 | + self, name: Optional[str] = None |
| 82 | + ) -> List[ScalewayQaasV1Alpha1Platform]: |
60 | 83 | response = _list_platforms_sync(client=self.__client, name=name) |
61 | 84 |
|
62 | 85 | assert response |
|
0 commit comments