diff --git a/examples/iaas/example_setup.py b/examples/iaas/example_setup.py index 9499d6f9..6fa6adca 100644 --- a/examples/iaas/example_setup.py +++ b/examples/iaas/example_setup.py @@ -11,7 +11,7 @@ from stackit.iaas.models.boot_volume import BootVolume from stackit.iaas.models.allowed_addresses_inner import AllowedAddressesInner from stackit.iaas.models.boot_volume_source import BootVolumeSource -from stackit.iaas.models.create_nic_payload import CreateNICPayload +from stackit.iaas.models.create_nic_payload import CreateNicPayload from stackit.iaas.models.create_public_ip_payload import CreatePublicIPPayload from stackit.iaas.models.create_security_group_payload import CreateSecurityGroupPayload from stackit.iaas.models.create_server_payload import CreateServerPayload @@ -81,7 +81,7 @@ nic1 = client.create_nic( project_id, network.network_id, - CreateNICPayload( + CreateNicPayload( allowed_addresses=[AllowedAddressesInner("192.0.2.0/24")], security_groups=[security_group1_groupid], ), diff --git a/services/iaas/src/stackit/iaas/__init__.py b/services/iaas/src/stackit/iaas/__init__.py index 79819f0a..638947b9 100644 --- a/services/iaas/src/stackit/iaas/__init__.py +++ b/services/iaas/src/stackit/iaas/__init__.py @@ -44,6 +44,7 @@ from stackit.iaas.models.boot_volume_source import BootVolumeSource from stackit.iaas.models.create_area_address_family import CreateAreaAddressFamily from stackit.iaas.models.create_area_ipv4 import CreateAreaIPv4 +from stackit.iaas.models.create_key_pair_payload import CreateKeyPairPayload from stackit.iaas.models.create_network_address_family import CreateNetworkAddressFamily from stackit.iaas.models.create_network_area_payload import CreateNetworkAreaPayload from stackit.iaas.models.create_network_area_range_payload import ( @@ -55,7 +56,7 @@ from stackit.iaas.models.create_network_ipv4_body import CreateNetworkIPv4Body from stackit.iaas.models.create_network_ipv6_body import CreateNetworkIPv6Body from stackit.iaas.models.create_network_payload import CreateNetworkPayload -from stackit.iaas.models.create_nic_payload import CreateNICPayload +from stackit.iaas.models.create_nic_payload import CreateNicPayload from stackit.iaas.models.create_protocol import CreateProtocol from stackit.iaas.models.create_public_ip_payload import CreatePublicIPPayload from stackit.iaas.models.create_security_group_payload import CreateSecurityGroupPayload @@ -78,6 +79,10 @@ from stackit.iaas.models.get_server_log200_response import GetServerLog200Response from stackit.iaas.models.get_server_log_request import GetServerLogRequest from stackit.iaas.models.icmp_parameters import ICMPParameters +from stackit.iaas.models.key_pair_list_response import KeyPairListResponse +from stackit.iaas.models.keypair import Keypair +from stackit.iaas.models.machine_type import MachineType +from stackit.iaas.models.machine_type_list_response import MachineTypeListResponse from stackit.iaas.models.network import Network from stackit.iaas.models.network_area import NetworkArea from stackit.iaas.models.network_area_ipv4 import NetworkAreaIPv4 @@ -125,13 +130,14 @@ from stackit.iaas.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaas.models.update_key_pair_payload import UpdateKeyPairPayload from stackit.iaas.models.update_network_address_family import UpdateNetworkAddressFamily from stackit.iaas.models.update_network_area_route_payload import ( UpdateNetworkAreaRoutePayload, ) from stackit.iaas.models.update_network_ipv4_body import UpdateNetworkIPv4Body from stackit.iaas.models.update_network_ipv6_body import UpdateNetworkIPv6Body -from stackit.iaas.models.update_nic_payload import UpdateNICPayload +from stackit.iaas.models.update_nic_payload import UpdateNicPayload from stackit.iaas.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaas.models.update_security_group_payload import UpdateSecurityGroupPayload from stackit.iaas.models.update_server_payload import UpdateServerPayload @@ -142,4 +148,8 @@ VolumeAttachmentListResponse, ) from stackit.iaas.models.volume_list_response import VolumeListResponse +from stackit.iaas.models.volume_performance_class import VolumePerformanceClass +from stackit.iaas.models.volume_performance_class_list_response import ( + VolumePerformanceClassListResponse, +) from stackit.iaas.models.volume_source import VolumeSource diff --git a/services/iaas/src/stackit/iaas/api/default_api.py b/services/iaas/src/stackit/iaas/api/default_api.py index e2d88d1a..9aa38e94 100644 --- a/services/iaas/src/stackit/iaas/api/default_api.py +++ b/services/iaas/src/stackit/iaas/api/default_api.py @@ -28,6 +28,7 @@ from stackit.iaas.api_client import ApiClient, RequestSerialized from stackit.iaas.api_response import ApiResponse from stackit.iaas.models.add_volume_to_server_payload import AddVolumeToServerPayload +from stackit.iaas.models.create_key_pair_payload import CreateKeyPairPayload from stackit.iaas.models.create_network_area_payload import CreateNetworkAreaPayload from stackit.iaas.models.create_network_area_range_payload import ( CreateNetworkAreaRangePayload, @@ -36,7 +37,7 @@ CreateNetworkAreaRoutePayload, ) from stackit.iaas.models.create_network_payload import CreateNetworkPayload -from stackit.iaas.models.create_nic_payload import CreateNICPayload +from stackit.iaas.models.create_nic_payload import CreateNicPayload from stackit.iaas.models.create_public_ip_payload import CreatePublicIPPayload from stackit.iaas.models.create_security_group_payload import CreateSecurityGroupPayload from stackit.iaas.models.create_security_group_rule_payload import ( @@ -46,6 +47,10 @@ from stackit.iaas.models.create_volume_payload import CreateVolumePayload from stackit.iaas.models.get_server_log200_response import GetServerLog200Response from stackit.iaas.models.get_server_log_request import GetServerLogRequest +from stackit.iaas.models.key_pair_list_response import KeyPairListResponse +from stackit.iaas.models.keypair import Keypair +from stackit.iaas.models.machine_type import MachineType +from stackit.iaas.models.machine_type_list_response import MachineTypeListResponse from stackit.iaas.models.network import Network from stackit.iaas.models.network_area import NetworkArea from stackit.iaas.models.network_area_list_response import NetworkAreaListResponse @@ -84,10 +89,11 @@ from stackit.iaas.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaas.models.update_key_pair_payload import UpdateKeyPairPayload from stackit.iaas.models.update_network_area_route_payload import ( UpdateNetworkAreaRoutePayload, ) -from stackit.iaas.models.update_nic_payload import UpdateNICPayload +from stackit.iaas.models.update_nic_payload import UpdateNicPayload from stackit.iaas.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaas.models.update_security_group_payload import UpdateSecurityGroupPayload from stackit.iaas.models.update_server_payload import UpdateServerPayload @@ -98,6 +104,10 @@ VolumeAttachmentListResponse, ) from stackit.iaas.models.volume_list_response import VolumeListResponse +from stackit.iaas.models.volume_performance_class import VolumePerformanceClass +from stackit.iaas.models.volume_performance_class_list_response import ( + VolumePerformanceClassListResponse, +) from stackit.iaas.rest import RESTResponseType @@ -1955,6 +1965,258 @@ def _add_volume_to_server_serialize( _request_auth=_request_auth, ) + @validate_call + def create_key_pair( + self, + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Keypair: + """Import a public key. + + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + + :param create_key_pair_payload: Request a public key import. (required) + :type create_key_pair_payload: CreateKeyPairPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._create_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Keypair", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "409": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def create_key_pair_with_http_info( + self, + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Keypair]: + """Import a public key. + + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + + :param create_key_pair_payload: Request a public key import. (required) + :type create_key_pair_payload: CreateKeyPairPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._create_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Keypair", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "409": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def create_key_pair_without_preload_content( + self, + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Import a public key. + + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + + :param create_key_pair_payload: Request a public key import. (required) + :type create_key_pair_payload: CreateKeyPairPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._create_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Keypair", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "409": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_key_pair_serialize( + self, + create_key_pair_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_key_pair_payload is not None: + _body_params = create_key_pair_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1beta1/keypairs", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def create_network( self, @@ -3163,7 +3425,7 @@ def create_nic( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - create_nic_payload: Annotated[CreateNICPayload, Field(description="Request a network interface creation.")], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3183,7 +3445,7 @@ def create_nic( :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str :param create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNICPayload + :type create_nic_payload: CreateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3244,7 +3506,7 @@ def create_nic_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - create_nic_payload: Annotated[CreateNICPayload, Field(description="Request a network interface creation.")], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3264,7 +3526,7 @@ def create_nic_with_http_info( :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str :param create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNICPayload + :type create_nic_payload: CreateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3325,7 +3587,7 @@ def create_nic_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - create_nic_payload: Annotated[CreateNICPayload, Field(description="Request a network interface creation.")], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3345,7 +3607,7 @@ def create_nic_without_preload_content( :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str :param create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNICPayload + :type create_nic_payload: CreateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5152,16 +5414,9 @@ def _deallocate_server_serialize( ) @validate_call - def delete_network( + def delete_key_pair( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5172,14 +5427,12 @@ def delete_network( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete network. + """Delete an SSH keypair. - Delete a network. If the network is still in use, the deletion will fail. + Delete an SSH keypair from a user. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5202,9 +5455,8 @@ def delete_network( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_serialize( - project_id=project_id, - network_id=network_id, + _param = self._delete_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5212,12 +5464,11 @@ def delete_network( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "204": None, "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5228,16 +5479,9 @@ def delete_network( ).data @validate_call - def delete_network_with_http_info( + def delete_key_pair_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5248,14 +5492,12 @@ def delete_network_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete network. + """Delete an SSH keypair. - Delete a network. If the network is still in use, the deletion will fail. + Delete an SSH keypair from a user. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5278,7 +5520,268 @@ def delete_network_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_serialize( + _param = self._delete_key_pair_serialize( + keypair_name=keypair_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_key_pair_without_preload_content( + self, + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an SSH keypair. + + Delete an SSH keypair from a user. + + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._delete_key_pair_serialize( + keypair_name=keypair_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_key_pair_serialize( + self, + keypair_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if keypair_name is not None: + _path_params["keypairName"] = keypair_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1beta1/keypairs/{keypairName}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_network( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete network. + + Delete a network. If the network is still in use, the deletion will fail. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._delete_network_serialize( + project_id=project_id, + network_id=network_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": None, + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "409": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_network_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete network. + + Delete a network. If the network is still in use, the deletion will fail. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._delete_network_serialize( project_id=project_id, network_id=network_id, _request_auth=_request_auth, @@ -8382,16 +8885,9 @@ def _get_attached_volume_serialize( ) @validate_call - def get_network( + def get_key_pair( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8401,15 +8897,13 @@ def get_network( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Network: - """Get network details. + ) -> Keypair: + """Get SSH keypair details. - Get details about a network of a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8432,9 +8926,8 @@ def get_network( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8442,7 +8935,7 @@ def get_network( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -8457,16 +8950,9 @@ def get_network( ).data @validate_call - def get_network_with_http_info( + def get_key_pair_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8476,15 +8962,13 @@ def get_network_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Network]: - """Get network details. + ) -> ApiResponse[Keypair]: + """Get SSH keypair details. - Get details about a network of a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8507,9 +8991,8 @@ def get_network_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8517,7 +9000,7 @@ def get_network_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -8532,16 +9015,9 @@ def get_network_with_http_info( ) @validate_call - def get_network_without_preload_content( + def get_key_pair_without_preload_content( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8552,14 +9028,12 @@ def get_network_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get network details. + """Get SSH keypair details. - Get details about a network of a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8582,9 +9056,8 @@ def get_network_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8592,7 +9065,7 @@ def get_network_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -8602,10 +9075,9 @@ def get_network_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_network_serialize( + def _get_key_pair_serialize( self, - project_id, - network_id, + keypair_name, _request_auth, _content_type, _headers, @@ -8624,10 +9096,8 @@ def _get_network_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id + if keypair_name is not None: + _path_params["keypairName"] = keypair_name # process the query parameters # process the header parameters # process the form parameters @@ -8642,7 +9112,7 @@ def _get_network_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}", + resource_path="/v1beta1/keypairs/{keypairName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8656,20 +9126,13 @@ def _get_network_serialize( ) @validate_call - def get_network_area( + def get_machine_type( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8679,15 +9142,15 @@ def get_network_area( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkArea: - """Get details about a network area. + ) -> MachineType: + """Get details about a machine type. - Get details about a network area in an organization. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8710,9 +9173,9 @@ def get_network_area( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8720,7 +9183,7 @@ def get_network_area( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -8735,20 +9198,13 @@ def get_network_area( ).data @validate_call - def get_network_area_with_http_info( + def get_machine_type_with_http_info( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8758,15 +9214,15 @@ def get_network_area_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NetworkArea]: - """Get details about a network area. + ) -> ApiResponse[MachineType]: + """Get details about a machine type. - Get details about a network area in an organization. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8789,9 +9245,9 @@ def get_network_area_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8799,7 +9255,7 @@ def get_network_area_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -8814,20 +9270,13 @@ def get_network_area_with_http_info( ) @validate_call - def get_network_area_without_preload_content( + def get_machine_type_without_preload_content( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8838,14 +9287,14 @@ def get_network_area_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a network area. + """Get details about a machine type. - Get details about a network area in an organization. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8868,9 +9317,9 @@ def get_network_area_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8878,7 +9327,7 @@ def get_network_area_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -8888,10 +9337,10 @@ def get_network_area_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_network_area_serialize( + def _get_machine_type_serialize( self, - organization_id, - area_id, + project_id, + machine_type, _request_auth, _content_type, _headers, @@ -8910,10 +9359,10 @@ def _get_network_area_serialize( _body_params: Optional[bytes] = None # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id + if project_id is not None: + _path_params["projectId"] = project_id + if machine_type is not None: + _path_params["machineType"] = machine_type # process the query parameters # process the header parameters # process the form parameters @@ -8928,7 +9377,7 @@ def _get_network_area_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}", + resource_path="/v1beta1/projects/{projectId}/machine-types/{machineType}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8942,25 +9391,15 @@ def _get_network_area_serialize( ) @validate_call - def get_network_area_range( + def get_network( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_range_id: Annotated[ + network_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], _request_timeout: Union[ None, @@ -8971,17 +9410,15 @@ def get_network_area_range( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkRange: - """Get details about a network range. + ) -> Network: + """Get network details. - Get details about a network range in a network area. + Get details about a network of a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9004,10 +9441,9 @@ def get_network_area_range( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + _param = self._get_network_serialize( + project_id=project_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9015,7 +9451,7 @@ def get_network_area_range( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRange", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -9030,25 +9466,15 @@ def get_network_area_range( ).data @validate_call - def get_network_area_range_with_http_info( + def get_network_with_http_info( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_range_id: Annotated[ + network_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], _request_timeout: Union[ None, @@ -9059,17 +9485,15 @@ def get_network_area_range_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NetworkRange]: - """Get details about a network range. + ) -> ApiResponse[Network]: + """Get network details. - Get details about a network range in a network area. + Get details about a network of a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9092,10 +9516,9 @@ def get_network_area_range_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + _param = self._get_network_serialize( + project_id=project_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9103,7 +9526,7 @@ def get_network_area_range_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRange", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -9118,25 +9541,15 @@ def get_network_area_range_with_http_info( ) @validate_call - def get_network_area_range_without_preload_content( + def get_network_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + network_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - network_range_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], _request_timeout: Union[ None, @@ -9148,16 +9561,14 @@ def get_network_area_range_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a network range. + """Get network details. - Get details about a network range in a network area. + Get details about a network of a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9180,10 +9591,9 @@ def get_network_area_range_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + _param = self._get_network_serialize( + project_id=project_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9191,7 +9601,7 @@ def get_network_area_range_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRange", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -9201,11 +9611,10 @@ def get_network_area_range_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_network_area_range_serialize( + def _get_network_serialize( self, - organization_id, - area_id, - network_range_id, + project_id, + network_id, _request_auth, _content_type, _headers, @@ -9224,12 +9633,10 @@ def _get_network_area_range_serialize( _body_params: Optional[bytes] = None # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id - if network_range_id is not None: - _path_params["networkRangeId"] = network_range_id + if project_id is not None: + _path_params["projectId"] = project_id + if network_id is not None: + _path_params["networkId"] = network_id # process the query parameters # process the header parameters # process the form parameters @@ -9244,7 +9651,7 @@ def _get_network_area_range_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", + resource_path="/v1beta1/projects/{projectId}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9258,7 +9665,7 @@ def _get_network_area_range_serialize( ) @validate_call - def get_network_area_route( + def get_network_area( self, organization_id: Annotated[ str, @@ -9272,9 +9679,6 @@ def get_network_area_route( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9284,17 +9688,15 @@ def get_network_area_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Route: - """Get details about a network route. + ) -> NetworkArea: + """Get details about a network area. - Get details about a network route defined in a network area. + Get details about a network area in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str :param area_id: The identifier (ID) of a STACKIT Network Area. (required) :type area_id: str - :param route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9317,10 +9719,9 @@ def get_network_area_route( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_route_serialize( + _param = self._get_network_area_serialize( organization_id=organization_id, area_id=area_id, - route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9328,7 +9729,7 @@ def get_network_area_route( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -9343,7 +9744,7 @@ def get_network_area_route( ).data @validate_call - def get_network_area_route_with_http_info( + def get_network_area_with_http_info( self, organization_id: Annotated[ str, @@ -9357,9 +9758,6 @@ def get_network_area_route_with_http_info( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9369,17 +9767,15 @@ def get_network_area_route_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Route]: - """Get details about a network route. + ) -> ApiResponse[NetworkArea]: + """Get details about a network area. - Get details about a network route defined in a network area. + Get details about a network area in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str :param area_id: The identifier (ID) of a STACKIT Network Area. (required) :type area_id: str - :param route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9402,10 +9798,9 @@ def get_network_area_route_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_route_serialize( + _param = self._get_network_area_serialize( organization_id=organization_id, area_id=area_id, - route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9413,7 +9808,7 @@ def get_network_area_route_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -9428,7 +9823,7 @@ def get_network_area_route_with_http_info( ) @validate_call - def get_network_area_route_without_preload_content( + def get_network_area_without_preload_content( self, organization_id: Annotated[ str, @@ -9442,9 +9837,6 @@ def get_network_area_route_without_preload_content( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9455,16 +9847,14 @@ def get_network_area_route_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a network route. + """Get details about a network area. - Get details about a network route defined in a network area. + Get details about a network area in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str :param area_id: The identifier (ID) of a STACKIT Network Area. (required) :type area_id: str - :param route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9487,10 +9877,9 @@ def get_network_area_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_route_serialize( + _param = self._get_network_area_serialize( organization_id=organization_id, area_id=area_id, - route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9498,7 +9887,7 @@ def get_network_area_route_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -9508,11 +9897,10 @@ def get_network_area_route_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_network_area_route_serialize( + def _get_network_area_serialize( self, organization_id, area_id, - route_id, _request_auth, _content_type, _headers, @@ -9535,8 +9923,6 @@ def _get_network_area_route_serialize( _path_params["organizationId"] = organization_id if area_id is not None: _path_params["areaId"] = area_id - if route_id is not None: - _path_params["routeId"] = route_id # process the query parameters # process the header parameters # process the form parameters @@ -9551,7 +9937,7 @@ def _get_network_area_route_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9565,19 +9951,25 @@ def _get_network_area_route_serialize( ) @validate_call - def get_nic( + def get_network_area_range( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - network_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - nic_id: Annotated[ + network_range_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), ], _request_timeout: Union[ None, @@ -9588,17 +9980,17 @@ def get_nic( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NIC: - """Get details about a network interface. + ) -> NetworkRange: + """Get details about a network range. - Get details about a network interface inside a network. + Get details about a network range in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9621,10 +10013,10 @@ def get_nic( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, + _param = self._get_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9632,7 +10024,7 @@ def get_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "NetworkRange", "400": "Error", "401": "Error", "403": "Error", @@ -9647,19 +10039,25 @@ def get_nic( ).data @validate_call - def get_nic_with_http_info( + def get_network_area_range_with_http_info( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - network_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - nic_id: Annotated[ + network_range_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), ], _request_timeout: Union[ None, @@ -9670,17 +10068,17 @@ def get_nic_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NIC]: - """Get details about a network interface. + ) -> ApiResponse[NetworkRange]: + """Get details about a network range. - Get details about a network interface inside a network. + Get details about a network range in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9703,10 +10101,10 @@ def get_nic_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, + _param = self._get_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9714,7 +10112,7 @@ def get_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "NetworkRange", "400": "Error", "401": "Error", "403": "Error", @@ -9729,19 +10127,25 @@ def get_nic_with_http_info( ) @validate_call - def get_nic_without_preload_content( + def get_network_area_range_without_preload_content( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - network_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - nic_id: Annotated[ + network_range_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), ], _request_timeout: Union[ None, @@ -9753,16 +10157,16 @@ def get_nic_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a network interface. + """Get details about a network range. - Get details about a network interface inside a network. + Get details about a network range in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9785,10 +10189,10 @@ def get_nic_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, + _param = self._get_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9796,7 +10200,7 @@ def get_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "NetworkRange", "400": "Error", "401": "Error", "403": "Error", @@ -9806,11 +10210,11 @@ def get_nic_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_nic_serialize( + def _get_network_area_range_serialize( self, - project_id, - network_id, - nic_id, + organization_id, + area_id, + network_range_id, _request_auth, _content_type, _headers, @@ -9829,12 +10233,12 @@ def _get_nic_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - if nic_id is not None: - _path_params["nicId"] = nic_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if network_range_id is not None: + _path_params["networkRangeId"] = network_range_id # process the query parameters # process the header parameters # process the form parameters @@ -9849,7 +10253,7 @@ def _get_nic_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9863,7 +10267,7 @@ def _get_nic_serialize( ) @validate_call - def get_organization_request( + def get_network_area_route( self, organization_id: Annotated[ str, @@ -9871,9 +10275,14 @@ def get_organization_request( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") ], _request_timeout: Union[ None, @@ -9884,15 +10293,17 @@ def get_organization_request( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Request: - """Lookup an organization request ID. + ) -> Route: + """Get details about a network route. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get details about a network route defined in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9915,9 +10326,10 @@ def get_organization_request( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._get_network_area_route_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9925,7 +10337,7 @@ def get_organization_request( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -9940,7 +10352,7 @@ def get_organization_request( ).data @validate_call - def get_organization_request_with_http_info( + def get_network_area_route_with_http_info( self, organization_id: Annotated[ str, @@ -9948,9 +10360,14 @@ def get_organization_request_with_http_info( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") ], _request_timeout: Union[ None, @@ -9961,15 +10378,17 @@ def get_organization_request_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Request]: - """Lookup an organization request ID. + ) -> ApiResponse[Route]: + """Get details about a network route. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get details about a network route defined in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9992,9 +10411,10 @@ def get_organization_request_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._get_network_area_route_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10002,7 +10422,7 @@ def get_organization_request_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -10017,7 +10437,7 @@ def get_organization_request_with_http_info( ) @validate_call - def get_organization_request_without_preload_content( + def get_network_area_route_without_preload_content( self, organization_id: Annotated[ str, @@ -10025,9 +10445,14 @@ def get_organization_request_without_preload_content( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") ], _request_timeout: Union[ None, @@ -10039,14 +10464,16 @@ def get_organization_request_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Lookup an organization request ID. + """Get details about a network route. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get details about a network route defined in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10069,9 +10496,10 @@ def get_organization_request_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._get_network_area_route_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10079,7 +10507,7 @@ def get_organization_request_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -10089,10 +10517,11 @@ def get_organization_request_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_organization_request_serialize( + def _get_network_area_route_serialize( self, organization_id, - request_id, + area_id, + route_id, _request_auth, _content_type, _headers, @@ -10113,8 +10542,10 @@ def _get_organization_request_serialize( # process the path parameters if organization_id is not None: _path_params["organizationId"] = organization_id - if request_id is not None: - _path_params["requestId"] = request_id + if area_id is not None: + _path_params["areaId"] = area_id + if route_id is not None: + _path_params["routeId"] = route_id # process the query parameters # process the header parameters # process the form parameters @@ -10129,7 +10560,7 @@ def _get_organization_request_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/requests/{requestId}", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10143,15 +10574,19 @@ def _get_organization_request_serialize( ) @validate_call - def get_project_request( + def get_nic( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - request_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], _request_timeout: Union[ None, @@ -10162,15 +10597,17 @@ def get_project_request( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Request: - """Lookup a project request ID. + ) -> NIC: + """Get details about a network interface. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + Get details about a network interface inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param nic_id: The identifier (ID) of a network interface. (required) + :type nic_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10193,9 +10630,10 @@ def get_project_request( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_request_serialize( + _param = self._get_nic_serialize( project_id=project_id, - request_id=request_id, + network_id=network_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10203,7 +10641,1744 @@ def get_project_request( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "NIC", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_nic_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NIC]: + """Get details about a network interface. + + Get details about a network interface inside a network. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param nic_id: The identifier (ID) of a network interface. (required) + :type nic_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_nic_serialize( + project_id=project_id, + network_id=network_id, + nic_id=nic_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NIC", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_nic_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get details about a network interface. + + Get details about a network interface inside a network. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param nic_id: The identifier (ID) of a network interface. (required) + :type nic_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_nic_serialize( + project_id=project_id, + network_id=network_id, + nic_id=nic_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NIC", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_nic_serialize( + self, + project_id, + network_id, + nic_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if network_id is not None: + _path_params["networkId"] = network_id + if nic_id is not None: + _path_params["nicId"] = nic_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_organization_request( + self, + organization_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), + ], + request_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Request: + """Lookup an organization request ID. + + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_organization_request_serialize( + organization_id=organization_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_organization_request_with_http_info( + self, + organization_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), + ], + request_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Request]: + """Lookup an organization request ID. + + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_organization_request_serialize( + organization_id=organization_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_organization_request_without_preload_content( + self, + organization_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), + ], + request_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Lookup an organization request ID. + + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_organization_request_serialize( + organization_id=organization_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_organization_request_serialize( + self, + organization_id, + request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if organization_id is not None: + _path_params["organizationId"] = organization_id + if request_id is not None: + _path_params["requestId"] = request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/organizations/{organizationId}/requests/{requestId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_project_request( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + request_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Request: + """Lookup a project request ID. + + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_project_request_serialize( + project_id=project_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_project_request_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + request_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Request]: + """Lookup a project request ID. + + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_project_request_serialize( + project_id=project_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_project_request_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + request_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Lookup a project request ID. + + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_project_request_serialize( + project_id=project_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_project_request_serialize( + self, + project_id, + request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if request_id is not None: + _path_params["requestId"] = request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/projects/{projectId}/requests/{requestId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_public_ip( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PublicIp: + """Get details about a public IP. + + Get details about a public IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIp", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_public_ip_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PublicIp]: + """Get details about a public IP. + + Get details about a public IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIp", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_public_ip_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get details about a public IP. + + Get details about a public IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIp", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_public_ip_serialize( + self, + project_id, + public_ip_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if public_ip_id is not None: + _path_params["publicIpId"] = public_ip_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/projects/{projectId}/public-ips/{publicIpId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_security_group( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SecurityGroup: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_security_group_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SecurityGroup]: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_security_group_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_security_group_serialize( + self, + project_id, + security_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if security_group_id is not None: + _path_params["securityGroupId"] = security_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_security_group_rule( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SecurityGroupRule: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_security_group_rule_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SecurityGroupRule]: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_security_group_rule_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_security_group_rule_serialize( + self, + project_id, + security_group_id, + security_group_rule_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if security_group_id is not None: + _path_params["securityGroupId"] = security_group_id + if security_group_rule_id is not None: + _path_params["securityGroupRuleId"] = security_group_rule_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_server( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Server: + """Get server details. + + Get details about a server by its ID. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_serialize( + project_id=project_id, + server_id=server_id, + details=details, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -10218,16 +12393,17 @@ def get_project_request( ).data @validate_call - def get_project_request_with_http_info( + def get_server_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - request_id: Annotated[ + server_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10237,15 +12413,17 @@ def get_project_request_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Request]: - """Lookup a project request ID. + ) -> ApiResponse[Server]: + """Get server details. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + Get details about a server by its ID. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10268,9 +12446,10 @@ def get_project_request_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_request_serialize( + _param = self._get_server_serialize( project_id=project_id, - request_id=request_id, + server_id=server_id, + details=details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10278,7 +12457,7 @@ def get_project_request_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -10293,16 +12472,17 @@ def get_project_request_with_http_info( ) @validate_call - def get_project_request_without_preload_content( + def get_server_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - request_id: Annotated[ + server_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10313,14 +12493,16 @@ def get_project_request_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Lookup a project request ID. + """Get server details. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + Get details about a server by its ID. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10343,9 +12525,10 @@ def get_project_request_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_request_serialize( + _param = self._get_server_serialize( project_id=project_id, - request_id=request_id, + server_id=server_id, + details=details, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10353,7 +12536,7 @@ def get_project_request_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -10363,10 +12546,11 @@ def get_project_request_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_project_request_serialize( + def _get_server_serialize( self, project_id, - request_id, + server_id, + details, _request_auth, _content_type, _headers, @@ -10387,9 +12571,13 @@ def _get_project_request_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if request_id is not None: - _path_params["requestId"] = request_id + if server_id is not None: + _path_params["serverId"] = server_id # process the query parameters + if details is not None: + + _query_params.append(("details", details)) + # process the header parameters # process the form parameters # process the body parameter @@ -10403,7 +12591,7 @@ def _get_project_request_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/requests/{requestId}", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10417,14 +12605,15 @@ def _get_project_request_serialize( ) @validate_call - def get_public_ip( + def get_server_console( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -10435,15 +12624,15 @@ def get_public_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PublicIp: - """Get details about a public IP. + ) -> ServerConsoleUrl: + """Get server console. - Get details about a public IP inside a project. + Get a URL for server remote console. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10466,9 +12655,9 @@ def get_public_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_public_ip_serialize( + _param = self._get_server_console_serialize( project_id=project_id, - public_ip_id=public_ip_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10476,7 +12665,7 @@ def get_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "ServerConsoleUrl", "400": "Error", "401": "Error", "403": "Error", @@ -10491,14 +12680,15 @@ def get_public_ip( ).data @validate_call - def get_public_ip_with_http_info( + def get_server_console_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -10509,15 +12699,15 @@ def get_public_ip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PublicIp]: - """Get details about a public IP. + ) -> ApiResponse[ServerConsoleUrl]: + """Get server console. - Get details about a public IP inside a project. + Get a URL for server remote console. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10540,9 +12730,9 @@ def get_public_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_public_ip_serialize( + _param = self._get_server_console_serialize( project_id=project_id, - public_ip_id=public_ip_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10550,7 +12740,7 @@ def get_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "ServerConsoleUrl", "400": "Error", "401": "Error", "403": "Error", @@ -10565,14 +12755,15 @@ def get_public_ip_with_http_info( ) @validate_call - def get_public_ip_without_preload_content( + def get_server_console_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -10584,14 +12775,14 @@ def get_public_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a public IP. + """Get server console. - Get details about a public IP inside a project. + Get a URL for server remote console. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10614,9 +12805,9 @@ def get_public_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_public_ip_serialize( + _param = self._get_server_console_serialize( project_id=project_id, - public_ip_id=public_ip_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10624,7 +12815,7 @@ def get_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "ServerConsoleUrl", "400": "Error", "401": "Error", "403": "Error", @@ -10634,10 +12825,10 @@ def get_public_ip_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_public_ip_serialize( + def _get_server_console_serialize( self, project_id, - public_ip_id, + server_id, _request_auth, _content_type, _headers, @@ -10658,8 +12849,8 @@ def _get_public_ip_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if public_ip_id is not None: - _path_params["publicIpId"] = public_ip_id + if server_id is not None: + _path_params["serverId"] = server_id # process the query parameters # process the header parameters # process the form parameters @@ -10674,7 +12865,7 @@ def _get_public_ip_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/public-ips/{publicIpId}", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/console", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10688,21 +12879,20 @@ def _get_public_ip_serialize( ) @validate_call - def get_security_group( + def get_server_log( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ + server_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + get_server_log_request: Annotated[ + Optional[GetServerLogRequest], + Field(description="Request the server log. By default the length is limited to 2000 lines."), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10712,15 +12902,17 @@ def get_security_group( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroup: - """Get security group details. + ) -> GetServerLog200Response: + """Get server log. - Get details about a security group of a project. + Get server console log. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. + :type get_server_log_request: GetServerLogRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10743,9 +12935,10 @@ def get_security_group( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _param = self._get_server_log_serialize( project_id=project_id, - security_group_id=security_group_id, + server_id=server_id, + get_server_log_request=get_server_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10753,7 +12946,7 @@ def get_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -10768,21 +12961,20 @@ def get_security_group( ).data @validate_call - def get_security_group_with_http_info( + def get_server_log_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ + server_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + get_server_log_request: Annotated[ + Optional[GetServerLogRequest], + Field(description="Request the server log. By default the length is limited to 2000 lines."), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10792,15 +12984,17 @@ def get_security_group_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SecurityGroup]: - """Get security group details. + ) -> ApiResponse[GetServerLog200Response]: + """Get server log. - Get details about a security group of a project. + Get server console log. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. + :type get_server_log_request: GetServerLogRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10823,9 +13017,10 @@ def get_security_group_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _param = self._get_server_log_serialize( project_id=project_id, - security_group_id=security_group_id, + server_id=server_id, + get_server_log_request=get_server_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10833,7 +13028,7 @@ def get_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -10848,21 +13043,20 @@ def get_security_group_with_http_info( ) @validate_call - def get_security_group_without_preload_content( + def get_server_log_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ + server_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + get_server_log_request: Annotated[ + Optional[GetServerLogRequest], + Field(description="Request the server log. By default the length is limited to 2000 lines."), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10873,14 +13067,16 @@ def get_security_group_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get security group details. + """Get server log. - Get details about a security group of a project. + Get server console log. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. + :type get_server_log_request: GetServerLogRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -10903,9 +13099,10 @@ def get_security_group_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _param = self._get_server_log_serialize( project_id=project_id, - security_group_id=security_group_id, + server_id=server_id, + get_server_log_request=get_server_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10913,7 +13110,7 @@ def get_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -10923,10 +13120,11 @@ def get_security_group_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_security_group_serialize( + def _get_server_log_serialize( self, project_id, - security_group_id, + server_id, + get_server_log_request, _request_auth, _content_type, _headers, @@ -10947,23 +13145,33 @@ def _get_security_group_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id + if server_id is not None: + _path_params["serverId"] = server_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if get_server_log_request is not None: + _body_params = get_server_log_request # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/log", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10977,29 +13185,15 @@ def _get_security_group_serialize( ) @validate_call - def get_security_group_rule( + def get_volume( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - security_group_rule_id: Annotated[ + volume_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], _request_timeout: Union[ None, @@ -11010,17 +13204,15 @@ def get_security_group_rule( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroupRule: - """Get security group rule details. + ) -> Volume: + """Get details about a volume. - Get details about a security group rule of a project. + Get details about a block device volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11043,10 +13235,9 @@ def get_security_group_rule( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._get_volume_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11054,7 +13245,7 @@ def get_security_group_rule( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -11069,29 +13260,15 @@ def get_security_group_rule( ).data @validate_call - def get_security_group_rule_with_http_info( + def get_volume_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - security_group_rule_id: Annotated[ + volume_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], _request_timeout: Union[ None, @@ -11102,17 +13279,15 @@ def get_security_group_rule_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SecurityGroupRule]: - """Get security group rule details. + ) -> ApiResponse[Volume]: + """Get details about a volume. - Get details about a security group rule of a project. + Get details about a block device volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11135,10 +13310,9 @@ def get_security_group_rule_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._get_volume_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11146,7 +13320,7 @@ def get_security_group_rule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -11161,29 +13335,15 @@ def get_security_group_rule_with_http_info( ) @validate_call - def get_security_group_rule_without_preload_content( + def get_volume_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - security_group_rule_id: Annotated[ + volume_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], _request_timeout: Union[ None, @@ -11195,16 +13355,14 @@ def get_security_group_rule_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get security group rule details. + """Get details about a volume. - Get details about a security group rule of a project. + Get details about a block device volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11227,10 +13385,9 @@ def get_security_group_rule_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._get_volume_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11238,7 +13395,7 @@ def get_security_group_rule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -11248,11 +13405,10 @@ def get_security_group_rule_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_security_group_rule_serialize( + def _get_volume_serialize( self, project_id, - security_group_id, - security_group_rule_id, + volume_id, _request_auth, _content_type, _headers, @@ -11273,10 +13429,8 @@ def _get_security_group_rule_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id - if security_group_rule_id is not None: - _path_params["securityGroupRuleId"] = security_group_rule_id + if volume_id is not None: + _path_params["volumeId"] = volume_id # process the query parameters # process the header parameters # process the form parameters @@ -11291,7 +13445,7 @@ def _get_security_group_rule_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", + resource_path="/v1beta1/projects/{projectId}/volumes/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11305,17 +13459,15 @@ def _get_security_group_rule_serialize( ) @validate_call - def get_server( + def get_volume_performance_class( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11325,17 +13477,15 @@ def get_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Server: - """Get server details. + ) -> VolumePerformanceClass: + """Get details about a volume performance class. - Get details about a server by its ID. + Get details about a specific volume performance class. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param details: Show detailed information about server. - :type details: bool + :param volume_performance_class: The name of a STACKIT Volume performance class. (required) + :type volume_performance_class: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11358,10 +13508,9 @@ def get_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - server_id=server_id, - details=details, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11369,7 +13518,7 @@ def get_server( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -11384,17 +13533,15 @@ def get_server( ).data @validate_call - def get_server_with_http_info( + def get_volume_performance_class_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11404,17 +13551,15 @@ def get_server_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Server]: - """Get server details. + ) -> ApiResponse[VolumePerformanceClass]: + """Get details about a volume performance class. - Get details about a server by its ID. + Get details about a specific volume performance class. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param details: Show detailed information about server. - :type details: bool + :param volume_performance_class: The name of a STACKIT Volume performance class. (required) + :type volume_performance_class: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11437,10 +13582,9 @@ def get_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - server_id=server_id, - details=details, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11448,7 +13592,7 @@ def get_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -11463,17 +13607,15 @@ def get_server_with_http_info( ) @validate_call - def get_server_without_preload_content( + def get_volume_performance_class_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11484,16 +13626,14 @@ def get_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get server details. + """Get details about a volume performance class. - Get details about a server by its ID. + Get details about a specific volume performance class. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param details: Show detailed information about server. - :type details: bool + :param volume_performance_class: The name of a STACKIT Volume performance class. (required) + :type volume_performance_class: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11516,10 +13656,9 @@ def get_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - server_id=server_id, - details=details, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11527,7 +13666,7 @@ def get_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -11537,11 +13676,10 @@ def get_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_server_serialize( + def _get_volume_performance_class_serialize( self, project_id, - server_id, - details, + volume_performance_class, _request_auth, _content_type, _headers, @@ -11562,13 +13700,9 @@ def _get_server_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id + if volume_performance_class is not None: + _path_params["volumePerformanceClass"] = volume_performance_class # process the query parameters - if details is not None: - - _query_params.append(("details", details)) - # process the header parameters # process the form parameters # process the body parameter @@ -11582,7 +13716,7 @@ def _get_server_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}", + resource_path="/v1beta1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11596,7 +13730,7 @@ def _get_server_serialize( ) @validate_call - def get_server_console( + def list_attached_volumes( self, project_id: Annotated[ str, @@ -11615,10 +13749,10 @@ def get_server_console( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServerConsoleUrl: - """Get server console. + ) -> VolumeAttachmentListResponse: + """List all volume attachments of a server. - Get a URL for server remote console. + Get a list of all volume attachments of a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -11646,7 +13780,7 @@ def get_server_console( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._list_attached_volumes_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -11656,7 +13790,7 @@ def get_server_console( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11671,7 +13805,7 @@ def get_server_console( ).data @validate_call - def get_server_console_with_http_info( + def list_attached_volumes_with_http_info( self, project_id: Annotated[ str, @@ -11690,10 +13824,10 @@ def get_server_console_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ServerConsoleUrl]: - """Get server console. + ) -> ApiResponse[VolumeAttachmentListResponse]: + """List all volume attachments of a server. - Get a URL for server remote console. + Get a list of all volume attachments of a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -11721,7 +13855,7 @@ def get_server_console_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._list_attached_volumes_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -11731,7 +13865,7 @@ def get_server_console_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11746,7 +13880,7 @@ def get_server_console_with_http_info( ) @validate_call - def get_server_console_without_preload_content( + def list_attached_volumes_without_preload_content( self, project_id: Annotated[ str, @@ -11766,9 +13900,9 @@ def get_server_console_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get server console. + """List all volume attachments of a server. - Get a URL for server remote console. + Get a list of all volume attachments of a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -11796,7 +13930,7 @@ def get_server_console_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._list_attached_volumes_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -11806,7 +13940,7 @@ def get_server_console_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11816,7 +13950,7 @@ def get_server_console_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_server_console_serialize( + def _list_attached_volumes_serialize( self, project_id, server_id, @@ -11856,7 +13990,7 @@ def _get_server_console_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/console", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11870,20 +14004,9 @@ def _get_server_console_serialize( ) @validate_call - def get_server_log( + def list_key_pairs( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11893,17 +14016,13 @@ def get_server_log( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetServerLog200Response: - """Get server log. - - Get server console log. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + ) -> KeyPairListResponse: + """List all SSH keypairs for the requesting user. + + Get a list of all SSH keypairs assigned to the requesting user. + + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11926,10 +14045,8 @@ def get_server_log( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_log_serialize( - project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11937,7 +14054,7 @@ def get_server_log( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11952,20 +14069,9 @@ def get_server_log( ).data @validate_call - def get_server_log_with_http_info( + def list_key_pairs_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11975,17 +14081,13 @@ def get_server_log_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetServerLog200Response]: - """Get server log. + ) -> ApiResponse[KeyPairListResponse]: + """List all SSH keypairs for the requesting user. - Get server console log. + Get a list of all SSH keypairs assigned to the requesting user. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12008,10 +14110,8 @@ def get_server_log_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_log_serialize( - project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12019,7 +14119,7 @@ def get_server_log_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12034,20 +14134,9 @@ def get_server_log_with_http_info( ) @validate_call - def get_server_log_without_preload_content( + def list_key_pairs_without_preload_content( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12058,16 +14147,12 @@ def get_server_log_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get server log. + """List all SSH keypairs for the requesting user. - Get server console log. + Get a list of all SSH keypairs assigned to the requesting user. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12090,10 +14175,8 @@ def get_server_log_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_log_serialize( - project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12101,7 +14184,7 @@ def get_server_log_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12111,11 +14194,9 @@ def get_server_log_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_server_log_serialize( + def _list_key_pairs_serialize( self, - project_id, - server_id, - get_server_log_request, + label_selector, _request_auth, _content_type, _headers, @@ -12134,35 +14215,25 @@ def _get_server_log_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id # process the query parameters + if label_selector is not None: + + _query_params.append(("label_selector", label_selector)) + # process the header parameters # process the form parameters # process the body parameter - if get_server_log_request is not None: - _body_params = get_server_log_request # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/log", + resource_path="/v1beta1/keypairs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12176,16 +14247,12 @@ def _get_server_log_serialize( ) @validate_call - def get_volume( + def list_machine_types( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12195,15 +14262,13 @@ def get_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Volume: - """Get details about a volume. + ) -> MachineTypeListResponse: + """List all machine types available for a project. - Get details about a block device volume. + Get a list of all machine type available in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12226,9 +14291,8 @@ def get_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._list_machine_types_serialize( project_id=project_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12236,7 +14300,7 @@ def get_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12251,16 +14315,12 @@ def get_volume( ).data @validate_call - def get_volume_with_http_info( + def list_machine_types_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12270,15 +14330,13 @@ def get_volume_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Volume]: - """Get details about a volume. + ) -> ApiResponse[MachineTypeListResponse]: + """List all machine types available for a project. - Get details about a block device volume. + Get a list of all machine type available in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12301,9 +14359,8 @@ def get_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._list_machine_types_serialize( project_id=project_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12311,7 +14368,7 @@ def get_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12326,16 +14383,12 @@ def get_volume_with_http_info( ) @validate_call - def get_volume_without_preload_content( + def list_machine_types_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12346,14 +14399,12 @@ def get_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a volume. + """List all machine types available for a project. - Get details about a block device volume. + Get a list of all machine type available in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12376,9 +14427,8 @@ def get_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._list_machine_types_serialize( project_id=project_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12386,7 +14436,7 @@ def get_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12396,10 +14446,9 @@ def get_volume_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_volume_serialize( + def _list_machine_types_serialize( self, project_id, - volume_id, _request_auth, _content_type, _headers, @@ -12420,8 +14469,6 @@ def _get_volume_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if volume_id is not None: - _path_params["volumeId"] = volume_id # process the query parameters # process the header parameters # process the form parameters @@ -12436,7 +14483,7 @@ def _get_volume_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/volumes/{volumeId}", + resource_path="/v1beta1/projects/{projectId}/machine-types", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12450,15 +14497,19 @@ def _get_volume_serialize( ) @validate_call - def list_attached_volumes( + def list_network_area_projects( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], _request_timeout: Union[ None, @@ -12469,15 +14520,15 @@ def list_attached_volumes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeAttachmentListResponse: - """List all volume attachments of a server. + ) -> ProjectListResponse: + """List all projects using a network area. - Get a list of all volume attachments of a server. + Get a list of all projects using a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12500,9 +14551,9 @@ def list_attached_volumes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_attached_volumes_serialize( - project_id=project_id, - server_id=server_id, + _param = self._list_network_area_projects_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12510,7 +14561,7 @@ def list_attached_volumes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "ProjectListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12525,15 +14576,19 @@ def list_attached_volumes( ).data @validate_call - def list_attached_volumes_with_http_info( + def list_network_area_projects_with_http_info( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], _request_timeout: Union[ None, @@ -12544,15 +14599,15 @@ def list_attached_volumes_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumeAttachmentListResponse]: - """List all volume attachments of a server. + ) -> ApiResponse[ProjectListResponse]: + """List all projects using a network area. - Get a list of all volume attachments of a server. + Get a list of all projects using a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12575,9 +14630,9 @@ def list_attached_volumes_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_attached_volumes_serialize( - project_id=project_id, - server_id=server_id, + _param = self._list_network_area_projects_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12585,7 +14640,7 @@ def list_attached_volumes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "ProjectListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12600,15 +14655,19 @@ def list_attached_volumes_with_http_info( ) @validate_call - def list_attached_volumes_without_preload_content( + def list_network_area_projects_without_preload_content( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], _request_timeout: Union[ None, @@ -12620,14 +14679,14 @@ def list_attached_volumes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all volume attachments of a server. + """List all projects using a network area. - Get a list of all volume attachments of a server. + Get a list of all projects using a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12650,9 +14709,9 @@ def list_attached_volumes_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_attached_volumes_serialize( - project_id=project_id, - server_id=server_id, + _param = self._list_network_area_projects_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12660,7 +14719,7 @@ def list_attached_volumes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "ProjectListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12670,10 +14729,10 @@ def list_attached_volumes_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_attached_volumes_serialize( + def _list_network_area_projects_serialize( self, - project_id, - server_id, + organization_id, + area_id, _request_auth, _content_type, _headers, @@ -12692,10 +14751,10 @@ def _list_attached_volumes_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id # process the query parameters # process the header parameters # process the form parameters @@ -12710,7 +14769,7 @@ def _list_attached_volumes_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/projects", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12724,7 +14783,7 @@ def _list_attached_volumes_serialize( ) @validate_call - def list_network_area_projects( + def list_network_area_ranges( self, organization_id: Annotated[ str, @@ -12747,10 +14806,10 @@ def list_network_area_projects( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProjectListResponse: - """List all projects using a network area. + ) -> NetworkRangeListResponse: + """List all network ranges in a network area. - Get a list of all projects using a network area. + Get a list of all network ranges in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str @@ -12778,7 +14837,7 @@ def list_network_area_projects( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_projects_serialize( + _param = self._list_network_area_ranges_serialize( organization_id=organization_id, area_id=area_id, _request_auth=_request_auth, @@ -12788,7 +14847,7 @@ def list_network_area_projects( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12803,7 +14862,7 @@ def list_network_area_projects( ).data @validate_call - def list_network_area_projects_with_http_info( + def list_network_area_ranges_with_http_info( self, organization_id: Annotated[ str, @@ -12826,10 +14885,10 @@ def list_network_area_projects_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ProjectListResponse]: - """List all projects using a network area. + ) -> ApiResponse[NetworkRangeListResponse]: + """List all network ranges in a network area. - Get a list of all projects using a network area. + Get a list of all network ranges in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str @@ -12857,7 +14916,7 @@ def list_network_area_projects_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_projects_serialize( + _param = self._list_network_area_ranges_serialize( organization_id=organization_id, area_id=area_id, _request_auth=_request_auth, @@ -12867,7 +14926,7 @@ def list_network_area_projects_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12882,7 +14941,7 @@ def list_network_area_projects_with_http_info( ) @validate_call - def list_network_area_projects_without_preload_content( + def list_network_area_ranges_without_preload_content( self, organization_id: Annotated[ str, @@ -12906,9 +14965,9 @@ def list_network_area_projects_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all projects using a network area. + """List all network ranges in a network area. - Get a list of all projects using a network area. + Get a list of all network ranges in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str @@ -12936,7 +14995,7 @@ def list_network_area_projects_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_projects_serialize( + _param = self._list_network_area_ranges_serialize( organization_id=organization_id, area_id=area_id, _request_auth=_request_auth, @@ -12946,7 +15005,7 @@ def list_network_area_projects_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12956,7 +15015,7 @@ def list_network_area_projects_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_network_area_projects_serialize( + def _list_network_area_ranges_serialize( self, organization_id, area_id, @@ -12996,7 +15055,7 @@ def _list_network_area_projects_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/projects", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13010,7 +15069,7 @@ def _list_network_area_projects_serialize( ) @validate_call - def list_network_area_ranges( + def list_network_area_routes( self, organization_id: Annotated[ str, @@ -13024,6 +15083,7 @@ def list_network_area_ranges( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13033,15 +15093,17 @@ def list_network_area_ranges( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkRangeListResponse: - """List all network ranges in a network area. + ) -> RouteListResponse: + """List all network routes in a network area. - Get a list of all network ranges in a network area. + Get a list of all network routes defined in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str :param area_id: The identifier (ID) of a STACKIT Network Area. (required) :type area_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13064,9 +15126,10 @@ def list_network_area_ranges( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_ranges_serialize( + _param = self._list_network_area_routes_serialize( organization_id=organization_id, area_id=area_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13074,7 +15137,7 @@ def list_network_area_ranges( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13089,7 +15152,7 @@ def list_network_area_ranges( ).data @validate_call - def list_network_area_ranges_with_http_info( + def list_network_area_routes_with_http_info( self, organization_id: Annotated[ str, @@ -13103,6 +15166,7 @@ def list_network_area_ranges_with_http_info( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13112,15 +15176,17 @@ def list_network_area_ranges_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NetworkRangeListResponse]: - """List all network ranges in a network area. + ) -> ApiResponse[RouteListResponse]: + """List all network routes in a network area. - Get a list of all network ranges in a network area. + Get a list of all network routes defined in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str :param area_id: The identifier (ID) of a STACKIT Network Area. (required) :type area_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13143,9 +15209,10 @@ def list_network_area_ranges_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_ranges_serialize( + _param = self._list_network_area_routes_serialize( organization_id=organization_id, area_id=area_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13153,7 +15220,7 @@ def list_network_area_ranges_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13168,7 +15235,7 @@ def list_network_area_ranges_with_http_info( ) @validate_call - def list_network_area_ranges_without_preload_content( + def list_network_area_routes_without_preload_content( self, organization_id: Annotated[ str, @@ -13182,6 +15249,7 @@ def list_network_area_ranges_without_preload_content( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13192,14 +15260,16 @@ def list_network_area_ranges_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all network ranges in a network area. + """List all network routes in a network area. - Get a list of all network ranges in a network area. + Get a list of all network routes defined in a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str :param area_id: The identifier (ID) of a STACKIT Network Area. (required) :type area_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13222,9 +15292,10 @@ def list_network_area_ranges_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_ranges_serialize( + _param = self._list_network_area_routes_serialize( organization_id=organization_id, area_id=area_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13232,7 +15303,7 @@ def list_network_area_ranges_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13242,10 +15313,11 @@ def list_network_area_ranges_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_network_area_ranges_serialize( + def _list_network_area_routes_serialize( self, organization_id, area_id, + label_selector, _request_auth, _content_type, _headers, @@ -13269,6 +15341,10 @@ def _list_network_area_ranges_serialize( if area_id is not None: _path_params["areaId"] = area_id # process the query parameters + if label_selector is not None: + + _query_params.append(("label_selector", label_selector)) + # process the header parameters # process the form parameters # process the body parameter @@ -13282,7 +15358,7 @@ def _list_network_area_ranges_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13296,7 +15372,7 @@ def _list_network_area_ranges_serialize( ) @validate_call - def list_network_area_routes( + def list_network_areas( self, organization_id: Annotated[ str, @@ -13304,12 +15380,6 @@ def list_network_area_routes( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -13320,15 +15390,13 @@ def list_network_area_routes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RouteListResponse: - """List all network routes in a network area. + ) -> NetworkAreaListResponse: + """List all network areas in an organization. - Get a list of all network routes defined in a network area. + Get a list of all visible network areas defined in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -13353,9 +15421,8 @@ def list_network_area_routes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_routes_serialize( + _param = self._list_network_areas_serialize( organization_id=organization_id, - area_id=area_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -13364,7 +15431,7 @@ def list_network_area_routes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RouteListResponse", + "200": "NetworkAreaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13379,7 +15446,7 @@ def list_network_area_routes( ).data @validate_call - def list_network_area_routes_with_http_info( + def list_network_areas_with_http_info( self, organization_id: Annotated[ str, @@ -13387,12 +15454,6 @@ def list_network_area_routes_with_http_info( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -13403,15 +15464,13 @@ def list_network_area_routes_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RouteListResponse]: - """List all network routes in a network area. + ) -> ApiResponse[NetworkAreaListResponse]: + """List all network areas in an organization. - Get a list of all network routes defined in a network area. + Get a list of all visible network areas defined in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -13436,9 +15495,8 @@ def list_network_area_routes_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_routes_serialize( + _param = self._list_network_areas_serialize( organization_id=organization_id, - area_id=area_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -13447,7 +15505,7 @@ def list_network_area_routes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RouteListResponse", + "200": "NetworkAreaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13462,7 +15520,7 @@ def list_network_area_routes_with_http_info( ) @validate_call - def list_network_area_routes_without_preload_content( + def list_network_areas_without_preload_content( self, organization_id: Annotated[ str, @@ -13470,12 +15528,6 @@ def list_network_area_routes_without_preload_content( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -13487,14 +15539,12 @@ def list_network_area_routes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all network routes in a network area. + """List all network areas in an organization. - Get a list of all network routes defined in a network area. + Get a list of all visible network areas defined in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -13519,9 +15569,8 @@ def list_network_area_routes_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_routes_serialize( + _param = self._list_network_areas_serialize( organization_id=organization_id, - area_id=area_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -13530,7 +15579,7 @@ def list_network_area_routes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RouteListResponse", + "200": "NetworkAreaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13540,10 +15589,9 @@ def list_network_area_routes_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_network_area_routes_serialize( + def _list_network_areas_serialize( self, organization_id, - area_id, label_selector, _request_auth, _content_type, @@ -13565,8 +15613,6 @@ def _list_network_area_routes_serialize( # process the path parameters if organization_id is not None: _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id # process the query parameters if label_selector is not None: @@ -13585,7 +15631,7 @@ def _list_network_area_routes_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes", + resource_path="/v1beta1/organizations/{organizationId}/network-areas", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13599,13 +15645,11 @@ def _list_network_area_routes_serialize( ) @validate_call - def list_network_areas( + def list_networks( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ @@ -13617,13 +15661,13 @@ def list_network_areas( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkAreaListResponse: - """List all network areas in an organization. + ) -> NetworkListResponse: + """List all networks inside a project. - Get a list of all visible network areas defined in an organization. + Get a list of all networks inside a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -13648,8 +15692,8 @@ def list_network_areas( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_areas_serialize( - organization_id=organization_id, + _param = self._list_networks_serialize( + project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -13658,7 +15702,7 @@ def list_network_areas( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13673,13 +15717,11 @@ def list_network_areas( ).data @validate_call - def list_network_areas_with_http_info( + def list_networks_with_http_info( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ @@ -13691,13 +15733,13 @@ def list_network_areas_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NetworkAreaListResponse]: - """List all network areas in an organization. + ) -> ApiResponse[NetworkListResponse]: + """List all networks inside a project. - Get a list of all visible network areas defined in an organization. + Get a list of all networks inside a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -13722,8 +15764,8 @@ def list_network_areas_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_areas_serialize( - organization_id=organization_id, + _param = self._list_networks_serialize( + project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -13732,7 +15774,7 @@ def list_network_areas_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13747,13 +15789,11 @@ def list_network_areas_with_http_info( ) @validate_call - def list_network_areas_without_preload_content( + def list_networks_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ @@ -13766,12 +15806,12 @@ def list_network_areas_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all network areas in an organization. + """List all networks inside a project. - Get a list of all visible network areas defined in an organization. + Get a list of all networks inside a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -13796,8 +15836,8 @@ def list_network_areas_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_areas_serialize( - organization_id=organization_id, + _param = self._list_networks_serialize( + project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -13806,7 +15846,7 @@ def list_network_areas_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13816,9 +15856,9 @@ def list_network_areas_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_network_areas_serialize( + def _list_networks_serialize( self, - organization_id, + project_id, label_selector, _request_auth, _content_type, @@ -13838,8 +15878,8 @@ def _list_network_areas_serialize( _body_params: Optional[bytes] = None # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id + if project_id is not None: + _path_params["projectId"] = project_id # process the query parameters if label_selector is not None: @@ -13858,7 +15898,7 @@ def _list_network_areas_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas", + resource_path="/v1beta1/projects/{projectId}/networks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13872,12 +15912,16 @@ def _list_network_areas_serialize( ) @validate_call - def list_networks( + def list_nics( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -13888,13 +15932,15 @@ def list_networks( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkListResponse: - """List all networks inside a project. + ) -> NICListResponse: + """List all network interfaces inside a network. - Get a list of all networks inside a project. + Get a list of all network interfaces inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -13919,8 +15965,9 @@ def list_networks( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_networks_serialize( + _param = self._list_nics_serialize( project_id=project_id, + network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -13929,7 +15976,7 @@ def list_networks( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13944,12 +15991,16 @@ def list_networks( ).data @validate_call - def list_networks_with_http_info( + def list_nics_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -13960,13 +16011,15 @@ def list_networks_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NetworkListResponse]: - """List all networks inside a project. + ) -> ApiResponse[NICListResponse]: + """List all network interfaces inside a network. - Get a list of all networks inside a project. + Get a list of all network interfaces inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -13991,8 +16044,9 @@ def list_networks_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_networks_serialize( + _param = self._list_nics_serialize( project_id=project_id, + network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -14001,7 +16055,7 @@ def list_networks_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14016,12 +16070,16 @@ def list_networks_with_http_info( ) @validate_call - def list_networks_without_preload_content( + def list_nics_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -14033,12 +16091,14 @@ def list_networks_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all networks inside a project. + """List all network interfaces inside a network. - Get a list of all networks inside a project. + Get a list of all network interfaces inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -14063,8 +16123,9 @@ def list_networks_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_networks_serialize( + _param = self._list_nics_serialize( project_id=project_id, + network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -14073,7 +16134,7 @@ def list_networks_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14083,9 +16144,10 @@ def list_networks_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_networks_serialize( + def _list_nics_serialize( self, project_id, + network_id, label_selector, _request_auth, _content_type, @@ -14107,6 +16169,8 @@ def _list_networks_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if network_id is not None: + _path_params["networkId"] = network_id # process the query parameters if label_selector is not None: @@ -14125,7 +16189,7 @@ def _list_networks_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/networks", + resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14139,16 +16203,12 @@ def _list_networks_serialize( ) @validate_call - def list_nics( + def list_public_ips( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -14159,15 +16219,13 @@ def list_nics( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NICListResponse: - """List all network interfaces inside a network. + ) -> PublicIpListResponse: + """List all public IPs inside a project. - Get a list of all network interfaces inside a network. + Get a list of all public IPs inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -14192,9 +16250,8 @@ def list_nics( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_nics_serialize( + _param = self._list_public_ips_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -14203,7 +16260,7 @@ def list_nics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "PublicIpListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14218,16 +16275,12 @@ def list_nics( ).data @validate_call - def list_nics_with_http_info( + def list_public_ips_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -14238,15 +16291,13 @@ def list_nics_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NICListResponse]: - """List all network interfaces inside a network. + ) -> ApiResponse[PublicIpListResponse]: + """List all public IPs inside a project. - Get a list of all network interfaces inside a network. + Get a list of all public IPs inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -14271,9 +16322,8 @@ def list_nics_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_nics_serialize( + _param = self._list_public_ips_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -14282,7 +16332,7 @@ def list_nics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "PublicIpListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14297,16 +16347,12 @@ def list_nics_with_http_info( ) @validate_call - def list_nics_without_preload_content( + def list_public_ips_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -14318,14 +16364,12 @@ def list_nics_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all network interfaces inside a network. + """List all public IPs inside a project. - Get a list of all network interfaces inside a network. + Get a list of all public IPs inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -14350,9 +16394,8 @@ def list_nics_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_nics_serialize( + _param = self._list_public_ips_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -14361,7 +16404,7 @@ def list_nics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "PublicIpListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14371,10 +16414,9 @@ def list_nics_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_nics_serialize( + def _list_public_ips_serialize( self, project_id, - network_id, label_selector, _request_auth, _content_type, @@ -14396,8 +16438,6 @@ def _list_nics_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id # process the query parameters if label_selector is not None: @@ -14416,7 +16456,7 @@ def _list_nics_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics", + resource_path="/v1beta1/projects/{projectId}/public-ips", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14430,13 +16470,21 @@ def _list_nics_serialize( ) @validate_call - def list_public_ips( + def list_security_group_rules( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14446,15 +16494,15 @@ def list_public_ips( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PublicIpListResponse: - """List all public IPs inside a project. + ) -> SecurityGroupRuleListResponse: + """List all rules for a security group. - Get a list of all public IPs inside a project. + Get a list of all rules inside a security group. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14477,9 +16525,9 @@ def list_public_ips( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ips_serialize( + _param = self._list_security_group_rules_serialize( project_id=project_id, - label_selector=label_selector, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14487,7 +16535,7 @@ def list_public_ips( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "SecurityGroupRuleListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14502,13 +16550,21 @@ def list_public_ips( ).data @validate_call - def list_public_ips_with_http_info( + def list_security_group_rules_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14518,15 +16574,15 @@ def list_public_ips_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PublicIpListResponse]: - """List all public IPs inside a project. + ) -> ApiResponse[SecurityGroupRuleListResponse]: + """List all rules for a security group. - Get a list of all public IPs inside a project. + Get a list of all rules inside a security group. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14549,9 +16605,9 @@ def list_public_ips_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ips_serialize( + _param = self._list_security_group_rules_serialize( project_id=project_id, - label_selector=label_selector, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14559,7 +16615,7 @@ def list_public_ips_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "SecurityGroupRuleListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14574,13 +16630,21 @@ def list_public_ips_with_http_info( ) @validate_call - def list_public_ips_without_preload_content( + def list_security_group_rules_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14591,14 +16655,14 @@ def list_public_ips_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all public IPs inside a project. + """List all rules for a security group. - Get a list of all public IPs inside a project. + Get a list of all rules inside a security group. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14621,9 +16685,9 @@ def list_public_ips_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ips_serialize( + _param = self._list_security_group_rules_serialize( project_id=project_id, - label_selector=label_selector, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14631,7 +16695,7 @@ def list_public_ips_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "SecurityGroupRuleListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14641,10 +16705,10 @@ def list_public_ips_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_public_ips_serialize( + def _list_security_group_rules_serialize( self, project_id, - label_selector, + security_group_id, _request_auth, _content_type, _headers, @@ -14665,11 +16729,9 @@ def _list_public_ips_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if security_group_id is not None: + _path_params["securityGroupId"] = security_group_id # process the query parameters - if label_selector is not None: - - _query_params.append(("label_selector", label_selector)) - # process the header parameters # process the form parameters # process the body parameter @@ -14683,7 +16745,7 @@ def _list_public_ips_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/public-ips", + resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14697,21 +16759,13 @@ def _list_public_ips_serialize( ) @validate_call - def list_security_group_rules( + def list_security_groups( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14721,15 +16775,15 @@ def list_security_group_rules( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroupRuleListResponse: - """List all rules for a security group. + ) -> SecurityGroupListResponse: + """List all security groups inside a project. - Get a list of all rules inside a security group. + Get a list of all security groups inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14752,9 +16806,9 @@ def list_security_group_rules( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_group_rules_serialize( + _param = self._list_security_groups_serialize( project_id=project_id, - security_group_id=security_group_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14762,7 +16816,7 @@ def list_security_group_rules( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRuleListResponse", + "200": "SecurityGroupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14777,21 +16831,13 @@ def list_security_group_rules( ).data @validate_call - def list_security_group_rules_with_http_info( + def list_security_groups_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14801,15 +16847,15 @@ def list_security_group_rules_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SecurityGroupRuleListResponse]: - """List all rules for a security group. + ) -> ApiResponse[SecurityGroupListResponse]: + """List all security groups inside a project. - Get a list of all rules inside a security group. + Get a list of all security groups inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14832,9 +16878,9 @@ def list_security_group_rules_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_group_rules_serialize( + _param = self._list_security_groups_serialize( project_id=project_id, - security_group_id=security_group_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14842,7 +16888,7 @@ def list_security_group_rules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRuleListResponse", + "200": "SecurityGroupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14857,21 +16903,13 @@ def list_security_group_rules_with_http_info( ) @validate_call - def list_security_group_rules_without_preload_content( + def list_security_groups_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14882,14 +16920,14 @@ def list_security_group_rules_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all rules for a security group. + """List all security groups inside a project. - Get a list of all rules inside a security group. + Get a list of all security groups inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14912,9 +16950,9 @@ def list_security_group_rules_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_group_rules_serialize( + _param = self._list_security_groups_serialize( project_id=project_id, - security_group_id=security_group_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14922,7 +16960,7 @@ def list_security_group_rules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRuleListResponse", + "200": "SecurityGroupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14932,10 +16970,10 @@ def list_security_group_rules_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_security_group_rules_serialize( + def _list_security_groups_serialize( self, project_id, - security_group_id, + label_selector, _request_auth, _content_type, _headers, @@ -14956,9 +16994,11 @@ def _list_security_group_rules_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id # process the query parameters + if label_selector is not None: + + _query_params.append(("label_selector", label_selector)) + # process the header parameters # process the form parameters # process the body parameter @@ -14972,7 +17012,7 @@ def _list_security_group_rules_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules", + resource_path="/v1beta1/projects/{projectId}/security-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14986,13 +17026,16 @@ def _list_security_group_rules_serialize( ) @validate_call - def list_security_groups( + def list_server_nics( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15002,15 +17045,15 @@ def list_security_groups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroupListResponse: - """List all security groups inside a project. + ) -> NICListResponse: + """Get all network interfaces. - Get a list of all security groups inside a project. + Get all network interfaces attached to the server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -15033,9 +17076,9 @@ def list_security_groups( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_groups_serialize( + _param = self._list_server_nics_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15043,7 +17086,7 @@ def list_security_groups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15058,13 +17101,16 @@ def list_security_groups( ).data @validate_call - def list_security_groups_with_http_info( + def list_server_nics_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15074,15 +17120,15 @@ def list_security_groups_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SecurityGroupListResponse]: - """List all security groups inside a project. + ) -> ApiResponse[NICListResponse]: + """Get all network interfaces. - Get a list of all security groups inside a project. + Get all network interfaces attached to the server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -15105,9 +17151,9 @@ def list_security_groups_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_groups_serialize( + _param = self._list_server_nics_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15115,7 +17161,7 @@ def list_security_groups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15130,13 +17176,16 @@ def list_security_groups_with_http_info( ) @validate_call - def list_security_groups_without_preload_content( + def list_server_nics_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15147,14 +17196,14 @@ def list_security_groups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all security groups inside a project. + """Get all network interfaces. - Get a list of all security groups inside a project. + Get all network interfaces attached to the server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -15177,9 +17226,9 @@ def list_security_groups_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_groups_serialize( + _param = self._list_server_nics_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15187,7 +17236,7 @@ def list_security_groups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15197,10 +17246,10 @@ def list_security_groups_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_security_groups_serialize( + def _list_server_nics_serialize( self, project_id, - label_selector, + server_id, _request_auth, _content_type, _headers, @@ -15221,11 +17270,9 @@ def _list_security_groups_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if server_id is not None: + _path_params["serverId"] = server_id # process the query parameters - if label_selector is not None: - - _query_params.append(("label_selector", label_selector)) - # process the header parameters # process the form parameters # process the body parameter @@ -15239,7 +17286,7 @@ def _list_security_groups_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/security-groups", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/nics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15253,7 +17300,7 @@ def _list_security_groups_serialize( ) @validate_call - def list_server_nics( + def list_server_service_accounts( self, project_id: Annotated[ str, @@ -15272,10 +17319,10 @@ def list_server_nics( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NICListResponse: - """Get all network interfaces. + ) -> ServiceAccountMailListResponse: + """List all service accounts of the Server. - Get all network interfaces attached to the server. + Get the list of the service accounts of the server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -15303,7 +17350,7 @@ def list_server_nics( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_nics_serialize( + _param = self._list_server_service_accounts_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -15313,7 +17360,7 @@ def list_server_nics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "ServiceAccountMailListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15328,7 +17375,7 @@ def list_server_nics( ).data @validate_call - def list_server_nics_with_http_info( + def list_server_service_accounts_with_http_info( self, project_id: Annotated[ str, @@ -15347,10 +17394,10 @@ def list_server_nics_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NICListResponse]: - """Get all network interfaces. + ) -> ApiResponse[ServiceAccountMailListResponse]: + """List all service accounts of the Server. - Get all network interfaces attached to the server. + Get the list of the service accounts of the server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -15378,7 +17425,7 @@ def list_server_nics_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_nics_serialize( + _param = self._list_server_service_accounts_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -15388,7 +17435,7 @@ def list_server_nics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "ServiceAccountMailListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15403,7 +17450,7 @@ def list_server_nics_with_http_info( ) @validate_call - def list_server_nics_without_preload_content( + def list_server_service_accounts_without_preload_content( self, project_id: Annotated[ str, @@ -15423,9 +17470,9 @@ def list_server_nics_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get all network interfaces. + """List all service accounts of the Server. - Get all network interfaces attached to the server. + Get the list of the service accounts of the server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -15453,7 +17500,7 @@ def list_server_nics_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_nics_serialize( + _param = self._list_server_service_accounts_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -15463,7 +17510,7 @@ def list_server_nics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "ServiceAccountMailListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15473,7 +17520,7 @@ def list_server_nics_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_server_nics_serialize( + def _list_server_service_accounts_serialize( self, project_id, server_id, @@ -15513,7 +17560,7 @@ def _list_server_nics_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/nics", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15527,16 +17574,14 @@ def _list_server_nics_serialize( ) @validate_call - def list_server_service_accounts( + def list_servers( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15546,15 +17591,17 @@ def list_server_service_accounts( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServiceAccountMailListResponse: - """List all service accounts of the Server. + ) -> ServerListResponse: + """List all servers inside a project. - Get the list of the service accounts of the server. + Get a list of all servers inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -15577,9 +17624,10 @@ def list_server_service_accounts( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_service_accounts_serialize( + _param = self._list_servers_serialize( project_id=project_id, - server_id=server_id, + details=details, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15587,7 +17635,7 @@ def list_server_service_accounts( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "200": "ServerListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15602,16 +17650,14 @@ def list_server_service_accounts( ).data @validate_call - def list_server_service_accounts_with_http_info( + def list_servers_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15621,15 +17667,17 @@ def list_server_service_accounts_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ServiceAccountMailListResponse]: - """List all service accounts of the Server. + ) -> ApiResponse[ServerListResponse]: + """List all servers inside a project. - Get the list of the service accounts of the server. + Get a list of all servers inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -15652,9 +17700,10 @@ def list_server_service_accounts_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_service_accounts_serialize( + _param = self._list_servers_serialize( project_id=project_id, - server_id=server_id, + details=details, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15662,7 +17711,7 @@ def list_server_service_accounts_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "200": "ServerListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15677,16 +17726,14 @@ def list_server_service_accounts_with_http_info( ) @validate_call - def list_server_service_accounts_without_preload_content( + def list_servers_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15697,14 +17744,16 @@ def list_server_service_accounts_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all service accounts of the Server. + """List all servers inside a project. - Get the list of the service accounts of the server. + Get a list of all servers inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :param label_selector: Filter resources by labels. + :type label_selector: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -15727,9 +17776,10 @@ def list_server_service_accounts_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_service_accounts_serialize( + _param = self._list_servers_serialize( project_id=project_id, - server_id=server_id, + details=details, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15737,7 +17787,7 @@ def list_server_service_accounts_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "200": "ServerListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15747,10 +17797,11 @@ def list_server_service_accounts_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_server_service_accounts_serialize( + def _list_servers_serialize( self, project_id, - server_id, + details, + label_selector, _request_auth, _content_type, _headers, @@ -15771,9 +17822,15 @@ def _list_server_service_accounts_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id # process the query parameters + if details is not None: + + _query_params.append(("details", details)) + + if label_selector is not None: + + _query_params.append(("label_selector", label_selector)) + # process the header parameters # process the form parameters # process the body parameter @@ -15787,7 +17844,7 @@ def _list_server_service_accounts_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts", + resource_path="/v1beta1/projects/{projectId}/servers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15801,13 +17858,12 @@ def _list_server_service_accounts_serialize( ) @validate_call - def list_servers( + def list_volume_performance_classes( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -15818,15 +17874,13 @@ def list_servers( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServerListResponse: - """List all servers inside a project. + ) -> VolumePerformanceClassListResponse: + """List all volume performance classes available for a project. - Get a list of all servers inside a project. + Get a list of all volume performance classes available inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param details: Show detailed information about server. - :type details: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -15851,9 +17905,8 @@ def list_servers( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_servers_serialize( + _param = self._list_volume_performance_classes_serialize( project_id=project_id, - details=details, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -15862,7 +17915,7 @@ def list_servers( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "200": "VolumePerformanceClassListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15877,13 +17930,12 @@ def list_servers( ).data @validate_call - def list_servers_with_http_info( + def list_volume_performance_classes_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -15894,15 +17946,13 @@ def list_servers_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ServerListResponse]: - """List all servers inside a project. + ) -> ApiResponse[VolumePerformanceClassListResponse]: + """List all volume performance classes available for a project. - Get a list of all servers inside a project. + Get a list of all volume performance classes available inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param details: Show detailed information about server. - :type details: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -15927,9 +17977,8 @@ def list_servers_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_servers_serialize( + _param = self._list_volume_performance_classes_serialize( project_id=project_id, - details=details, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -15938,7 +17987,7 @@ def list_servers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "200": "VolumePerformanceClassListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15953,13 +18002,12 @@ def list_servers_with_http_info( ) @validate_call - def list_servers_without_preload_content( + def list_volume_performance_classes_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -15971,14 +18019,12 @@ def list_servers_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all servers inside a project. + """List all volume performance classes available for a project. - Get a list of all servers inside a project. + Get a list of all volume performance classes available inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param details: Show detailed information about server. - :type details: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -16003,9 +18049,8 @@ def list_servers_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_servers_serialize( + _param = self._list_volume_performance_classes_serialize( project_id=project_id, - details=details, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -16014,7 +18059,7 @@ def list_servers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "200": "VolumePerformanceClassListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -16024,10 +18069,9 @@ def list_servers_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_servers_serialize( + def _list_volume_performance_classes_serialize( self, project_id, - details, label_selector, _request_auth, _content_type, @@ -16050,10 +18094,6 @@ def _list_servers_serialize( if project_id is not None: _path_params["projectId"] = project_id # process the query parameters - if details is not None: - - _query_params.append(("details", details)) - if label_selector is not None: _query_params.append(("label_selector", label_selector)) @@ -16071,7 +18111,7 @@ def _list_servers_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers", + resource_path="/v1beta1/projects/{projectId}/volume-performance-classes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -21136,6 +23176,276 @@ def _update_attached_volume_serialize( _request_auth=_request_auth, ) + @validate_call + def update_key_pair( + self, + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + update_key_pair_payload: Annotated[ + UpdateKeyPairPayload, Field(description="Request an update of an SSH keypair.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Keypair: + """Update information of an SSH keypair. + + Update labels of the SSH keypair. + + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str + :param update_key_pair_payload: Request an update of an SSH keypair. (required) + :type update_key_pair_payload: UpdateKeyPairPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_key_pair_serialize( + keypair_name=keypair_name, + update_key_pair_payload=update_key_pair_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Keypair", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_key_pair_with_http_info( + self, + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + update_key_pair_payload: Annotated[ + UpdateKeyPairPayload, Field(description="Request an update of an SSH keypair.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Keypair]: + """Update information of an SSH keypair. + + Update labels of the SSH keypair. + + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str + :param update_key_pair_payload: Request an update of an SSH keypair. (required) + :type update_key_pair_payload: UpdateKeyPairPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_key_pair_serialize( + keypair_name=keypair_name, + update_key_pair_payload=update_key_pair_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Keypair", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_key_pair_without_preload_content( + self, + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + update_key_pair_payload: Annotated[ + UpdateKeyPairPayload, Field(description="Request an update of an SSH keypair.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update information of an SSH keypair. + + Update labels of the SSH keypair. + + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str + :param update_key_pair_payload: Request an update of an SSH keypair. (required) + :type update_key_pair_payload: UpdateKeyPairPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_key_pair_serialize( + keypair_name=keypair_name, + update_key_pair_payload=update_key_pair_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Keypair", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_key_pair_serialize( + self, + keypair_name, + update_key_pair_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if keypair_name is not None: + _path_params["keypairName"] = keypair_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_key_pair_payload is not None: + _body_params = update_key_pair_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/v1beta1/keypairs/{keypairName}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def update_network_area_route( self, @@ -21487,7 +23797,7 @@ def update_nic( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], - update_nic_payload: Annotated[UpdateNICPayload, Field(description="Request an update of a network interface.")], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21509,7 +23819,7 @@ def update_nic( :param nic_id: The identifier (ID) of a network interface. (required) :type nic_id: str :param update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNICPayload + :type update_nic_payload: UpdateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -21574,7 +23884,7 @@ def update_nic_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], - update_nic_payload: Annotated[UpdateNICPayload, Field(description="Request an update of a network interface.")], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21596,7 +23906,7 @@ def update_nic_with_http_info( :param nic_id: The identifier (ID) of a network interface. (required) :type nic_id: str :param update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNICPayload + :type update_nic_payload: UpdateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -21661,7 +23971,7 @@ def update_nic_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], - update_nic_payload: Annotated[UpdateNICPayload, Field(description="Request an update of a network interface.")], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21683,7 +23993,7 @@ def update_nic_without_preload_content( :param nic_id: The identifier (ID) of a network interface. (required) :type nic_id: str :param update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNICPayload + :type update_nic_payload: UpdateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of diff --git a/services/iaas/src/stackit/iaas/models/__init__.py b/services/iaas/src/stackit/iaas/models/__init__.py index 7483e8f1..6ea46fab 100644 --- a/services/iaas/src/stackit/iaas/models/__init__.py +++ b/services/iaas/src/stackit/iaas/models/__init__.py @@ -25,6 +25,7 @@ from stackit.iaas.models.boot_volume_source import BootVolumeSource from stackit.iaas.models.create_area_address_family import CreateAreaAddressFamily from stackit.iaas.models.create_area_ipv4 import CreateAreaIPv4 +from stackit.iaas.models.create_key_pair_payload import CreateKeyPairPayload from stackit.iaas.models.create_network_address_family import CreateNetworkAddressFamily from stackit.iaas.models.create_network_area_payload import CreateNetworkAreaPayload from stackit.iaas.models.create_network_area_range_payload import ( @@ -36,7 +37,7 @@ from stackit.iaas.models.create_network_ipv4_body import CreateNetworkIPv4Body from stackit.iaas.models.create_network_ipv6_body import CreateNetworkIPv6Body from stackit.iaas.models.create_network_payload import CreateNetworkPayload -from stackit.iaas.models.create_nic_payload import CreateNICPayload +from stackit.iaas.models.create_nic_payload import CreateNicPayload from stackit.iaas.models.create_protocol import CreateProtocol from stackit.iaas.models.create_public_ip_payload import CreatePublicIPPayload from stackit.iaas.models.create_security_group_payload import CreateSecurityGroupPayload @@ -59,6 +60,10 @@ from stackit.iaas.models.get_server_log200_response import GetServerLog200Response from stackit.iaas.models.get_server_log_request import GetServerLogRequest from stackit.iaas.models.icmp_parameters import ICMPParameters +from stackit.iaas.models.key_pair_list_response import KeyPairListResponse +from stackit.iaas.models.keypair import Keypair +from stackit.iaas.models.machine_type import MachineType +from stackit.iaas.models.machine_type_list_response import MachineTypeListResponse from stackit.iaas.models.network import Network from stackit.iaas.models.network_area import NetworkArea from stackit.iaas.models.network_area_ipv4 import NetworkAreaIPv4 @@ -106,13 +111,14 @@ from stackit.iaas.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaas.models.update_key_pair_payload import UpdateKeyPairPayload from stackit.iaas.models.update_network_address_family import UpdateNetworkAddressFamily from stackit.iaas.models.update_network_area_route_payload import ( UpdateNetworkAreaRoutePayload, ) from stackit.iaas.models.update_network_ipv4_body import UpdateNetworkIPv4Body from stackit.iaas.models.update_network_ipv6_body import UpdateNetworkIPv6Body -from stackit.iaas.models.update_nic_payload import UpdateNICPayload +from stackit.iaas.models.update_nic_payload import UpdateNicPayload from stackit.iaas.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaas.models.update_security_group_payload import UpdateSecurityGroupPayload from stackit.iaas.models.update_server_payload import UpdateServerPayload @@ -123,4 +129,8 @@ VolumeAttachmentListResponse, ) from stackit.iaas.models.volume_list_response import VolumeListResponse +from stackit.iaas.models.volume_performance_class import VolumePerformanceClass +from stackit.iaas.models.volume_performance_class_list_response import ( + VolumePerformanceClassListResponse, +) from stackit.iaas.models.volume_source import VolumeSource diff --git a/services/iaas/src/stackit/iaas/models/area_prefix_config_ipv4.py b/services/iaas/src/stackit/iaas/models/area_prefix_config_ipv4.py index 6ca9ca5e..f6e5ddb9 100644 --- a/services/iaas/src/stackit/iaas/models/area_prefix_config_ipv4.py +++ b/services/iaas/src/stackit/iaas/models/area_prefix_config_ipv4.py @@ -35,7 +35,7 @@ class AreaPrefixConfigIPv4(BaseModel): max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( + min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" ) __properties: ClassVar[List[str]] = ["defaultPrefixLen", "maxPrefixLen", "minPrefixLen"] diff --git a/services/iaas/src/stackit/iaas/models/create_area_ipv4.py b/services/iaas/src/stackit/iaas/models/create_area_ipv4.py index 36614684..f44a4341 100644 --- a/services/iaas/src/stackit/iaas/models/create_area_ipv4.py +++ b/services/iaas/src/stackit/iaas/models/create_area_ipv4.py @@ -49,7 +49,7 @@ class CreateAreaIPv4(BaseModel): max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( + min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" ) __properties: ClassVar[List[str]] = [ diff --git a/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py b/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py new file mode 100644 index 00000000..ab9e2391 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class CreateKeyPairPayload(BaseModel): + """ + Object that represents the public key of an SSH keypair and its name. + """ + + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) + fingerprint: Optional[Annotated[str, Field(min_length=47, strict=True, max_length=47)]] = Field( + default=None, description="Object that represents an SSH keypair MD5 fingerprint." + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( + default=None, + description="The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-].", + ) + public_key: Annotated[str, Field(strict=True)] = Field( + description="Object that represents a public SSH key.", alias="publicKey" + ) + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + __properties: ClassVar[List[str]] = ["createdAt", "fingerprint", "labels", "name", "publicKey", "updatedAt"] + + @field_validator("fingerprint") + def fingerprint_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$", value): + raise ValueError(r"must validate the regular expression /^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$/") + return value + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[A-Za-z0-9@._-]*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9@._-]*$/") + return value + + @field_validator("public_key") + def public_key_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(ssh-rsa|ssh-ed25519)\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$", value): + raise ValueError( + r"must validate the regular expression /^(ssh-rsa|ssh-ed25519)\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$/" + ) + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateKeyPairPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "created_at", + "fingerprint", + "updated_at", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateKeyPairPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "createdAt": obj.get("createdAt"), + "fingerprint": obj.get("fingerprint"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "publicKey": obj.get("publicKey"), + "updatedAt": obj.get("updatedAt"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/create_network_ipv4_body.py b/services/iaas/src/stackit/iaas/models/create_network_ipv4_body.py index 1216c4ea..ca385c1a 100644 --- a/services/iaas/src/stackit/iaas/models/create_network_ipv4_body.py +++ b/services/iaas/src/stackit/iaas/models/create_network_ipv4_body.py @@ -38,9 +38,7 @@ class CreateNetworkIPv4Body(BaseModel): prefix: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Classless Inter-Domain Routing (CIDR)." ) - prefix_length: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( - default=None, alias="prefixLength" - ) + prefix_length: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field(default=None, alias="prefixLength") __properties: ClassVar[List[str]] = ["gateway", "nameservers", "prefix", "prefixLength"] @field_validator("gateway") diff --git a/services/iaas/src/stackit/iaas/models/create_nic_payload.py b/services/iaas/src/stackit/iaas/models/create_nic_payload.py index 4b4779cf..88c646f9 100644 --- a/services/iaas/src/stackit/iaas/models/create_nic_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_nic_payload.py @@ -32,7 +32,7 @@ from stackit.iaas.models.allowed_addresses_inner import AllowedAddressesInner -class CreateNICPayload(BaseModel): +class CreateNicPayload(BaseModel): """ Object that represents a network interface. """ @@ -193,7 +193,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateNICPayload from a JSON string""" + """Create an instance of CreateNicPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -239,7 +239,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateNICPayload from a dict""" + """Create an instance of CreateNicPayload from a dict""" if obj is None: return None diff --git a/services/iaas/src/stackit/iaas/models/create_volume_payload.py b/services/iaas/src/stackit/iaas/models/create_volume_payload.py index f317ee04..d5075398 100644 --- a/services/iaas/src/stackit/iaas/models/create_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_volume_payload.py @@ -20,7 +20,15 @@ from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) from typing_extensions import Annotated, Self from stackit.iaas.models.volume_source import VolumeSource @@ -34,6 +42,7 @@ class CreateVolumePayload(BaseModel): availability_zone: StrictStr = Field( description="Object that represents an availability zone.", alias="availabilityZone" ) + bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) @@ -65,6 +74,7 @@ class CreateVolumePayload(BaseModel): ) __properties: ClassVar[List[str]] = [ "availabilityZone", + "bootable", "createdAt", "description", "id", @@ -189,6 +199,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "availabilityZone": obj.get("availabilityZone"), + "bootable": obj.get("bootable"), "createdAt": obj.get("createdAt"), "description": obj.get("description"), "id": obj.get("id"), diff --git a/services/iaas/src/stackit/iaas/models/key_pair_list_response.py b/services/iaas/src/stackit/iaas/models/key_pair_list_response.py new file mode 100644 index 00000000..657f2ec9 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/key_pair_list_response.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaas.models.keypair import Keypair + + +class KeyPairListResponse(BaseModel): + """ + SSH keypair list response. + """ + + items: List[Keypair] = Field(description="A list of SSH keypairs.") + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of KeyPairListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of KeyPairListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"items": [Keypair.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/keypair.py b/services/iaas/src/stackit/iaas/models/keypair.py new file mode 100644 index 00000000..d11d1d03 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/keypair.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class Keypair(BaseModel): + """ + Object that represents the public key of an SSH keypair and its name. + """ + + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) + fingerprint: Optional[Annotated[str, Field(min_length=47, strict=True, max_length=47)]] = Field( + default=None, description="Object that represents an SSH keypair MD5 fingerprint." + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( + default=None, + description="The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-].", + ) + public_key: Annotated[str, Field(strict=True)] = Field( + description="Object that represents a public SSH key.", alias="publicKey" + ) + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + __properties: ClassVar[List[str]] = ["createdAt", "fingerprint", "labels", "name", "publicKey", "updatedAt"] + + @field_validator("fingerprint") + def fingerprint_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$", value): + raise ValueError(r"must validate the regular expression /^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$/") + return value + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[A-Za-z0-9@._-]*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9@._-]*$/") + return value + + @field_validator("public_key") + def public_key_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(ssh-rsa|ssh-ed25519)\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$", value): + raise ValueError( + r"must validate the regular expression /^(ssh-rsa|ssh-ed25519)\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$/" + ) + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Keypair from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "created_at", + "fingerprint", + "updated_at", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Keypair from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "createdAt": obj.get("createdAt"), + "fingerprint": obj.get("fingerprint"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "publicKey": obj.get("publicKey"), + "updatedAt": obj.get("updatedAt"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/machine_type.py b/services/iaas/src/stackit/iaas/models/machine_type.py new file mode 100644 index 00000000..3491d65c --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/machine_type.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator +from typing_extensions import Annotated, Self + + +class MachineType(BaseModel): + """ + Machine Type. + """ + + description: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( + default=None, description="Description Object. Allows string up to 127 Characters." + ) + disk: StrictInt = Field(description="Size in Gigabyte.") + extra_specs: Optional[Dict[str, Any]] = Field( + default=None, + description="Properties to control certain aspects or scheduling behavior for an object.", + alias="extraSpecs", + ) + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + ram: StrictInt = Field(description="Size in Megabyte.") + vcpus: Annotated[int, Field(strict=True, ge=1)] = Field(description="The number of virtual CPUs of a server.") + __properties: ClassVar[List[str]] = ["description", "disk", "extraSpecs", "name", "ram", "vcpus"] + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MachineType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MachineType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "disk": obj.get("disk"), + "extraSpecs": obj.get("extraSpecs"), + "name": obj.get("name"), + "ram": obj.get("ram"), + "vcpus": obj.get("vcpus"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/machine_type_list_response.py b/services/iaas/src/stackit/iaas/models/machine_type_list_response.py new file mode 100644 index 00000000..10bb3d01 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/machine_type_list_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaas.models.machine_type import MachineType + + +class MachineTypeListResponse(BaseModel): + """ + Machine type list response. + """ + + items: List[MachineType] = Field(description="Machine type list.") + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MachineTypeListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MachineTypeListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "items": ( + [MachineType.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ) + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/network_area_ipv4.py b/services/iaas/src/stackit/iaas/models/network_area_ipv4.py index b8d1ac55..02182824 100644 --- a/services/iaas/src/stackit/iaas/models/network_area_ipv4.py +++ b/services/iaas/src/stackit/iaas/models/network_area_ipv4.py @@ -49,7 +49,7 @@ class NetworkAreaIPv4(BaseModel): max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( + min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" ) __properties: ClassVar[List[str]] = [ diff --git a/services/iaas/src/stackit/iaas/models/update_area_ipv4.py b/services/iaas/src/stackit/iaas/models/update_area_ipv4.py index d96d7aa3..a3507a8d 100644 --- a/services/iaas/src/stackit/iaas/models/update_area_ipv4.py +++ b/services/iaas/src/stackit/iaas/models/update_area_ipv4.py @@ -38,7 +38,7 @@ class UpdateAreaIPv4(BaseModel): max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( + min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" ) __properties: ClassVar[List[str]] = ["defaultNameservers", "defaultPrefixLen", "maxPrefixLen", "minPrefixLen"] diff --git a/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py b/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py new file mode 100644 index 00000000..dca572d1 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + + +class UpdateKeyPairPayload(BaseModel): + """ + Object that represents an update request body of a public key of an SSH keypair. + """ + + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + __properties: ClassVar[List[str]] = ["labels"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateKeyPairPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateKeyPairPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"labels": obj.get("labels")}) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/update_nic_payload.py b/services/iaas/src/stackit/iaas/models/update_nic_payload.py index 18faa8bc..ee8d64e2 100644 --- a/services/iaas/src/stackit/iaas/models/update_nic_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_nic_payload.py @@ -25,7 +25,7 @@ from stackit.iaas.models.allowed_addresses_inner import AllowedAddressesInner -class UpdateNICPayload(BaseModel): +class UpdateNicPayload(BaseModel): """ Object that represents a network interface update. """ @@ -76,7 +76,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateNICPayload from a JSON string""" + """Create an instance of UpdateNicPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -107,7 +107,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateNICPayload from a dict""" + """Create an instance of UpdateNicPayload from a dict""" if obj is None: return None diff --git a/services/iaas/src/stackit/iaas/models/update_volume_payload.py b/services/iaas/src/stackit/iaas/models/update_volume_payload.py index 7875a60c..15b95e54 100644 --- a/services/iaas/src/stackit/iaas/models/update_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_volume_payload.py @@ -19,7 +19,7 @@ import re from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator from typing_extensions import Annotated, Self @@ -28,6 +28,7 @@ class UpdateVolumePayload(BaseModel): Object that represents an update request body of a volume. """ + bootable: Optional[StrictBool] = Field(default=False, description="Indicates if a volume is bootable.") description: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="Description Object. Allows string up to 127 Characters." ) @@ -37,7 +38,7 @@ class UpdateVolumePayload(BaseModel): name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." ) - __properties: ClassVar[List[str]] = ["description", "labels", "name"] + __properties: ClassVar[List[str]] = ["bootable", "description", "labels", "name"] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -98,6 +99,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"description": obj.get("description"), "labels": obj.get("labels"), "name": obj.get("name")} + { + "bootable": obj.get("bootable") if obj.get("bootable") is not None else False, + "description": obj.get("description"), + "labels": obj.get("labels"), + "name": obj.get("name"), + } ) return _obj diff --git a/services/iaas/src/stackit/iaas/models/volume.py b/services/iaas/src/stackit/iaas/models/volume.py index 12cd4f41..69b713d3 100644 --- a/services/iaas/src/stackit/iaas/models/volume.py +++ b/services/iaas/src/stackit/iaas/models/volume.py @@ -20,7 +20,15 @@ from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) from typing_extensions import Annotated, Self from stackit.iaas.models.volume_source import VolumeSource @@ -34,6 +42,7 @@ class Volume(BaseModel): availability_zone: StrictStr = Field( description="Object that represents an availability zone.", alias="availabilityZone" ) + bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) @@ -65,6 +74,7 @@ class Volume(BaseModel): ) __properties: ClassVar[List[str]] = [ "availabilityZone", + "bootable", "createdAt", "description", "id", @@ -189,6 +199,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "availabilityZone": obj.get("availabilityZone"), + "bootable": obj.get("bootable"), "createdAt": obj.get("createdAt"), "description": obj.get("description"), "id": obj.get("id"), diff --git a/services/iaas/src/stackit/iaas/models/volume_performance_class.py b/services/iaas/src/stackit/iaas/models/volume_performance_class.py new file mode 100644 index 00000000..c5608e5c --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/volume_performance_class.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator +from typing_extensions import Annotated, Self + + +class VolumePerformanceClass(BaseModel): + """ + Object that represents a Volume performance class. + """ + + description: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( + default=None, description="Description Object. Allows string up to 127 Characters." + ) + iops: Optional[StrictInt] = Field(default=None, description="Input/Output Operations per second.") + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + throughput: Optional[StrictInt] = Field(default=None, description="Throughput in Megabyte per second.") + __properties: ClassVar[List[str]] = ["description", "iops", "labels", "name", "throughput"] + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VolumePerformanceClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VolumePerformanceClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "iops": obj.get("iops"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "throughput": obj.get("throughput"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/volume_performance_class_list_response.py b/services/iaas/src/stackit/iaas/models/volume_performance_class_list_response.py new file mode 100644 index 00000000..0d434d7b --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/volume_performance_class_list_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaas.models.volume_performance_class import VolumePerformanceClass + + +class VolumePerformanceClassListResponse(BaseModel): + """ + Volume performance class list response. + """ + + items: List[VolumePerformanceClass] = Field(description="A list containing Volume performance classes.") + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VolumePerformanceClassListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VolumePerformanceClassListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "items": ( + [VolumePerformanceClass.from_dict(_item) for _item in obj["items"]] + if obj.get("items") is not None + else None + ) + } + ) + return _obj