diff --git a/.gitignore b/.gitignore index b7faf40..41793b4 100644 --- a/.gitignore +++ b/.gitignore @@ -205,3 +205,5 @@ cython_debug/ marimo/_static/ marimo/_lsp/ __marimo__/ + +*.env \ No newline at end of file diff --git a/Makefile b/Makefile index d5006c1..af6e3c2 100644 --- a/Makefile +++ b/Makefile @@ -40,4 +40,11 @@ install-test: .PHONY: test test: - pytest -s --showprogress -vv tests/ \ No newline at end of file + pytest -s --showprogress -vv tests/test_api.py + +.PHONY: test-booking +test-booking: + pytest -s --showprogress -vv tests/test_booking.py + +.PHONY: all +all: v1alpha1 \ No newline at end of file diff --git a/openapi/scaleway.qaas.v1alpha1.Api.yml b/openapi/scaleway.qaas.v1alpha1.Api.yml index 33f9894..3222629 100644 --- a/openapi/scaleway.qaas.v1alpha1.Api.yml +++ b/openapi/scaleway.qaas.v1alpha1.Api.yml @@ -379,6 +379,11 @@ components: progress_message: type: string description: Any progress message of the booking. + time_zone: + type: string + description: Time zone for the booking schedule, in tz database format (e.g. + 'Europe/Paris'). + nullable: true x-properties-order: - id - created_at @@ -388,6 +393,7 @@ components: - status - description - progress_message + - time_zone scaleway.qaas.v1alpha1.Job: type: object properties: @@ -863,11 +869,30 @@ components: can be booked in the future. (in seconds) example: 2.5s nullable: true + min_planification_duration: + type: string + description: Minimum planification time before a platform can be booked. + (in seconds) + example: 2.5s + nullable: true + max_booking_per_week: + type: integer + description: Maximum amount of booking allowed for one organization + per week. + format: uint32 + max_booking_per_day: + type: integer + description: Maximum amount of booking allowed for one organization + per day. + format: uint32 x-properties-order: - min_duration - max_duration - max_cancellation_duration - max_planification_duration + - min_planification_duration + - max_booking_per_week + - max_booking_per_day description: type: string description: English description of the platform. @@ -1172,13 +1197,11 @@ paths: description: List applications with this name. schema: type: string - description: List applications with this name. - in: query name: application_type description: List applications with this type. schema: type: string - description: List applications with this type. enum: - unknown_type - vqe @@ -1192,21 +1215,18 @@ paths: description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of applications a to return per page. schema: type: integer - description: Maximum number of applications a to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned applications. schema: type: string - description: Sort order of the returned applications. enum: - name_asc - name_desc @@ -1247,7 +1267,6 @@ paths: required: true schema: type: string - description: Unique ID of the application. responses: "200": description: "" @@ -1281,34 +1300,29 @@ paths: description: List bookings belonging to this project ID. (UUID format) schema: type: string - description: List bookings belonging to this project ID. (UUID format) example: 6170692e-7363-616c-6577-61792e636f6d - in: query name: platform_id description: List bookings attached to this platform ID. schema: type: string - description: List bookings attached to this platform ID. - in: query name: page description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of results to return per page. schema: type: integer - description: Maximum number of results to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned results. schema: type: string - description: Sort order of the returned results. enum: - created_at_desc - created_at_asc @@ -1349,7 +1363,6 @@ paths: required: true schema: type: string - description: Unique ID of the booking. responses: "200": description: "" @@ -1382,7 +1395,6 @@ paths: required: true schema: type: string - description: Unique ID of the booking. responses: "200": description: "" @@ -1430,7 +1442,6 @@ paths: description: List jobs with these tags. schema: type: array - description: List jobs with these tags. items: type: string - in: query @@ -1438,21 +1449,18 @@ paths: description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of jobs to return per page. schema: type: integer - description: Maximum number of jobs to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned jobs. schema: type: string - description: Sort order of the returned jobs. enum: - created_at_desc - created_at_asc @@ -1600,7 +1608,6 @@ paths: required: true schema: type: string - description: Unique ID of the job you want to get. responses: "200": description: "" @@ -1633,7 +1640,6 @@ paths: required: true schema: type: string - description: Unique ID of the job. responses: "200": description: "" @@ -1688,7 +1694,6 @@ paths: required: true schema: type: string - description: Unique ID of the job. responses: "204": description: "" @@ -1718,7 +1723,6 @@ paths: required: true schema: type: string - description: Unique ID of the job. responses: "200": description: "" @@ -1760,7 +1764,6 @@ paths: required: true schema: type: string - description: Unique ID of the job. responses: "200": description: "" @@ -1794,27 +1797,23 @@ paths: required: true schema: type: string - description: ID of the job. - in: query name: page description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of results to return per page. schema: type: integer - description: Maximum number of results to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned results. schema: type: string - description: Sort order of the returned results. enum: - created_at_desc - created_at_asc @@ -1853,27 +1852,23 @@ paths: required: true schema: type: string - description: List models belonging to this project ID. - in: query name: page description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of results to return per page. schema: type: integer - description: Maximum number of results to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned results. schema: type: string - description: Sort order of the returned results. enum: - created_at_desc - created_at_asc @@ -1958,7 +1953,6 @@ paths: required: true schema: type: string - description: Unique ID of the model. responses: "200": description: "" @@ -1991,25 +1985,21 @@ paths: description: List platforms with this provider name. schema: type: string - description: List platforms with this provider name. - in: query name: backend_name description: List platforms with this backend name. schema: type: string - description: List platforms with this backend name. - in: query name: name description: List platforms with this name. schema: type: string - description: List platforms with this name. - in: query name: platform_type description: List platforms with this type. schema: type: string - description: List platforms with this type. enum: - unknown_type - simulator @@ -2020,7 +2010,6 @@ paths: description: List platforms with this technology. schema: type: string - description: List platforms with this technology. enum: - unknown_technology - photonic @@ -2034,21 +2023,18 @@ paths: description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of platforms to return per page. schema: type: integer - description: Maximum number of platforms to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned platforms. schema: type: string - description: Sort order of the returned platforms. enum: - name_asc - name_desc @@ -2095,7 +2081,6 @@ paths: required: true schema: type: string - description: Unique ID of the platform. responses: "200": description: "" @@ -2128,13 +2113,11 @@ paths: description: List processes that have been created for this application. schema: type: string - description: List processes that have been created for this application. - in: query name: tags description: List processes with these tags. schema: type: array - description: List processes with these tags. items: type: string - in: query @@ -2142,21 +2125,18 @@ paths: description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of processes to return per page. schema: type: integer - description: Maximum number of processes to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned processes. schema: type: string - description: Sort order of the returned processes. enum: - created_at_desc - created_at_asc @@ -2173,7 +2153,6 @@ paths: required: true schema: type: string - description: List processes belonging to this project ID. (UUID format) example: 6170692e-7363-616c-6577-61792e636f6d responses: "200": @@ -2290,7 +2269,6 @@ paths: required: true schema: type: string - description: Unique ID of the process. responses: "200": description: "" @@ -2323,7 +2301,6 @@ paths: required: true schema: type: string - description: Unique ID of the process. responses: "200": description: "" @@ -2378,7 +2355,6 @@ paths: required: true schema: type: string - description: Unique ID of the process. responses: "204": description: "" @@ -2409,7 +2385,6 @@ paths: required: true schema: type: string - description: Unique ID of the process. responses: "200": description: "" @@ -2451,27 +2426,23 @@ paths: required: true schema: type: string - description: ID of the process. - in: query name: page description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of results to return per page. schema: type: integer - description: Maximum number of results to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned results. schema: type: string - description: Sort order of the returned results. enum: - created_at_desc - created_at_asc @@ -2508,13 +2479,11 @@ paths: description: List sessions that have been created for this platform. schema: type: string - description: List sessions that have been created for this platform. - in: query name: tags description: List sessions with these tags. schema: type: array - description: List sessions with these tags. items: type: string - in: query @@ -2522,21 +2491,18 @@ paths: description: Page number. schema: type: integer - description: Page number. format: int32 - in: query name: page_size description: Maximum number of sessions to return per page. schema: type: integer - description: Maximum number of sessions to return per page. format: uint32 - in: query name: order_by description: Sort order of the returned sessions. schema: type: string - description: Sort order of the returned sessions. enum: - name_asc - name_desc @@ -2553,7 +2519,6 @@ paths: required: true schema: type: string - description: List sessions belonging to this project ID. (UUID format) example: 6170692e-7363-616c-6577-61792e636f6d responses: "200": @@ -2647,10 +2612,13 @@ paths: nullable: true description: $ref: '#/components/schemas/google.protobuf.StringValue' + time_zone: + $ref: '#/components/schemas/google.protobuf.StringValue' x-properties-order: - started_at - finished_at - description + - time_zone model_id: type: string description: Default computation model ID to be executed by job @@ -2706,7 +2674,6 @@ paths: required: true schema: type: string - description: Unique ID of the session. responses: "200": description: "" @@ -2739,7 +2706,6 @@ paths: required: true schema: type: string - description: Unique ID of the session. responses: "200": description: "" @@ -2808,7 +2774,6 @@ paths: required: true schema: type: string - description: Unique ID of the session. responses: "204": description: "" @@ -2880,7 +2845,6 @@ paths: required: true schema: type: string - description: Unique ID of the session. responses: "200": description: "" diff --git a/scaleway_qaas_client/v1alpha1/__init__.py b/scaleway_qaas_client/v1alpha1/__init__.py index 07829c4..394ebe0 100644 --- a/scaleway_qaas_client/v1alpha1/__init__.py +++ b/scaleway_qaas_client/v1alpha1/__init__.py @@ -25,6 +25,9 @@ from .quantum_as_a_service_api_client.models import ( ScalewayQaasV1Alpha1Application as QaaSApplication, ) +from .quantum_as_a_service_api_client.models import ( + ScalewayQaasV1Alpha1Booking as QaaSBooking, +) from .quantum_as_a_service_api_client.models import ScalewayQaasV1Alpha1Job as QaaSJob from .quantum_as_a_service_api_client.models import ( ScalewayQaasV1Alpha1JobResult as QaaSJobResult, @@ -44,6 +47,9 @@ from .quantum_as_a_service_api_client.models import ( ScalewayQaasV1Alpha1PlatformAvailability as QaaSPlatformAvailability, ) +from .quantum_as_a_service_api_client.models import ( + ScalewayQaasV1Alpha1PlatformBookingRequirement as QaaSBookingRequirements, +) from .quantum_as_a_service_api_client.models import ( ScalewayQaasV1Alpha1PlatformTechnology as QaaSPlatformTechnology, ) diff --git a/scaleway_qaas_client/v1alpha1/client.py b/scaleway_qaas_client/v1alpha1/client.py index b8ecf12..5e50564 100644 --- a/scaleway_qaas_client/v1alpha1/client.py +++ b/scaleway_qaas_client/v1alpha1/client.py @@ -16,6 +16,7 @@ import randomname from pytimeparse.timeparse import timeparse +from datetime import datetime from scaleway_qaas_client.v1alpha1.quantum_as_a_service_api_client.api.applications.get_application import ( sync_detailed as _get_application_sync, @@ -89,6 +90,12 @@ from scaleway_qaas_client.v1alpha1.quantum_as_a_service_api_client.api.sessions.terminate_session import ( sync_detailed as _terminate_session_sync, ) +from scaleway_qaas_client.v1alpha1.quantum_as_a_service_api_client.api.bookings.get_booking import ( + sync_detailed as _get_booking_sync, +) +from scaleway_qaas_client.v1alpha1.quantum_as_a_service_api_client.api.bookings.list_bookings import ( + sync_detailed as _list_bookings_sync, +) from scaleway_qaas_client.v1alpha1.quantum_as_a_service_api_client.client import ( AuthenticatedClient, ) @@ -100,12 +107,14 @@ CreateModelBody, CreateProcessBody, CreateSessionBody, + CreateSessionBodyBookingDemand, ListPlatformsPlatformTechnology, ListPlatformsPlatformType, ScalewayQaasV1Alpha1Application, ScalewayQaasV1Alpha1Job, ScalewayQaasV1Alpha1JobResult, ScalewayQaasV1Alpha1Model, + ScalewayQaasV1Alpha1Booking, ScalewayQaasV1Alpha1Platform, ScalewayQaasV1Alpha1Process, ScalewayQaasV1Alpha1ProcessResult, @@ -239,6 +248,9 @@ def create_session( name: Optional[str] = None, model_id: Optional[str] = None, parameters: Optional[Union[Dict, List, str]] = None, + booking_demand_started_at: Optional[datetime] = None, + booking_demand_finished_at: Optional[datetime] = None, + booking_demand_description: Optional[str] = None, ) -> ScalewayQaasV1Alpha1Session: """Create a session @@ -252,6 +264,9 @@ def create_session( max_duration (Union[None, Unset, str]): Maximum duration before the session ends. (in seconds) Example: 20m. deduplication_id (Union[None, Unset, str]): Deduplication ID of the session. model_id (Union[None, Unset, str]): Default computation model ID to be executed by job assigned to this session. + booking_demand_started_at (Union[None, Unset, datetime.datetime]): Wished started UTC time for an exclusive session over a QPU, only works if the platform is_bookable (RFC 3339 format) Example: 2022-03-22T12:34:56.123456Z. + booking_demand_finished_at (Union[None, Unset, datetime.datetime]): Wished finished UTC time for an exclusive session over a QPU, only works if the platform is_bookable (RFC 3339 format) Example: 2022-03-22T12:34:56.123456Z. + booking_demand_description (Union[None, Unset, str]): User description of the booking Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -261,6 +276,16 @@ def create_session( ScalewayQaasV1Alpha1Session """ + if not booking_demand_started_at and booking_demand_finished_at: + raise Exception( + "booking_demand_started_at and booking_demand_finished_at must be set" + ) + + if booking_demand_started_at and not booking_demand_finished_at: + raise Exception( + "booking_demand_started_at and booking_demand_finished_at must be set" + ) + if not platform_id: raise Exception("create_session: platform_id cannot be None") @@ -277,6 +302,16 @@ def create_session( if isinstance(max_idle_duration, str): max_idle_duration = f"{timeparse(max_idle_duration)}s" + booking_demand = UNSET + + if booking_demand_started_at and booking_demand_finished_at: + booking_demand = CreateSessionBodyBookingDemand( + started_at=booking_demand_started_at, + finished_at=booking_demand_finished_at, + description=booking_demand_description, + time_zone="UTC", + ) + response = _create_session_sync( client=self.__client, body=CreateSessionBody( @@ -288,6 +323,7 @@ def create_session( max_idle_duration=max_idle_duration, model_id=model_id, parameters=parameters, + booking_demand=booking_demand, ), ) @@ -890,3 +926,85 @@ def list_models(self) -> List[ScalewayQaasV1Alpha1Model]: _raise_on_error(response) return response.parsed.models + + def get_booking(self, booking_id: str) -> ScalewayQaasV1Alpha1Booking: + """Get booking information + + Retrieve information about the provided **booking ID**, such as description, status and progress + message. + + Args: + booking_id (str): Unique ID of the booking. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ScalewayQaasV1Alpha1Booking] + """ + + if not booking_id: + raise Exception("get_booking: booking_id cannot be None") + + response = _get_booking_sync(client=self.__client, booking_id=booking_id) + + _raise_on_error(response) + + return response.parsed + + def list_platform_bookings( + self, platform_id: str + ) -> List[ScalewayQaasV1Alpha1Booking]: + """List all bookings of the target platform + + Retrieve information about all bookings of the provided ** platform ID**. + + Args: + platform_id (Union[Unset, str]): List bookings attached to this platform ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ScalewayQaasV1Alpha1ListBookingsResponse] + """ + + response = _list_bookings_sync(client=self.__client, platform_id=platform_id) + + _raise_on_error(response) + + return response.parsed.bookings + + def list_bookings( + self, platform_id: Optional[str] = None + ) -> List[ScalewayQaasV1Alpha1Booking]: + """List all bookings according of the current project + + Retrieve information about all bookings of the project ID, can be filtered by platform ID. + + Args: + platform_id (Union[Unset, str]): Will list only bookings attached to this platform ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ScalewayQaasV1Alpha1ListBookingsResponse] + """ + if platform_id: + response = _list_bookings_sync( + client=self.__client, + platform_id=platform_id, + project_id=self.__project_id, + ) + else: + response = _list_bookings_sync( + client=self.__client, project_id=self.__project_id + ) + + _raise_on_error(response) + + return response.parsed.bookings diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/applications/get_application.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/applications/get_application.py index f18938d..a7730dc 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/applications/get_application.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/applications/get_application.py @@ -57,7 +57,7 @@ def sync_detailed( platforms. Args: - application_id (str): Unique ID of the application. + application_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -89,7 +89,7 @@ def sync( platforms. Args: - application_id (str): Unique ID of the application. + application_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,7 +116,7 @@ async def asyncio_detailed( platforms. Args: - application_id (str): Unique ID of the application. + application_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,7 +146,7 @@ async def asyncio( platforms. Args: - application_id (str): Unique ID of the application. + application_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/applications/list_applications.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/applications/list_applications.py index f62756c..d03e18f 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/applications/list_applications.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/applications/list_applications.py @@ -96,13 +96,13 @@ def sync_detailed( Retrieve information about all applications. Args: - name (Union[Unset, str]): List applications with this name. - application_type (Union[Unset, ListApplicationsApplicationType]): List applications with - this type. Default: ListApplicationsApplicationType.UNKNOWN_TYPE. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of applications a to return per page. - order_by (Union[Unset, ListApplicationsOrderBy]): Sort order of the returned applications. - Default: ListApplicationsOrderBy.NAME_ASC. + name (Union[Unset, str]): + application_type (Union[Unset, ListApplicationsApplicationType]): Default: + ListApplicationsApplicationType.UNKNOWN_TYPE. + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListApplicationsOrderBy]): Default: + ListApplicationsOrderBy.NAME_ASC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,13 +143,13 @@ def sync( Retrieve information about all applications. Args: - name (Union[Unset, str]): List applications with this name. - application_type (Union[Unset, ListApplicationsApplicationType]): List applications with - this type. Default: ListApplicationsApplicationType.UNKNOWN_TYPE. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of applications a to return per page. - order_by (Union[Unset, ListApplicationsOrderBy]): Sort order of the returned applications. - Default: ListApplicationsOrderBy.NAME_ASC. + name (Union[Unset, str]): + application_type (Union[Unset, ListApplicationsApplicationType]): Default: + ListApplicationsApplicationType.UNKNOWN_TYPE. + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListApplicationsOrderBy]): Default: + ListApplicationsOrderBy.NAME_ASC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,13 +185,13 @@ async def asyncio_detailed( Retrieve information about all applications. Args: - name (Union[Unset, str]): List applications with this name. - application_type (Union[Unset, ListApplicationsApplicationType]): List applications with - this type. Default: ListApplicationsApplicationType.UNKNOWN_TYPE. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of applications a to return per page. - order_by (Union[Unset, ListApplicationsOrderBy]): Sort order of the returned applications. - Default: ListApplicationsOrderBy.NAME_ASC. + name (Union[Unset, str]): + application_type (Union[Unset, ListApplicationsApplicationType]): Default: + ListApplicationsApplicationType.UNKNOWN_TYPE. + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListApplicationsOrderBy]): Default: + ListApplicationsOrderBy.NAME_ASC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -230,13 +230,13 @@ async def asyncio( Retrieve information about all applications. Args: - name (Union[Unset, str]): List applications with this name. - application_type (Union[Unset, ListApplicationsApplicationType]): List applications with - this type. Default: ListApplicationsApplicationType.UNKNOWN_TYPE. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of applications a to return per page. - order_by (Union[Unset, ListApplicationsOrderBy]): Sort order of the returned applications. - Default: ListApplicationsOrderBy.NAME_ASC. + name (Union[Unset, str]): + application_type (Union[Unset, ListApplicationsApplicationType]): Default: + ListApplicationsApplicationType.UNKNOWN_TYPE. + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListApplicationsOrderBy]): Default: + ListApplicationsOrderBy.NAME_ASC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/get_booking.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/get_booking.py index e38e9b5..260c8cc 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/get_booking.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/get_booking.py @@ -55,7 +55,7 @@ def sync_detailed( message. Args: - booking_id (str): Unique ID of the booking. + booking_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -87,7 +87,7 @@ def sync( message. Args: - booking_id (str): Unique ID of the booking. + booking_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,7 +114,7 @@ async def asyncio_detailed( message. Args: - booking_id (str): Unique ID of the booking. + booking_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,7 +144,7 @@ async def asyncio( message. Args: - booking_id (str): Unique ID of the booking. + booking_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/list_bookings.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/list_bookings.py index e16e531..037c031 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/list_bookings.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/list_bookings.py @@ -87,12 +87,11 @@ def sync_detailed( Retrieve information about all bookings of the provided **project ID** or ** platform ID**. Args: - project_id (Union[Unset, str]): List bookings belonging to this project ID. (UUID format) - Example: 6170692e-7363-616c-6577-61792e636f6d. - platform_id (Union[Unset, str]): List bookings attached to this platform ID. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListBookingsOrderBy]): Sort order of the returned results. Default: + project_id (Union[Unset, str]): Example: 6170692e-7363-616c-6577-61792e636f6d. + platform_id (Union[Unset, str]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListBookingsOrderBy]): Default: ListBookingsOrderBy.CREATED_AT_DESC. Raises: @@ -132,12 +131,11 @@ def sync( Retrieve information about all bookings of the provided **project ID** or ** platform ID**. Args: - project_id (Union[Unset, str]): List bookings belonging to this project ID. (UUID format) - Example: 6170692e-7363-616c-6577-61792e636f6d. - platform_id (Union[Unset, str]): List bookings attached to this platform ID. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListBookingsOrderBy]): Sort order of the returned results. Default: + project_id (Union[Unset, str]): Example: 6170692e-7363-616c-6577-61792e636f6d. + platform_id (Union[Unset, str]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListBookingsOrderBy]): Default: ListBookingsOrderBy.CREATED_AT_DESC. Raises: @@ -172,12 +170,11 @@ async def asyncio_detailed( Retrieve information about all bookings of the provided **project ID** or ** platform ID**. Args: - project_id (Union[Unset, str]): List bookings belonging to this project ID. (UUID format) - Example: 6170692e-7363-616c-6577-61792e636f6d. - platform_id (Union[Unset, str]): List bookings attached to this platform ID. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListBookingsOrderBy]): Sort order of the returned results. Default: + project_id (Union[Unset, str]): Example: 6170692e-7363-616c-6577-61792e636f6d. + platform_id (Union[Unset, str]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListBookingsOrderBy]): Default: ListBookingsOrderBy.CREATED_AT_DESC. Raises: @@ -215,12 +212,11 @@ async def asyncio( Retrieve information about all bookings of the provided **project ID** or ** platform ID**. Args: - project_id (Union[Unset, str]): List bookings belonging to this project ID. (UUID format) - Example: 6170692e-7363-616c-6577-61792e636f6d. - platform_id (Union[Unset, str]): List bookings attached to this platform ID. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListBookingsOrderBy]): Sort order of the returned results. Default: + project_id (Union[Unset, str]): Example: 6170692e-7363-616c-6577-61792e636f6d. + platform_id (Union[Unset, str]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListBookingsOrderBy]): Default: ListBookingsOrderBy.CREATED_AT_DESC. Raises: diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/update_booking.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/update_booking.py index 1f04aad..25ceeca 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/update_booking.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/bookings/update_booking.py @@ -65,7 +65,7 @@ def sync_detailed( Update booking information of the provided **booking ID**. Args: - booking_id (str): Unique ID of the booking. + booking_id (str): body (UpdateBookingBody): Raises: @@ -99,7 +99,7 @@ def sync( Update booking information of the provided **booking ID**. Args: - booking_id (str): Unique ID of the booking. + booking_id (str): body (UpdateBookingBody): Raises: @@ -128,7 +128,7 @@ async def asyncio_detailed( Update booking information of the provided **booking ID**. Args: - booking_id (str): Unique ID of the booking. + booking_id (str): body (UpdateBookingBody): Raises: @@ -160,7 +160,7 @@ async def asyncio( Update booking information of the provided **booking ID**. Args: - booking_id (str): Unique ID of the booking. + booking_id (str): body (UpdateBookingBody): Raises: diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/cancel_job.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/cancel_job.py index eecadb2..c8d13f1 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/cancel_job.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/cancel_job.py @@ -65,7 +65,7 @@ def sync_detailed( Cancel the job corresponding to the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): body (CancelJobBody): Raises: @@ -99,7 +99,7 @@ def sync( Cancel the job corresponding to the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): body (CancelJobBody): Raises: @@ -128,7 +128,7 @@ async def asyncio_detailed( Cancel the job corresponding to the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): body (CancelJobBody): Raises: @@ -160,7 +160,7 @@ async def asyncio( Cancel the job corresponding to the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): body (CancelJobBody): Raises: diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/delete_job.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/delete_job.py index f97214e..83b9bf9 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/delete_job.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/delete_job.py @@ -51,7 +51,7 @@ def sync_detailed( Delete the job corresponding to the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -82,7 +82,7 @@ async def asyncio_detailed( Delete the job corresponding to the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/get_job.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/get_job.py index 236ac1e..17f799c 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/get_job.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/get_job.py @@ -54,7 +54,7 @@ def sync_detailed( Retrieve information about the provided **job ID**, such as status, payload, and result. Args: - job_id (str): Unique ID of the job you want to get. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -85,7 +85,7 @@ def sync( Retrieve information about the provided **job ID**, such as status, payload, and result. Args: - job_id (str): Unique ID of the job you want to get. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -111,7 +111,7 @@ async def asyncio_detailed( Retrieve information about the provided **job ID**, such as status, payload, and result. Args: - job_id (str): Unique ID of the job you want to get. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -140,7 +140,7 @@ async def asyncio( Retrieve information about the provided **job ID**, such as status, payload, and result. Args: - job_id (str): Unique ID of the job you want to get. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/get_job_circuit.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/get_job_circuit.py index b6bc989..4372891 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/get_job_circuit.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/get_job_circuit.py @@ -56,7 +56,7 @@ def sync_detailed( Retrieve the circuit of the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -87,7 +87,7 @@ def sync( Retrieve the circuit of the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,7 +113,7 @@ async def asyncio_detailed( Retrieve the circuit of the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,7 +142,7 @@ async def asyncio( Retrieve the circuit of the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/list_job_results.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/list_job_results.py index 47f72b6..ac33091 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/list_job_results.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/list_job_results.py @@ -85,11 +85,11 @@ def sync_detailed( Retrieve all intermediate and final results of a job. Args: - job_id (str): ID of the job. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListJobResultsOrderBy]): Sort order of the returned results. - Default: ListJobResultsOrderBy.CREATED_AT_DESC. + job_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListJobResultsOrderBy]): Default: + ListJobResultsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -128,11 +128,11 @@ def sync( Retrieve all intermediate and final results of a job. Args: - job_id (str): ID of the job. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListJobResultsOrderBy]): Sort order of the returned results. - Default: ListJobResultsOrderBy.CREATED_AT_DESC. + job_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListJobResultsOrderBy]): Default: + ListJobResultsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -166,11 +166,11 @@ async def asyncio_detailed( Retrieve all intermediate and final results of a job. Args: - job_id (str): ID of the job. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListJobResultsOrderBy]): Sort order of the returned results. - Default: ListJobResultsOrderBy.CREATED_AT_DESC. + job_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListJobResultsOrderBy]): Default: + ListJobResultsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,11 +207,11 @@ async def asyncio( Retrieve all intermediate and final results of a job. Args: - job_id (str): ID of the job. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListJobResultsOrderBy]): Sort order of the returned results. - Default: ListJobResultsOrderBy.CREATED_AT_DESC. + job_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListJobResultsOrderBy]): Default: + ListJobResultsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/update_job.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/update_job.py index 4cc995a..27a3b97 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/update_job.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/jobs/update_job.py @@ -65,7 +65,7 @@ def sync_detailed( Update job information about the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): body (UpdateJobBody): Raises: @@ -99,7 +99,7 @@ def sync( Update job information about the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): body (UpdateJobBody): Raises: @@ -128,7 +128,7 @@ async def asyncio_detailed( Update job information about the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): body (UpdateJobBody): Raises: @@ -160,7 +160,7 @@ async def asyncio( Update job information about the provided **job ID**. Args: - job_id (str): Unique ID of the job. + job_id (str): body (UpdateJobBody): Raises: diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/models/get_model.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/models/get_model.py index d8eaee0..453ea38 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/models/get_model.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/models/get_model.py @@ -54,7 +54,7 @@ def sync_detailed( Retrieve information about of the provided **model ID**. Args: - model_id (str): Unique ID of the model. + model_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -85,7 +85,7 @@ def sync( Retrieve information about of the provided **model ID**. Args: - model_id (str): Unique ID of the model. + model_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -111,7 +111,7 @@ async def asyncio_detailed( Retrieve information about of the provided **model ID**. Args: - model_id (str): Unique ID of the model. + model_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -140,7 +140,7 @@ async def asyncio( Retrieve information about of the provided **model ID**. Args: - model_id (str): Unique ID of the model. + model_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/models/list_models.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/models/list_models.py index 5bf9465..94c73ea 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/models/list_models.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/models/list_models.py @@ -81,11 +81,10 @@ def sync_detailed( Retrieve information about all models of the provided **project ID**. Args: - project_id (str): List models belonging to this project ID. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListModelsOrderBy]): Sort order of the returned results. Default: - ListModelsOrderBy.CREATED_AT_DESC. + project_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListModelsOrderBy]): Default: ListModelsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -122,11 +121,10 @@ def sync( Retrieve information about all models of the provided **project ID**. Args: - project_id (str): List models belonging to this project ID. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListModelsOrderBy]): Sort order of the returned results. Default: - ListModelsOrderBy.CREATED_AT_DESC. + project_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListModelsOrderBy]): Default: ListModelsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,11 +156,10 @@ async def asyncio_detailed( Retrieve information about all models of the provided **project ID**. Args: - project_id (str): List models belonging to this project ID. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListModelsOrderBy]): Sort order of the returned results. Default: - ListModelsOrderBy.CREATED_AT_DESC. + project_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListModelsOrderBy]): Default: ListModelsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,11 +194,10 @@ async def asyncio( Retrieve information about all models of the provided **project ID**. Args: - project_id (str): List models belonging to this project ID. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListModelsOrderBy]): Sort order of the returned results. Default: - ListModelsOrderBy.CREATED_AT_DESC. + project_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListModelsOrderBy]): Default: ListModelsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/platforms/get_platform.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/platforms/get_platform.py index 693ed41..ed8d908 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/platforms/get_platform.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/platforms/get_platform.py @@ -55,7 +55,7 @@ def sync_detailed( type. Args: - platform_id (str): Unique ID of the platform. + platform_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -87,7 +87,7 @@ def sync( type. Args: - platform_id (str): Unique ID of the platform. + platform_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,7 +114,7 @@ async def asyncio_detailed( type. Args: - platform_id (str): Unique ID of the platform. + platform_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,7 +144,7 @@ async def asyncio( type. Args: - platform_id (str): Unique ID of the platform. + platform_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/platforms/list_platforms.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/platforms/list_platforms.py index 04e2b7a..4716e2f 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/platforms/list_platforms.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/platforms/list_platforms.py @@ -117,17 +117,16 @@ def sync_detailed( Retrieve information about all platforms. Args: - provider_name (Union[Unset, str]): List platforms with this provider name. - backend_name (Union[Unset, str]): List platforms with this backend name. - name (Union[Unset, str]): List platforms with this name. - platform_type (Union[Unset, ListPlatformsPlatformType]): List platforms with this type. - Default: ListPlatformsPlatformType.UNKNOWN_TYPE. - platform_technology (Union[Unset, ListPlatformsPlatformTechnology]): List platforms with - this technology. Default: ListPlatformsPlatformTechnology.UNKNOWN_TECHNOLOGY. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of platforms to return per page. - order_by (Union[Unset, ListPlatformsOrderBy]): Sort order of the returned platforms. - Default: ListPlatformsOrderBy.NAME_ASC. + provider_name (Union[Unset, str]): + backend_name (Union[Unset, str]): + name (Union[Unset, str]): + platform_type (Union[Unset, ListPlatformsPlatformType]): Default: + ListPlatformsPlatformType.UNKNOWN_TYPE. + platform_technology (Union[Unset, ListPlatformsPlatformTechnology]): Default: + ListPlatformsPlatformTechnology.UNKNOWN_TECHNOLOGY. + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListPlatformsOrderBy]): Default: ListPlatformsOrderBy.NAME_ASC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -176,17 +175,16 @@ def sync( Retrieve information about all platforms. Args: - provider_name (Union[Unset, str]): List platforms with this provider name. - backend_name (Union[Unset, str]): List platforms with this backend name. - name (Union[Unset, str]): List platforms with this name. - platform_type (Union[Unset, ListPlatformsPlatformType]): List platforms with this type. - Default: ListPlatformsPlatformType.UNKNOWN_TYPE. - platform_technology (Union[Unset, ListPlatformsPlatformTechnology]): List platforms with - this technology. Default: ListPlatformsPlatformTechnology.UNKNOWN_TECHNOLOGY. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of platforms to return per page. - order_by (Union[Unset, ListPlatformsOrderBy]): Sort order of the returned platforms. - Default: ListPlatformsOrderBy.NAME_ASC. + provider_name (Union[Unset, str]): + backend_name (Union[Unset, str]): + name (Union[Unset, str]): + platform_type (Union[Unset, ListPlatformsPlatformType]): Default: + ListPlatformsPlatformType.UNKNOWN_TYPE. + platform_technology (Union[Unset, ListPlatformsPlatformTechnology]): Default: + ListPlatformsPlatformTechnology.UNKNOWN_TECHNOLOGY. + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListPlatformsOrderBy]): Default: ListPlatformsOrderBy.NAME_ASC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -230,17 +228,16 @@ async def asyncio_detailed( Retrieve information about all platforms. Args: - provider_name (Union[Unset, str]): List platforms with this provider name. - backend_name (Union[Unset, str]): List platforms with this backend name. - name (Union[Unset, str]): List platforms with this name. - platform_type (Union[Unset, ListPlatformsPlatformType]): List platforms with this type. - Default: ListPlatformsPlatformType.UNKNOWN_TYPE. - platform_technology (Union[Unset, ListPlatformsPlatformTechnology]): List platforms with - this technology. Default: ListPlatformsPlatformTechnology.UNKNOWN_TECHNOLOGY. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of platforms to return per page. - order_by (Union[Unset, ListPlatformsOrderBy]): Sort order of the returned platforms. - Default: ListPlatformsOrderBy.NAME_ASC. + provider_name (Union[Unset, str]): + backend_name (Union[Unset, str]): + name (Union[Unset, str]): + platform_type (Union[Unset, ListPlatformsPlatformType]): Default: + ListPlatformsPlatformType.UNKNOWN_TYPE. + platform_technology (Union[Unset, ListPlatformsPlatformTechnology]): Default: + ListPlatformsPlatformTechnology.UNKNOWN_TECHNOLOGY. + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListPlatformsOrderBy]): Default: ListPlatformsOrderBy.NAME_ASC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -287,17 +284,16 @@ async def asyncio( Retrieve information about all platforms. Args: - provider_name (Union[Unset, str]): List platforms with this provider name. - backend_name (Union[Unset, str]): List platforms with this backend name. - name (Union[Unset, str]): List platforms with this name. - platform_type (Union[Unset, ListPlatformsPlatformType]): List platforms with this type. - Default: ListPlatformsPlatformType.UNKNOWN_TYPE. - platform_technology (Union[Unset, ListPlatformsPlatformTechnology]): List platforms with - this technology. Default: ListPlatformsPlatformTechnology.UNKNOWN_TECHNOLOGY. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of platforms to return per page. - order_by (Union[Unset, ListPlatformsOrderBy]): Sort order of the returned platforms. - Default: ListPlatformsOrderBy.NAME_ASC. + provider_name (Union[Unset, str]): + backend_name (Union[Unset, str]): + name (Union[Unset, str]): + platform_type (Union[Unset, ListPlatformsPlatformType]): Default: + ListPlatformsPlatformType.UNKNOWN_TYPE. + platform_technology (Union[Unset, ListPlatformsPlatformTechnology]): Default: + ListPlatformsPlatformTechnology.UNKNOWN_TECHNOLOGY. + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListPlatformsOrderBy]): Default: ListPlatformsOrderBy.NAME_ASC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/cancel_process.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/cancel_process.py index 43d516a..2922f20 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/cancel_process.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/cancel_process.py @@ -65,7 +65,7 @@ def sync_detailed( Cancel a process by its unique ID. Intermediate results are still available. Args: - process_id (str): Unique ID of the process. + process_id (str): body (CancelProcessBody): Raises: @@ -99,7 +99,7 @@ def sync( Cancel a process by its unique ID. Intermediate results are still available. Args: - process_id (str): Unique ID of the process. + process_id (str): body (CancelProcessBody): Raises: @@ -128,7 +128,7 @@ async def asyncio_detailed( Cancel a process by its unique ID. Intermediate results are still available. Args: - process_id (str): Unique ID of the process. + process_id (str): body (CancelProcessBody): Raises: @@ -160,7 +160,7 @@ async def asyncio( Cancel a process by its unique ID. Intermediate results are still available. Args: - process_id (str): Unique ID of the process. + process_id (str): body (CancelProcessBody): Raises: diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/delete_process.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/delete_process.py index f9a5bf1..e1ecf3e 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/delete_process.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/delete_process.py @@ -51,7 +51,7 @@ def sync_detailed( Delete a process by its unique ID and delete all its data. Args: - process_id (str): Unique ID of the process. + process_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -82,7 +82,7 @@ async def asyncio_detailed( Delete a process by its unique ID and delete all its data. Args: - process_id (str): Unique ID of the process. + process_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/get_process.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/get_process.py index e8c2855..de610cd 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/get_process.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/get_process.py @@ -54,7 +54,7 @@ def sync_detailed( Retrieve information about the provided **process ID**, such as name, status and progress. Args: - process_id (str): Unique ID of the process. + process_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -85,7 +85,7 @@ def sync( Retrieve information about the provided **process ID**, such as name, status and progress. Args: - process_id (str): Unique ID of the process. + process_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -111,7 +111,7 @@ async def asyncio_detailed( Retrieve information about the provided **process ID**, such as name, status and progress. Args: - process_id (str): Unique ID of the process. + process_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -140,7 +140,7 @@ async def asyncio( Retrieve information about the provided **process ID**, such as name, status and progress. Args: - process_id (str): Unique ID of the process. + process_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/list_process_results.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/list_process_results.py index 2d0d8bb..a1073a2 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/list_process_results.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/list_process_results.py @@ -85,11 +85,11 @@ def sync_detailed( Retrieve all intermediate and final result of a process. Args: - process_id (str): ID of the process. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListProcessResultsOrderBy]): Sort order of the returned results. - Default: ListProcessResultsOrderBy.CREATED_AT_DESC. + process_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListProcessResultsOrderBy]): Default: + ListProcessResultsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -128,11 +128,11 @@ def sync( Retrieve all intermediate and final result of a process. Args: - process_id (str): ID of the process. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListProcessResultsOrderBy]): Sort order of the returned results. - Default: ListProcessResultsOrderBy.CREATED_AT_DESC. + process_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListProcessResultsOrderBy]): Default: + ListProcessResultsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -166,11 +166,11 @@ async def asyncio_detailed( Retrieve all intermediate and final result of a process. Args: - process_id (str): ID of the process. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListProcessResultsOrderBy]): Sort order of the returned results. - Default: ListProcessResultsOrderBy.CREATED_AT_DESC. + process_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListProcessResultsOrderBy]): Default: + ListProcessResultsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,11 +207,11 @@ async def asyncio( Retrieve all intermediate and final result of a process. Args: - process_id (str): ID of the process. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of results to return per page. - order_by (Union[Unset, ListProcessResultsOrderBy]): Sort order of the returned results. - Default: ListProcessResultsOrderBy.CREATED_AT_DESC. + process_id (str): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListProcessResultsOrderBy]): Default: + ListProcessResultsOrderBy.CREATED_AT_DESC. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/list_processes.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/list_processes.py index 34d3195..e14e970 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/list_processes.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/list_processes.py @@ -95,15 +95,13 @@ def sync_detailed( Retrieve information about all processes. Args: - application_id (Union[Unset, str]): List processes that have been created for this - application. - tags (Union[Unset, list[str]]): List processes with these tags. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of processes to return per page. - order_by (Union[Unset, ListProcessesOrderBy]): Sort order of the returned processes. - Default: ListProcessesOrderBy.CREATED_AT_DESC. - project_id (str): List processes belonging to this project ID. (UUID format) Example: - 6170692e-7363-616c-6577-61792e636f6d. + application_id (Union[Unset, str]): + tags (Union[Unset, list[str]]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListProcessesOrderBy]): Default: + ListProcessesOrderBy.CREATED_AT_DESC. + project_id (str): Example: 6170692e-7363-616c-6577-61792e636f6d. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,15 +142,13 @@ def sync( Retrieve information about all processes. Args: - application_id (Union[Unset, str]): List processes that have been created for this - application. - tags (Union[Unset, list[str]]): List processes with these tags. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of processes to return per page. - order_by (Union[Unset, ListProcessesOrderBy]): Sort order of the returned processes. - Default: ListProcessesOrderBy.CREATED_AT_DESC. - project_id (str): List processes belonging to this project ID. (UUID format) Example: - 6170692e-7363-616c-6577-61792e636f6d. + application_id (Union[Unset, str]): + tags (Union[Unset, list[str]]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListProcessesOrderBy]): Default: + ListProcessesOrderBy.CREATED_AT_DESC. + project_id (str): Example: 6170692e-7363-616c-6577-61792e636f6d. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,15 +184,13 @@ async def asyncio_detailed( Retrieve information about all processes. Args: - application_id (Union[Unset, str]): List processes that have been created for this - application. - tags (Union[Unset, list[str]]): List processes with these tags. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of processes to return per page. - order_by (Union[Unset, ListProcessesOrderBy]): Sort order of the returned processes. - Default: ListProcessesOrderBy.CREATED_AT_DESC. - project_id (str): List processes belonging to this project ID. (UUID format) Example: - 6170692e-7363-616c-6577-61792e636f6d. + application_id (Union[Unset, str]): + tags (Union[Unset, list[str]]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListProcessesOrderBy]): Default: + ListProcessesOrderBy.CREATED_AT_DESC. + project_id (str): Example: 6170692e-7363-616c-6577-61792e636f6d. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,15 +229,13 @@ async def asyncio( Retrieve information about all processes. Args: - application_id (Union[Unset, str]): List processes that have been created for this - application. - tags (Union[Unset, list[str]]): List processes with these tags. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of processes to return per page. - order_by (Union[Unset, ListProcessesOrderBy]): Sort order of the returned processes. - Default: ListProcessesOrderBy.CREATED_AT_DESC. - project_id (str): List processes belonging to this project ID. (UUID format) Example: - 6170692e-7363-616c-6577-61792e636f6d. + application_id (Union[Unset, str]): + tags (Union[Unset, list[str]]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListProcessesOrderBy]): Default: + ListProcessesOrderBy.CREATED_AT_DESC. + project_id (str): Example: 6170692e-7363-616c-6577-61792e636f6d. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/update_process.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/update_process.py index 0b96e92..75fa387 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/update_process.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/processes/update_process.py @@ -65,7 +65,7 @@ def sync_detailed( Update process information of the provided **process ID**. Args: - process_id (str): Unique ID of the process. + process_id (str): body (UpdateProcessBody): Raises: @@ -99,7 +99,7 @@ def sync( Update process information of the provided **process ID**. Args: - process_id (str): Unique ID of the process. + process_id (str): body (UpdateProcessBody): Raises: @@ -128,7 +128,7 @@ async def asyncio_detailed( Update process information of the provided **process ID**. Args: - process_id (str): Unique ID of the process. + process_id (str): body (UpdateProcessBody): Raises: @@ -160,7 +160,7 @@ async def asyncio( Update process information of the provided **process ID**. Args: - process_id (str): Unique ID of the process. + process_id (str): body (UpdateProcessBody): Raises: diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/delete_session.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/delete_session.py index ab481bc..ef5b445 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/delete_session.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/delete_session.py @@ -51,7 +51,7 @@ def sync_detailed( Delete a session by its unique ID and delete all its attached job and booking. Args: - session_id (str): Unique ID of the session. + session_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -82,7 +82,7 @@ async def asyncio_detailed( Delete a session by its unique ID and delete all its attached job and booking. Args: - session_id (str): Unique ID of the session. + session_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/get_session.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/get_session.py index 0843f70..37d079b 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/get_session.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/get_session.py @@ -55,7 +55,7 @@ def sync_detailed( jobs. Args: - session_id (str): Unique ID of the session. + session_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -87,7 +87,7 @@ def sync( jobs. Args: - session_id (str): Unique ID of the session. + session_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,7 +114,7 @@ async def asyncio_detailed( jobs. Args: - session_id (str): Unique ID of the session. + session_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,7 +144,7 @@ async def asyncio( jobs. Args: - session_id (str): Unique ID of the session. + session_id (str): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/list_sessions.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/list_sessions.py index 1ec02df..acaf20a 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/list_sessions.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/list_sessions.py @@ -95,14 +95,12 @@ def sync_detailed( Retrieve information about all sessions. Args: - platform_id (Union[Unset, str]): List sessions that have been created for this platform. - tags (Union[Unset, list[str]]): List sessions with these tags. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of sessions to return per page. - order_by (Union[Unset, ListSessionsOrderBy]): Sort order of the returned sessions. - Default: ListSessionsOrderBy.NAME_ASC. - project_id (str): List sessions belonging to this project ID. (UUID format) Example: - 6170692e-7363-616c-6577-61792e636f6d. + platform_id (Union[Unset, str]): + tags (Union[Unset, list[str]]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListSessionsOrderBy]): Default: ListSessionsOrderBy.NAME_ASC. + project_id (str): Example: 6170692e-7363-616c-6577-61792e636f6d. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,14 +141,12 @@ def sync( Retrieve information about all sessions. Args: - platform_id (Union[Unset, str]): List sessions that have been created for this platform. - tags (Union[Unset, list[str]]): List sessions with these tags. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of sessions to return per page. - order_by (Union[Unset, ListSessionsOrderBy]): Sort order of the returned sessions. - Default: ListSessionsOrderBy.NAME_ASC. - project_id (str): List sessions belonging to this project ID. (UUID format) Example: - 6170692e-7363-616c-6577-61792e636f6d. + platform_id (Union[Unset, str]): + tags (Union[Unset, list[str]]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListSessionsOrderBy]): Default: ListSessionsOrderBy.NAME_ASC. + project_id (str): Example: 6170692e-7363-616c-6577-61792e636f6d. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,14 +182,12 @@ async def asyncio_detailed( Retrieve information about all sessions. Args: - platform_id (Union[Unset, str]): List sessions that have been created for this platform. - tags (Union[Unset, list[str]]): List sessions with these tags. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of sessions to return per page. - order_by (Union[Unset, ListSessionsOrderBy]): Sort order of the returned sessions. - Default: ListSessionsOrderBy.NAME_ASC. - project_id (str): List sessions belonging to this project ID. (UUID format) Example: - 6170692e-7363-616c-6577-61792e636f6d. + platform_id (Union[Unset, str]): + tags (Union[Unset, list[str]]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListSessionsOrderBy]): Default: ListSessionsOrderBy.NAME_ASC. + project_id (str): Example: 6170692e-7363-616c-6577-61792e636f6d. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -232,14 +226,12 @@ async def asyncio( Retrieve information about all sessions. Args: - platform_id (Union[Unset, str]): List sessions that have been created for this platform. - tags (Union[Unset, list[str]]): List sessions with these tags. - page (Union[Unset, int]): Page number. - page_size (Union[Unset, int]): Maximum number of sessions to return per page. - order_by (Union[Unset, ListSessionsOrderBy]): Sort order of the returned sessions. - Default: ListSessionsOrderBy.NAME_ASC. - project_id (str): List sessions belonging to this project ID. (UUID format) Example: - 6170692e-7363-616c-6577-61792e636f6d. + platform_id (Union[Unset, str]): + tags (Union[Unset, list[str]]): + page (Union[Unset, int]): + page_size (Union[Unset, int]): + order_by (Union[Unset, ListSessionsOrderBy]): Default: ListSessionsOrderBy.NAME_ASC. + project_id (str): Example: 6170692e-7363-616c-6577-61792e636f6d. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/terminate_session.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/terminate_session.py index 3c0dddf..26c073b 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/terminate_session.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/terminate_session.py @@ -65,7 +65,7 @@ def sync_detailed( Terminate a session by its unique ID and cancel all its attached jobs and booking. Args: - session_id (str): Unique ID of the session. + session_id (str): body (TerminateSessionBody): Raises: @@ -99,7 +99,7 @@ def sync( Terminate a session by its unique ID and cancel all its attached jobs and booking. Args: - session_id (str): Unique ID of the session. + session_id (str): body (TerminateSessionBody): Raises: @@ -128,7 +128,7 @@ async def asyncio_detailed( Terminate a session by its unique ID and cancel all its attached jobs and booking. Args: - session_id (str): Unique ID of the session. + session_id (str): body (TerminateSessionBody): Raises: @@ -160,7 +160,7 @@ async def asyncio( Terminate a session by its unique ID and cancel all its attached jobs and booking. Args: - session_id (str): Unique ID of the session. + session_id (str): body (TerminateSessionBody): Raises: diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/update_session.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/update_session.py index 0de62b5..0f8b3f6 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/update_session.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/api/sessions/update_session.py @@ -65,7 +65,7 @@ def sync_detailed( Update session information of the provided **session ID**. Args: - session_id (str): Unique ID of the session. + session_id (str): body (UpdateSessionBody): Raises: @@ -99,7 +99,7 @@ def sync( Update session information of the provided **session ID**. Args: - session_id (str): Unique ID of the session. + session_id (str): body (UpdateSessionBody): Raises: @@ -128,7 +128,7 @@ async def asyncio_detailed( Update session information of the provided **session ID**. Args: - session_id (str): Unique ID of the session. + session_id (str): body (UpdateSessionBody): Raises: @@ -160,7 +160,7 @@ async def asyncio( Update session information of the provided **session ID**. Args: - session_id (str): Unique ID of the session. + session_id (str): body (UpdateSessionBody): Raises: diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/create_session_body_booking_demand.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/create_session_body_booking_demand.py index f3f9e0a..d3aaedc 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/create_session_body_booking_demand.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/create_session_body_booking_demand.py @@ -19,11 +19,13 @@ class CreateSessionBodyBookingDemand: started_at (Union[None, Unset, datetime.datetime]): (RFC 3339 format) Example: 2022-03-22T12:34:56.123456Z. finished_at (Union[None, Unset, datetime.datetime]): (RFC 3339 format) Example: 2022-03-22T12:34:56.123456Z. description (Union[None, Unset, str]): + time_zone (Union[None, Unset, str]): """ started_at: Union[None, Unset, datetime.datetime] = UNSET finished_at: Union[None, Unset, datetime.datetime] = UNSET description: Union[None, Unset, str] = UNSET + time_zone: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,6 +51,12 @@ def to_dict(self) -> dict[str, Any]: else: description = self.description + time_zone: Union[None, Unset, str] + if isinstance(self.time_zone, Unset): + time_zone = UNSET + else: + time_zone = self.time_zone + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -58,6 +66,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["finished_at"] = finished_at if description is not UNSET: field_dict["description"] = description + if time_zone is not UNSET: + field_dict["time_zone"] = time_zone return field_dict @@ -108,10 +118,20 @@ def _parse_description(data: object) -> Union[None, Unset, str]: description = _parse_description(d.pop("description", UNSET)) + def _parse_time_zone(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) + create_session_body_booking_demand = cls( started_at=started_at, finished_at=finished_at, description=description, + time_zone=time_zone, ) create_session_body_booking_demand.additional_properties = d diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/scaleway_qaas_v1_alpha_1_booking.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/scaleway_qaas_v1_alpha_1_booking.py index 3931a20..3f340fd 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/scaleway_qaas_v1_alpha_1_booking.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/scaleway_qaas_v1_alpha_1_booking.py @@ -31,6 +31,8 @@ class ScalewayQaasV1Alpha1Booking: ScalewayQaasV1Alpha1BookingStatus.UNKNOWN_STATUS. description (Union[Unset, str]): Description of the booking slot. progress_message (Union[Unset, str]): Any progress message of the booking. + time_zone (Union[None, Unset, str]): Time zone for the booking schedule, in tz database format (e.g. + 'Europe/Paris'). """ id: Union[Unset, str] = UNSET @@ -43,6 +45,7 @@ class ScalewayQaasV1Alpha1Booking: ) description: Union[Unset, str] = UNSET progress_message: Union[Unset, str] = UNSET + time_zone: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -88,6 +91,12 @@ def to_dict(self) -> dict[str, Any]: progress_message = self.progress_message + time_zone: Union[None, Unset, str] + if isinstance(self.time_zone, Unset): + time_zone = UNSET + else: + time_zone = self.time_zone + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -107,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if progress_message is not UNSET: field_dict["progress_message"] = progress_message + if time_zone is not UNSET: + field_dict["time_zone"] = time_zone return field_dict @@ -194,6 +205,15 @@ def _parse_finished_at(data: object) -> Union[None, Unset, datetime.datetime]: progress_message = d.pop("progress_message", UNSET) + def _parse_time_zone(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) + scaleway_qaas_v1_alpha_1_booking = cls( id=id, created_at=created_at, @@ -203,6 +223,7 @@ def _parse_finished_at(data: object) -> Union[None, Unset, datetime.datetime]: status=status, description=description, progress_message=progress_message, + time_zone=time_zone, ) scaleway_qaas_v1_alpha_1_booking.additional_properties = d diff --git a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/scaleway_qaas_v1_alpha_1_platform_booking_requirement.py b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/scaleway_qaas_v1_alpha_1_platform_booking_requirement.py index c38d639..625033e 100644 --- a/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/scaleway_qaas_v1_alpha_1_platform_booking_requirement.py +++ b/scaleway_qaas_client/v1alpha1/quantum_as_a_service_api_client/models/scaleway_qaas_v1_alpha_1_platform_booking_requirement.py @@ -22,12 +22,19 @@ class ScalewayQaasV1Alpha1PlatformBookingRequirement: before the beginning of the session. (in seconds) Example: 2.5s. max_planification_duration (Union[None, Unset, str]): Allowed planification time from now where the platform can be booked in the future. (in seconds) Example: 2.5s. + min_planification_duration (Union[None, Unset, str]): Minimum planification time before a platform can be + booked. (in seconds) Example: 2.5s. + max_booking_per_week (Union[Unset, int]): Maximum amount of booking allowed for one organization per week. + max_booking_per_day (Union[Unset, int]): Maximum amount of booking allowed for one organization per day. """ min_duration: Union[None, Unset, str] = UNSET max_duration: Union[None, Unset, str] = UNSET max_cancellation_duration: Union[None, Unset, str] = UNSET max_planification_duration: Union[None, Unset, str] = UNSET + min_planification_duration: Union[None, Unset, str] = UNSET + max_booking_per_week: Union[Unset, int] = UNSET + max_booking_per_day: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,6 +62,16 @@ def to_dict(self) -> dict[str, Any]: else: max_planification_duration = self.max_planification_duration + min_planification_duration: Union[None, Unset, str] + if isinstance(self.min_planification_duration, Unset): + min_planification_duration = UNSET + else: + min_planification_duration = self.min_planification_duration + + max_booking_per_week = self.max_booking_per_week + + max_booking_per_day = self.max_booking_per_day + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -66,6 +83,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["max_cancellation_duration"] = max_cancellation_duration if max_planification_duration is not UNSET: field_dict["max_planification_duration"] = max_planification_duration + if min_planification_duration is not UNSET: + field_dict["min_planification_duration"] = min_planification_duration + if max_booking_per_week is not UNSET: + field_dict["max_booking_per_week"] = max_booking_per_week + if max_booking_per_day is not UNSET: + field_dict["max_booking_per_day"] = max_booking_per_day return field_dict @@ -113,11 +136,29 @@ def _parse_max_planification_duration(data: object) -> Union[None, Unset, str]: d.pop("max_planification_duration", UNSET) ) + def _parse_min_planification_duration(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + min_planification_duration = _parse_min_planification_duration( + d.pop("min_planification_duration", UNSET) + ) + + max_booking_per_week = d.pop("max_booking_per_week", UNSET) + + max_booking_per_day = d.pop("max_booking_per_day", UNSET) + scaleway_qaas_v1_alpha_1_platform_booking_requirement = cls( min_duration=min_duration, max_duration=max_duration, max_cancellation_duration=max_cancellation_duration, max_planification_duration=max_planification_duration, + min_planification_duration=min_planification_duration, + max_booking_per_week=max_booking_per_week, + max_booking_per_day=max_booking_per_day, ) scaleway_qaas_v1_alpha_1_platform_booking_requirement.additional_properties = d diff --git a/tests/requirements.txt b/tests/requirements.txt index 5b61bc2..883fcfb 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,5 @@ pytest pytest-dependency pytest-progress -pytest-httpx \ No newline at end of file +pytest-httpx +pytz \ No newline at end of file diff --git a/tests/test_api.py b/tests/test_api.py index 4c4e73a..848f443 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -19,7 +19,6 @@ _RANDOM_UUID = str(uuid.uuid4()) _TEST_PLATFORM_NAME = os.environ.get("TEST_PLATFORM_NAME", "aer_simulation_pop_c16m128") -_TEST_APPLICATION_NAME = os.environ.get("TEST_APPLICATION_NAME", "H2 VQE") def _get_client() -> QaaSClient: @@ -152,6 +151,23 @@ def test_create_delete_session(): client.delete_session(session.id) +def test_list_platform_bookings(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert platforms is not None + assert len(platforms) == 1 + + target_platform = platforms[0] + + assert target_platform.id is not None + + bookings = client.list_platform_bookings(target_platform.id) + + assert len(bookings) > 0 + + def test_create_session_same_deduplication_id(): client = _get_client() @@ -195,62 +211,3 @@ def test_create_session_same_deduplication_id(): assert second_session.deduplication_id == session.deduplication_id finally: client.delete_session(session.id) - - -def test_run_process(): - client = _get_client() - - process_inputs = { - "Custom VQE": '{ "max_iterations": 1, "hamiltonian_strings" : ["XIIX", "ZZYY", "ZXYY", "ZZZZ"], "hamiltonian_weights" : [ -0.5, 1, 2.44, 5 ] }', - "CVar VQE": '{ "max_iterations": 3, "qubo_matrix" : [ [ 31, -500 ], [ -500, 32 ] ] }', - "Chemistry VQE": '{"max_iterations": 1, "geometry": [ {"coordinates": [ 0, 0, 0 ], "element": "Li" }, { "coordinates": [ 0, 0, 0.7414 ], "element": "H" }]}', - "H2 VQE": '{"max_iterations": 2, "geometry": [ {"coordinates": [ 0, 0, 0 ], "element": "H" }, { "coordinates": [ 0, 0, 0.7414 ], "element": "H" }]}', - "Graph Isomorphism": '{ "graph_a" : [ [ 0, 1 ], [ 1, 2 ], [2, 3], [2, 4], [3, 4] ], "graph_b" : [ [ 0, 1 ], [ 1, 2 ], [2, 3], [2, 4], [3, 4] ], "epsilon" : 10, "error" : 0.1, "algo" : "Laplacian PP", "max_iterations" : 3, "nb_samples" : 1000, "nb_samples_min_accepted" : 10}', - "Graph DSI": '{ "graph" : [ [ 0, 1 ], [ 1, 2 ], [2, 3], [2, 4], [3, 4] ], "max_iterations" : 10, "nb_samples" : 10000, "size_subgraph" : 3, "seed" : [ 0 ], "nb_samples_min_accepted" : 1000}', - } - - platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) - - assert len(platforms) > 0 - - platform = platforms[0] - - if platform.provider_name != "quandela": - print("SKIP RUN PROCESS : ONLY QUANDELA PLATFORMS CAN RUN PROCESS") - return - - assert _TEST_APPLICATION_NAME in process_inputs - - applications = client.list_applications(name=_TEST_APPLICATION_NAME) - - assert len(applications) > 0 - - application = applications[0] - - process = client.create_process( - platform_id=platform.id, - application_id=application.id, - input=process_inputs[_TEST_APPLICATION_NAME], - ) - - assert process.platform_id == platform.id - assert process.application_id == application.id - assert process.status == "starting" - - assert process.input_ == process_inputs[_TEST_APPLICATION_NAME] - assert process.progress_message == "" - assert process.tags == [] - - while True: - time.sleep(3) - process = client.get_process(process.id) - assert process.status in [ - "starting", - "running", - "completed", - ] - print(process.progress, process.progress_message) - if process.status == "completed": - results = client.list_process_results(process.id) - assert len(results) > 0 - break diff --git a/tests/test_booking.py b/tests/test_booking.py new file mode 100644 index 0000000..391d8cf --- /dev/null +++ b/tests/test_booking.py @@ -0,0 +1,432 @@ +# Copyright 2025 Scaleway +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import os +import time +import pytz + +from datetime import datetime, timedelta, timezone + +from scaleway_qaas_client.v1alpha1 import QaaSClient + +_TEST_PLATFORM_NAME = os.environ.get("TEST_PLATFORM_NAME", "aer_simulation_pop_c16m128") + + +def _get_now_utc() -> datetime: + return datetime.now(timezone.utc) + + +def _get_now_paris() -> datetime: + return datetime.now(pytz.timezone("Europe/Paris")) + + +def _get_client() -> QaaSClient: + client = QaaSClient( + project_id=os.environ["SCALEWAY_PROJECT_ID"], + secret_key=os.environ["SCALEWAY_SECRET_KEY"], + url=os.environ["SCALEWAY_API_URL"], + ) + + return client + + +def test_create_and_cancel_booking(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + try: + now = _get_now_paris() + booking_start = now + timedelta(seconds=16) + booking_finish = booking_start + timedelta(seconds=20) + booking_description = "my lovely booking" + + session = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + + assert session is not None + assert session.id is not None + assert session.platform_id == target_platform.id + assert session.booking_id is not None + + booking = client.get_booking(booking_id=session.booking_id) + + assert booking is not None + assert booking.id is not None + assert booking.description == booking_description + assert booking.started_at is not None + assert booking.finished_at is not None + assert booking.status in ["validated", "waiting", "validating"] + + while True: + time.sleep(2) + session = client.get_session(session_id=session.id) + booking = client.get_booking(booking_id=session.booking_id) + + assert session.status in ["starting", "running"] + assert booking.status in ["waiting", "validating", "validated"] + + if booking.status == "validated": + break + + finally: + client.delete_session(session.id) + + while True: + time.sleep(2) + booking = client.get_booking(booking_id=session.booking_id) + + assert booking.status in ["validated", "cancelling", "cancelled"] + + if booking.status == "cancelled": + break + + +def test_create_overlaping_booking(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + now = _get_now_paris() + booking_start = now + timedelta(days=1) + booking_finish = booking_start + timedelta(hours=1) + booking_description = "my overlaping booking" + + try: + session = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + + assert session == None + except Exception as e: + assert "existing booking" in str(e) + + +def test_create_too_long_booking(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + now = _get_now_paris() + booking_start = now + timedelta(minutes=1) + booking_finish = booking_start + timedelta(hours=10) + booking_description = "my too long booking" + + try: + _ = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + except Exception as e: + assert "max_duration not respected" in str(e) + + +def test_create_too_short_booking(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + now = _get_now_paris() + booking_start = now + timedelta(minutes=1) + booking_finish = booking_start + timedelta(seconds=10) + booking_description = "my lovely booking" + + try: + _ = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + except Exception as e: + assert "min_duration not respected" in str(e) + + +def test_create_too_far_booking(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + now = _get_now_paris() + booking_start = now + timedelta(days=30) + booking_finish = booking_start + timedelta(hours=2) + booking_description = "my lovely booking" + + try: + _ = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + except Exception as e: + assert "max_planification_duration not respected" in str(e) + + +def test_create_too_close_booking(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + now = _get_now_paris() + booking_start = now + timedelta(seconds=10) + booking_finish = booking_start + timedelta(hours=2) + booking_description = "my lovely booking" + + try: + _ = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + except Exception as e: + assert "min_planification_duration not respected" in str(e) + + +def test_stop_too_close_booking(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + now = _get_now_paris() + booking_start = now + timedelta(seconds=20) + booking_finish = booking_start + timedelta(seconds=30) + booking_description = "my lovely booking" + + try: + session = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + + time.sleep(15) + + session = client.terminate_session(session.id) + + while True: + session = client.get_session(session.id) + + assert session.status in ["starting", "running"] + + if session.status == "running": + break + + except Exception as e: + assert "max_cancellation_time passed" in str(e) + + while True: + session = client.get_session(session.id) + + assert session.status in ["starting", "running", "stopped"] + + if session.status == "stopped": + break + + +def test_cannot_start_not_booked_session_during_booked_session_is_running(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + now = _get_now_paris() + booking_start = now + timedelta(seconds=20) + booking_finish = booking_start + timedelta(seconds=20) + booking_description = "my booking" + + booked_session = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + + while True: + time.sleep(2) + booked_session = client.get_session(session_id=booked_session.id) + + assert booked_session.status in ["starting", "running"] + + if booked_session.status == "running": + break + + not_booked_session = client.create_session( + platform_id=target_platform.id, + ) + + while True: + time.sleep(2) + not_booked_session = client.get_session(session_id=not_booked_session.id) + booked_session = client.get_session(session_id=booked_session.id) + + assert ( + not_booked_session.status == "starting" + if booked_session.status == "running" + else "running" + ) + assert booked_session.status in ["running", "stopping", "stopped"] + + if booked_session.status == "stopped": + break + + while True: + time.sleep(2) + not_booked_session = client.get_session(session_id=not_booked_session.id) + + assert not_booked_session.status in ["starting", "running"] + + if not_booked_session.status == "running": + break + + client.delete_session(not_booked_session.id) + + +def test_not_booked_session_is_killed_when_booked_session_starts(): + client = _get_client() + + platforms = client.list_platforms(name=_TEST_PLATFORM_NAME) + + assert len(platforms) > 0 + + target_platform = platforms[0] + + try: + not_booked_session_1 = client.create_session( + platform_id=target_platform.id, + ) + + assert not_booked_session_1 + + not_booked_session_2 = client.create_session( + platform_id=target_platform.id, + ) + + assert not_booked_session_2 + + now = _get_now_paris() + booking_start = now + timedelta(seconds=20) + booking_finish = booking_start + timedelta(seconds=20) + booking_description = "my booking" + + booked_session = client.create_session( + platform_id=target_platform.id, + booking_demand_started_at=booking_start, + booking_demand_finished_at=booking_finish, + booking_demand_description=booking_description, + ) + + while True: + time.sleep(2) + + not_booked_session_1 = client.get_session( + session_id=not_booked_session_1.id + ) + not_booked_session_2 = client.get_session( + session_id=not_booked_session_2.id + ) + booked_session = client.get_session(session_id=booked_session.id) + + assert not_booked_session_1.status in ["starting", "running"] + assert not_booked_session_2.status in ["starting", "running"] + assert booked_session.status in ["starting"] + + if ( + not_booked_session_1.status == "running" + and not_booked_session_2.status == "running" + ): + break + + while True: + time.sleep(2) + + booked_session = client.get_session(session_id=booked_session.id) + + assert booked_session.status in ["starting", "running"] + + if booked_session.status == "running": + break + + while True: + time.sleep(2) + + not_booked_session_1 = client.get_session( + session_id=not_booked_session_1.id + ) + not_booked_session_2 = client.get_session( + session_id=not_booked_session_2.id + ) + + assert not_booked_session_1.status in ["running", "stopping", "stopped"] + assert not_booked_session_2.status in ["running", "stopping", "stopped"] + + if ( + not_booked_session_1.status == "stopped" + and not_booked_session_2.status == "stopped" + ): + break + + while True: + booked_session = client.get_session(booked_session.id) + + assert booked_session.status in ["running", "stopped"] + + if booked_session.status == "stopped": + break + + finally: + client.delete_session(not_booked_session_1.id) + client.delete_session(not_booked_session_2.id) + client.delete_session(booked_session.id)