From 8f10cdb60fb74ff848512291076975743e1283bf Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 31 Jul 2025 15:23:20 +0000 Subject: [PATCH] Generate iaas --- services/iaas/src/stackit/iaas/__init__.py | 6 + .../iaas/src/stackit/iaas/models/__init__.py | 2 + .../iaas/src/stackit/iaas/models/backup.py | 2 +- .../iaas/models/base_security_group_rule.py | 8 +- .../iaas/models/create_backup_payload.py | 2 +- .../iaas/models/create_image_payload.py | 13 +- .../iaas/models/create_key_pair_payload.py | 2 +- .../models/create_network_area_payload.py | 2 +- .../iaas/models/create_network_payload.py | 2 +- .../stackit/iaas/models/create_nic_payload.py | 8 +- .../iaas/models/create_public_ip_payload.py | 2 +- .../models/create_security_group_payload.py | 2 +- .../create_security_group_rule_payload.py | 8 +- .../iaas/models/create_server_payload.py | 4 +- .../iaas/models/create_snapshot_payload.py | 2 +- .../iaas/models/create_volume_payload.py | 20 ++- .../iaas/src/stackit/iaas/models/image.py | 13 +- .../src/stackit/iaas/models/image_agent.py | 92 ++++++++++ .../src/stackit/iaas/models/image_checksum.py | 4 +- .../src/stackit/iaas/models/image_config.py | 37 +++- .../iaas/src/stackit/iaas/models/keypair.py | 2 +- .../iaas/src/stackit/iaas/models/network.py | 2 +- .../src/stackit/iaas/models/network_area.py | 2 +- services/iaas/src/stackit/iaas/models/nic.py | 8 +- .../partial_update_network_area_payload.py | 2 +- .../models/partial_update_network_payload.py | 2 +- .../iaas/src/stackit/iaas/models/public_ip.py | 2 +- .../iaas/src/stackit/iaas/models/route.py | 2 +- .../src/stackit/iaas/models/security_group.py | 2 +- .../iaas/models/security_group_rule.py | 8 +- .../iaas/src/stackit/iaas/models/server.py | 4 +- .../stackit/iaas/models/server_maintenance.py | 2 +- .../iaas/src/stackit/iaas/models/snapshot.py | 2 +- .../iaas/models/update_backup_payload.py | 2 +- .../iaas/models/update_image_payload.py | 23 ++- .../iaas/models/update_key_pair_payload.py | 2 +- .../update_network_area_route_payload.py | 2 +- .../stackit/iaas/models/update_nic_payload.py | 2 +- .../iaas/models/update_public_ip_payload.py | 2 +- .../models/update_security_group_payload.py | 2 +- .../iaas/models/update_server_payload.py | 4 +- .../iaas/models/update_snapshot_payload.py | 2 +- .../iaas/models/update_volume_payload.py | 4 +- .../iaas/src/stackit/iaas/models/volume.py | 20 ++- .../models/volume_encryption_parameter.py | 169 ++++++++++++++++++ .../iaas/models/volume_performance_class.py | 2 +- 46 files changed, 441 insertions(+), 66 deletions(-) create mode 100644 services/iaas/src/stackit/iaas/models/image_agent.py create mode 100644 services/iaas/src/stackit/iaas/models/volume_encryption_parameter.py diff --git a/services/iaas/src/stackit/iaas/__init__.py b/services/iaas/src/stackit/iaas/__init__.py index 1b2bff33..af58a7ed 100644 --- a/services/iaas/src/stackit/iaas/__init__.py +++ b/services/iaas/src/stackit/iaas/__init__.py @@ -72,6 +72,7 @@ "GetServerLog200Response", "ICMPParameters", "Image", + "ImageAgent", "ImageChecksum", "ImageConfig", "ImageCreateResponse", @@ -144,6 +145,7 @@ "Volume", "VolumeAttachment", "VolumeAttachmentListResponse", + "VolumeEncryptionParameter", "VolumeListResponse", "VolumePerformanceClass", "VolumePerformanceClassListResponse", @@ -268,6 +270,7 @@ ) from stackit.iaas.models.icmp_parameters import ICMPParameters as ICMPParameters from stackit.iaas.models.image import Image as Image +from stackit.iaas.models.image_agent import ImageAgent as ImageAgent from stackit.iaas.models.image_checksum import ImageChecksum as ImageChecksum from stackit.iaas.models.image_config import ImageConfig as ImageConfig from stackit.iaas.models.image_create_response import ( @@ -426,6 +429,9 @@ from stackit.iaas.models.volume_attachment_list_response import ( VolumeAttachmentListResponse as VolumeAttachmentListResponse, ) +from stackit.iaas.models.volume_encryption_parameter import ( + VolumeEncryptionParameter as VolumeEncryptionParameter, +) from stackit.iaas.models.volume_list_response import ( VolumeListResponse as VolumeListResponse, ) diff --git a/services/iaas/src/stackit/iaas/models/__init__.py b/services/iaas/src/stackit/iaas/models/__init__.py index b1d5a29a..c0aa4e43 100644 --- a/services/iaas/src/stackit/iaas/models/__init__.py +++ b/services/iaas/src/stackit/iaas/models/__init__.py @@ -72,6 +72,7 @@ from stackit.iaas.models.get_server_log200_response import GetServerLog200Response from stackit.iaas.models.icmp_parameters import ICMPParameters from stackit.iaas.models.image import Image +from stackit.iaas.models.image_agent import ImageAgent from stackit.iaas.models.image_checksum import ImageChecksum from stackit.iaas.models.image_config import ImageConfig from stackit.iaas.models.image_create_response import ImageCreateResponse @@ -158,6 +159,7 @@ from stackit.iaas.models.volume_attachment_list_response import ( VolumeAttachmentListResponse, ) +from stackit.iaas.models.volume_encryption_parameter import VolumeEncryptionParameter 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 ( diff --git a/services/iaas/src/stackit/iaas/models/backup.py b/services/iaas/src/stackit/iaas/models/backup.py index 4fc97d81..17de0cb3 100644 --- a/services/iaas/src/stackit/iaas/models/backup.py +++ b/services/iaas/src/stackit/iaas/models/backup.py @@ -40,7 +40,7 @@ class Backup(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/base_security_group_rule.py b/services/iaas/src/stackit/iaas/models/base_security_group_rule.py index a36bf603..4e4fa087 100644 --- a/services/iaas/src/stackit/iaas/models/base_security_group_rule.py +++ b/services/iaas/src/stackit/iaas/models/base_security_group_rule.py @@ -34,8 +34,12 @@ class BaseSecurityGroupRule(BaseModel): description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) - direction: StrictStr = Field(description="The direction of the traffic which the rule should match.") - ethertype: Optional[StrictStr] = Field(default="IPv4", description="The ethertype which the rule should match.") + direction: StrictStr = Field( + description="The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`." + ) + ethertype: Optional[StrictStr] = Field( + default="IPv4", description="The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`." + ) icmp_parameters: Optional[ICMPParameters] = Field(default=None, alias="icmpParameters") id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." diff --git a/services/iaas/src/stackit/iaas/models/create_backup_payload.py b/services/iaas/src/stackit/iaas/models/create_backup_payload.py index e33de676..a2c46328 100644 --- a/services/iaas/src/stackit/iaas/models/create_backup_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_backup_payload.py @@ -32,7 +32,7 @@ class CreateBackupPayload(BaseModel): labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/create_image_payload.py b/services/iaas/src/stackit/iaas/models/create_image_payload.py index 562ba56a..42524a69 100644 --- a/services/iaas/src/stackit/iaas/models/create_image_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_image_payload.py @@ -31,6 +31,7 @@ ) from typing_extensions import Annotated, Self +from stackit.iaas.models.image_agent import ImageAgent from stackit.iaas.models.image_checksum import ImageChecksum from stackit.iaas.models.image_config import ImageConfig @@ -40,6 +41,7 @@ class CreateImagePayload(BaseModel): Object that represents an Image and its parameters. Used for Creating and returning (get/list). """ # noqa: E501 + agent: Optional[ImageAgent] = None checksum: Optional[ImageChecksum] = None config: Optional[ImageConfig] = None created_at: Optional[datetime] = Field( @@ -53,7 +55,7 @@ class CreateImagePayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") @@ -63,7 +65,9 @@ class CreateImagePayload(BaseModel): owner: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) - protected: Optional[StrictBool] = None + protected: Optional[StrictBool] = Field( + default=None, description="When true the image is prevented from being deleted." + ) scope: Optional[StrictStr] = Field( default=None, description="Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`." ) @@ -76,6 +80,7 @@ class CreateImagePayload(BaseModel): default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) __properties: ClassVar[List[str]] = [ + "agent", "checksum", "config", "createdAt", @@ -180,6 +185,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict["agent"] = self.agent.to_dict() # override the default output from pydantic by calling `to_dict()` of checksum if self.checksum: _dict["checksum"] = self.checksum.to_dict() @@ -199,6 +207,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "agent": ImageAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "checksum": ImageChecksum.from_dict(obj["checksum"]) if obj.get("checksum") is not None else None, "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, "createdAt": obj.get("createdAt"), 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 index d2774554..8ab59129 100644 --- a/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py @@ -37,7 +37,7 @@ class CreateKeyPairPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, diff --git a/services/iaas/src/stackit/iaas/models/create_network_area_payload.py b/services/iaas/src/stackit/iaas/models/create_network_area_payload.py index 99a3156e..801306c0 100644 --- a/services/iaas/src/stackit/iaas/models/create_network_area_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_network_area_payload.py @@ -33,7 +33,7 @@ class CreateNetworkAreaPayload(BaseModel): address_family: CreateAreaAddressFamily = Field(alias="addressFamily") labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/create_network_payload.py b/services/iaas/src/stackit/iaas/models/create_network_payload.py index fb3ba3f3..028b4e64 100644 --- a/services/iaas/src/stackit/iaas/models/create_network_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_network_payload.py @@ -34,7 +34,7 @@ class CreateNetworkPayload(BaseModel): dhcp: Optional[StrictBool] = Field(default=None, description="Enable or disable DHCP for a network.") labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs." 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 06eda0bc..f162f5aa 100644 --- a/services/iaas/src/stackit/iaas/models/create_nic_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_nic_payload.py @@ -54,7 +54,7 @@ class CreateNicPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) mac: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Object that represents an MAC address." @@ -73,8 +73,10 @@ class CreateNicPayload(BaseModel): security_groups: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( default=None, description="A list of UUIDs.", alias="securityGroups" ) - status: Optional[StrictStr] = None - type: Optional[StrictStr] = None + status: Optional[StrictStr] = Field(default=None, description="Possible values: `ACTIVE`, `DOWN`.") + type: Optional[StrictStr] = Field( + default=None, description="Possible values: `server`, `metadata`, `gateway`, `none`." + ) __properties: ClassVar[List[str]] = [ "allowedAddresses", "device", diff --git a/services/iaas/src/stackit/iaas/models/create_public_ip_payload.py b/services/iaas/src/stackit/iaas/models/create_public_ip_payload.py index 7efca6bd..a8893ba6 100644 --- a/services/iaas/src/stackit/iaas/models/create_public_ip_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_public_ip_payload.py @@ -36,7 +36,7 @@ class CreatePublicIPPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Associate the public IP with a network interface (ID).", alias="networkInterface" diff --git a/services/iaas/src/stackit/iaas/models/create_security_group_payload.py b/services/iaas/src/stackit/iaas/models/create_security_group_payload.py index ce5a309e..d2b8e9b3 100644 --- a/services/iaas/src/stackit/iaas/models/create_security_group_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_security_group_payload.py @@ -42,7 +42,7 @@ class CreateSecurityGroupPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/create_security_group_rule_payload.py b/services/iaas/src/stackit/iaas/models/create_security_group_rule_payload.py index 85574db7..e19c7082 100644 --- a/services/iaas/src/stackit/iaas/models/create_security_group_rule_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_security_group_rule_payload.py @@ -35,8 +35,12 @@ class CreateSecurityGroupRulePayload(BaseModel): description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) - direction: StrictStr = Field(description="The direction of the traffic which the rule should match.") - ethertype: Optional[StrictStr] = Field(default="IPv4", description="The ethertype which the rule should match.") + direction: StrictStr = Field( + description="The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`." + ) + ethertype: Optional[StrictStr] = Field( + default="IPv4", description="The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`." + ) icmp_parameters: Optional[ICMPParameters] = Field(default=None, alias="icmpParameters") id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." diff --git a/services/iaas/src/stackit/iaas/models/create_server_payload.py b/services/iaas/src/stackit/iaas/models/create_server_payload.py index 5d728c37..54159cf6 100644 --- a/services/iaas/src/stackit/iaas/models/create_server_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_server_payload.py @@ -67,7 +67,7 @@ class CreateServerPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) launched_at: Optional[datetime] = Field( default=None, description="Date-time when resource was launched.", alias="launchedAt" @@ -78,7 +78,7 @@ class CreateServerPayload(BaseModel): maintenance_window: Optional[ServerMaintenance] = Field(default=None, alias="maintenanceWindow") metadata: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`.", + description="Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key.", ) name: Annotated[str, Field(strict=True, max_length=63)] = Field(description="The name for a Server.") networking: Optional[CreateServerPayloadNetworking] = None diff --git a/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py b/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py index f29279a7..7ee5d054 100644 --- a/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py @@ -37,7 +37,7 @@ class CreateSnapshotPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." 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 5a5c4c72..a23cf6a3 100644 --- a/services/iaas/src/stackit/iaas/models/create_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_volume_payload.py @@ -32,12 +32,13 @@ from typing_extensions import Annotated, Self from stackit.iaas.models.image_config import ImageConfig +from stackit.iaas.models.volume_encryption_parameter import VolumeEncryptionParameter from stackit.iaas.models.volume_source import VolumeSource class CreateVolumePayload(BaseModel): """ - Object that represents a volume and its parameters. Used for Creating and returning (get/list). + Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. """ # noqa: E501 availability_zone: StrictStr = Field( @@ -50,13 +51,15 @@ class CreateVolumePayload(BaseModel): description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) + encrypted: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is encrypted.") + encryption_parameters: Optional[VolumeEncryptionParameter] = Field(default=None, alias="encryptionParameters") id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." @@ -83,6 +86,8 @@ class CreateVolumePayload(BaseModel): "bootable", "createdAt", "description", + "encrypted", + "encryptionParameters", "id", "imageConfig", "labels", @@ -174,10 +179,12 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ "created_at", + "encrypted", "id", "image_config", "server_id", @@ -191,6 +198,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of encryption_parameters + if self.encryption_parameters: + _dict["encryptionParameters"] = self.encryption_parameters.to_dict() # override the default output from pydantic by calling `to_dict()` of image_config if self.image_config: _dict["imageConfig"] = self.image_config.to_dict() @@ -214,6 +224,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "bootable": obj.get("bootable"), "createdAt": obj.get("createdAt"), "description": obj.get("description"), + "encrypted": obj.get("encrypted"), + "encryptionParameters": ( + VolumeEncryptionParameter.from_dict(obj["encryptionParameters"]) + if obj.get("encryptionParameters") is not None + else None + ), "id": obj.get("id"), "imageConfig": ( ImageConfig.from_dict(obj["imageConfig"]) if obj.get("imageConfig") is not None else None diff --git a/services/iaas/src/stackit/iaas/models/image.py b/services/iaas/src/stackit/iaas/models/image.py index 77aa70b9..aa2d89b7 100644 --- a/services/iaas/src/stackit/iaas/models/image.py +++ b/services/iaas/src/stackit/iaas/models/image.py @@ -31,6 +31,7 @@ ) from typing_extensions import Annotated, Self +from stackit.iaas.models.image_agent import ImageAgent from stackit.iaas.models.image_checksum import ImageChecksum from stackit.iaas.models.image_config import ImageConfig @@ -40,6 +41,7 @@ class Image(BaseModel): Object that represents an Image and its parameters. Used for Creating and returning (get/list). """ # noqa: E501 + agent: Optional[ImageAgent] = None checksum: Optional[ImageChecksum] = None config: Optional[ImageConfig] = None created_at: Optional[datetime] = Field( @@ -53,7 +55,7 @@ class Image(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") @@ -63,7 +65,9 @@ class Image(BaseModel): owner: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) - protected: Optional[StrictBool] = None + protected: Optional[StrictBool] = Field( + default=None, description="When true the image is prevented from being deleted." + ) scope: Optional[StrictStr] = Field( default=None, description="Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`." ) @@ -76,6 +80,7 @@ class Image(BaseModel): default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) __properties: ClassVar[List[str]] = [ + "agent", "checksum", "config", "createdAt", @@ -180,6 +185,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict["agent"] = self.agent.to_dict() # override the default output from pydantic by calling `to_dict()` of checksum if self.checksum: _dict["checksum"] = self.checksum.to_dict() @@ -199,6 +207,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "agent": ImageAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "checksum": ImageChecksum.from_dict(obj["checksum"]) if obj.get("checksum") is not None else None, "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, "createdAt": obj.get("createdAt"), diff --git a/services/iaas/src/stackit/iaas/models/image_agent.py b/services/iaas/src/stackit/iaas/models/image_agent.py new file mode 100644 index 00000000..216daf59 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/image_agent.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing_extensions import Self + + +class ImageAgent(BaseModel): + """ + Support status and default provioning setting for the STACKIT server agent. + """ # noqa: E501 + + provision_by_default: Optional[StrictBool] = Field( + default=None, + description="Default provioning of the STACKIT server agent for new servers. The default for new images is false. Can only be enabled when supported is also true.", + alias="provisionByDefault", + ) + supported: Optional[StrictBool] = Field( + default=None, + description="Indicates the STACKIT server agent for the image. The default for new images is false.", + ) + __properties: ClassVar[List[str]] = ["provisionByDefault", "supported"] + + 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 ImageAgent 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 ImageAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"provisionByDefault": obj.get("provisionByDefault"), "supported": obj.get("supported")} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/image_checksum.py b/services/iaas/src/stackit/iaas/models/image_checksum.py index 81cb6731..422423d7 100644 --- a/services/iaas/src/stackit/iaas/models/image_checksum.py +++ b/services/iaas/src/stackit/iaas/models/image_checksum.py @@ -28,7 +28,9 @@ class ImageChecksum(BaseModel): Representation of an image checksum. """ # noqa: E501 - algorithm: StrictStr = Field(description="Algorithm for the checksum of the image data.") + algorithm: StrictStr = Field( + description="Algorithm for the checksum of the image data. Possible values: `md5`, `sha512`." + ) digest: Annotated[str, Field(strict=True)] = Field(description="Hexdigest of the checksum of the image data.") __properties: ClassVar[List[str]] = ["algorithm", "digest"] diff --git a/services/iaas/src/stackit/iaas/models/image_config.py b/services/iaas/src/stackit/iaas/models/image_config.py index 104e09a5..8ba1b9cc 100644 --- a/services/iaas/src/stackit/iaas/models/image_config.py +++ b/services/iaas/src/stackit/iaas/models/image_config.py @@ -28,18 +28,31 @@ class ImageConfig(BaseModel): """ # noqa: E501 architecture: Optional[StrictStr] = Field( - default=None, description="Represents CPU architecture. The default for new images is x86." + default=None, + description="Represents CPU architecture. The default for new images is x86. Possible values: `arm64`, `x86`.", ) boot_menu: Optional[StrictBool] = Field( default=None, description="Enables the BIOS bootmenu. The default for new images is disabled.", alias="bootMenu" ) cdrom_bus: Optional[StrictStr] = Field( - default=None, description="Sets CDROM bus controller type.", alias="cdromBus" + default=None, + description="Sets CDROM bus controller type. Possible values: `scsi`, `virtio`, `ide`, `usb`.", + alias="cdromBus", + ) + disk_bus: Optional[StrictStr] = Field( + default=None, + description="Sets Disk bus controller type. Possible values: `scsi`, `virtio`, `ide`, `usb`.", + alias="diskBus", + ) + nic_model: Optional[StrictStr] = Field( + default=None, + description="Sets virtual nic model. Possible values: `e1000`, `e1000e`, `ne2k_pci`, `pcnet`, `rtl8139`, `virtio`, `vmxnet3`.", + alias="nicModel", ) - disk_bus: Optional[StrictStr] = Field(default=None, description="Sets Disk bus controller type.", alias="diskBus") - nic_model: Optional[StrictStr] = Field(default=None, description="Sets virtual nic model.", alias="nicModel") operating_system: Optional[StrictStr] = Field( - default=None, description="Enables OS specific optimizations.", alias="operatingSystem" + default=None, + description="Enables OS specific optimizations. Possible values: `windows`, `linux`.", + alias="operatingSystem", ) operating_system_distro: Optional[StrictStr] = Field( default=None, description="Operating System Distribution.", alias="operatingSystemDistro" @@ -48,10 +61,14 @@ class ImageConfig(BaseModel): default=None, description="Version of the OS.", alias="operatingSystemVersion" ) rescue_bus: Optional[StrictStr] = Field( - default=None, description="Sets the device bus when the image is used as a rescue image.", alias="rescueBus" + default=None, + description="Sets the device bus when the image is used as a rescue image. Possible values: `sata`, `scsi`, `virtio`, `usb`.", + alias="rescueBus", ) rescue_device: Optional[StrictStr] = Field( - default=None, description="Sets the device when the image is used as a rescue image.", alias="rescueDevice" + default=None, + description="Sets the device when the image is used as a rescue image. Possible values: `cdrom`, `disk`.", + alias="rescueDevice", ) secure_boot: Optional[StrictBool] = Field( default=None, description="Enables Secure Boot. The default for new images is disabled.", alias="secureBoot" @@ -59,7 +76,11 @@ class ImageConfig(BaseModel): uefi: Optional[StrictBool] = Field( default=None, description="Configure UEFI boot. The default for new images is enabled." ) - video_model: Optional[StrictStr] = Field(default=None, description="Sets Graphic device model.", alias="videoModel") + video_model: Optional[StrictStr] = Field( + default=None, + description="Sets Graphic device model. Possible values: `vga`, `cirrus`, `vmvga`, `qxl`, `virtio`, `none`.", + alias="videoModel", + ) virtio_scsi: Optional[StrictBool] = Field( default=None, description="Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO Block.", diff --git a/services/iaas/src/stackit/iaas/models/keypair.py b/services/iaas/src/stackit/iaas/models/keypair.py index 5434c7c3..cc0e9adc 100644 --- a/services/iaas/src/stackit/iaas/models/keypair.py +++ b/services/iaas/src/stackit/iaas/models/keypair.py @@ -37,7 +37,7 @@ class Keypair(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, diff --git a/services/iaas/src/stackit/iaas/models/network.py b/services/iaas/src/stackit/iaas/models/network.py index 069b6512..5fa55c10 100644 --- a/services/iaas/src/stackit/iaas/models/network.py +++ b/services/iaas/src/stackit/iaas/models/network.py @@ -50,7 +50,7 @@ class Network(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Annotated[str, Field(strict=True, max_length=255)] nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( diff --git a/services/iaas/src/stackit/iaas/models/network_area.py b/services/iaas/src/stackit/iaas/models/network_area.py index c5c1eb4d..653ef4fb 100644 --- a/services/iaas/src/stackit/iaas/models/network_area.py +++ b/services/iaas/src/stackit/iaas/models/network_area.py @@ -40,7 +40,7 @@ class NetworkArea(BaseModel): ipv4: Optional[NetworkAreaIPv4] = None labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: StrictStr project_count: Annotated[int, Field(strict=True, ge=0)] = Field( diff --git a/services/iaas/src/stackit/iaas/models/nic.py b/services/iaas/src/stackit/iaas/models/nic.py index 5f48577a..c485d18f 100644 --- a/services/iaas/src/stackit/iaas/models/nic.py +++ b/services/iaas/src/stackit/iaas/models/nic.py @@ -54,7 +54,7 @@ class NIC(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) mac: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Object that represents an MAC address." @@ -73,8 +73,10 @@ class NIC(BaseModel): security_groups: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( default=None, description="A list of UUIDs.", alias="securityGroups" ) - status: Optional[StrictStr] = None - type: Optional[StrictStr] = None + status: Optional[StrictStr] = Field(default=None, description="Possible values: `ACTIVE`, `DOWN`.") + type: Optional[StrictStr] = Field( + default=None, description="Possible values: `server`, `metadata`, `gateway`, `none`." + ) __properties: ClassVar[List[str]] = [ "allowedAddresses", "device", diff --git a/services/iaas/src/stackit/iaas/models/partial_update_network_area_payload.py b/services/iaas/src/stackit/iaas/models/partial_update_network_area_payload.py index a9c6d96a..96dc70df 100644 --- a/services/iaas/src/stackit/iaas/models/partial_update_network_area_payload.py +++ b/services/iaas/src/stackit/iaas/models/partial_update_network_area_payload.py @@ -33,7 +33,7 @@ class PartialUpdateNetworkAreaPayload(BaseModel): address_family: Optional[UpdateAreaAddressFamily] = Field(default=None, alias="addressFamily") labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/partial_update_network_payload.py b/services/iaas/src/stackit/iaas/models/partial_update_network_payload.py index 0b77afdd..d82ca6e1 100644 --- a/services/iaas/src/stackit/iaas/models/partial_update_network_payload.py +++ b/services/iaas/src/stackit/iaas/models/partial_update_network_payload.py @@ -34,7 +34,7 @@ class PartialUpdateNetworkPayload(BaseModel): dhcp: Optional[StrictBool] = Field(default=None, description="Enable or disable DHCP for a network.") labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/public_ip.py b/services/iaas/src/stackit/iaas/models/public_ip.py index eff76269..59ad9e8e 100644 --- a/services/iaas/src/stackit/iaas/models/public_ip.py +++ b/services/iaas/src/stackit/iaas/models/public_ip.py @@ -36,7 +36,7 @@ class PublicIp(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Associate the public IP with a network interface (ID).", alias="networkInterface" diff --git a/services/iaas/src/stackit/iaas/models/route.py b/services/iaas/src/stackit/iaas/models/route.py index 9dc4d39a..527db938 100644 --- a/services/iaas/src/stackit/iaas/models/route.py +++ b/services/iaas/src/stackit/iaas/models/route.py @@ -34,7 +34,7 @@ class Route(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) nexthop: Annotated[str, Field(strict=True)] = Field(description="Object that represents an IP address.") prefix: Annotated[str, Field(strict=True)] = Field(description="Classless Inter-Domain Routing (CIDR).") diff --git a/services/iaas/src/stackit/iaas/models/security_group.py b/services/iaas/src/stackit/iaas/models/security_group.py index 1407a0f7..37c37aac 100644 --- a/services/iaas/src/stackit/iaas/models/security_group.py +++ b/services/iaas/src/stackit/iaas/models/security_group.py @@ -42,7 +42,7 @@ class SecurityGroup(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/security_group_rule.py b/services/iaas/src/stackit/iaas/models/security_group_rule.py index 91897678..f88813ea 100644 --- a/services/iaas/src/stackit/iaas/models/security_group_rule.py +++ b/services/iaas/src/stackit/iaas/models/security_group_rule.py @@ -35,8 +35,12 @@ class SecurityGroupRule(BaseModel): description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) - direction: StrictStr = Field(description="The direction of the traffic which the rule should match.") - ethertype: Optional[StrictStr] = Field(default="IPv4", description="The ethertype which the rule should match.") + direction: StrictStr = Field( + description="The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`." + ) + ethertype: Optional[StrictStr] = Field( + default="IPv4", description="The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`." + ) icmp_parameters: Optional[ICMPParameters] = Field(default=None, alias="icmpParameters") id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." diff --git a/services/iaas/src/stackit/iaas/models/server.py b/services/iaas/src/stackit/iaas/models/server.py index 38ba4d7d..5180c52b 100644 --- a/services/iaas/src/stackit/iaas/models/server.py +++ b/services/iaas/src/stackit/iaas/models/server.py @@ -67,7 +67,7 @@ class Server(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) launched_at: Optional[datetime] = Field( default=None, description="Date-time when resource was launched.", alias="launchedAt" @@ -78,7 +78,7 @@ class Server(BaseModel): maintenance_window: Optional[ServerMaintenance] = Field(default=None, alias="maintenanceWindow") metadata: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`.", + description="Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key.", ) name: Annotated[str, Field(strict=True, max_length=63)] = Field(description="The name for a Server.") networking: Optional[CreateServerPayloadNetworking] = None diff --git a/services/iaas/src/stackit/iaas/models/server_maintenance.py b/services/iaas/src/stackit/iaas/models/server_maintenance.py index 2d71c334..522ed04a 100644 --- a/services/iaas/src/stackit/iaas/models/server_maintenance.py +++ b/services/iaas/src/stackit/iaas/models/server_maintenance.py @@ -31,7 +31,7 @@ class ServerMaintenance(BaseModel): details: Optional[StrictStr] = None ends_at: datetime = Field(description="End of the maintenance window.", alias="endsAt") starts_at: datetime = Field(description="Start of the maintenance window.", alias="startsAt") - status: StrictStr + status: StrictStr = Field(description="Possible values: `PLANNED`, `ONGOING`.") __properties: ClassVar[List[str]] = ["details", "endsAt", "startsAt", "status"] model_config = ConfigDict( diff --git a/services/iaas/src/stackit/iaas/models/snapshot.py b/services/iaas/src/stackit/iaas/models/snapshot.py index ee6030f8..801efd6c 100644 --- a/services/iaas/src/stackit/iaas/models/snapshot.py +++ b/services/iaas/src/stackit/iaas/models/snapshot.py @@ -37,7 +37,7 @@ class Snapshot(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/update_backup_payload.py b/services/iaas/src/stackit/iaas/models/update_backup_payload.py index 49e4a57a..92af79c4 100644 --- a/services/iaas/src/stackit/iaas/models/update_backup_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_backup_payload.py @@ -40,7 +40,7 @@ class UpdateBackupPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/update_image_payload.py b/services/iaas/src/stackit/iaas/models/update_image_payload.py index 314a4281..44dff40c 100644 --- a/services/iaas/src/stackit/iaas/models/update_image_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_image_payload.py @@ -30,6 +30,7 @@ ) from typing_extensions import Annotated, Self +from stackit.iaas.models.image_agent import ImageAgent from stackit.iaas.models.image_config import ImageConfig @@ -38,6 +39,7 @@ class UpdateImagePayload(BaseModel): Object that represents an update request body of an Image. """ # noqa: E501 + agent: Optional[ImageAgent] = None config: Optional[ImageConfig] = None disk_format: Optional[StrictStr] = Field( default=None, @@ -46,15 +48,26 @@ class UpdateImagePayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." ) - protected: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["config", "diskFormat", "labels", "minDiskSize", "minRam", "name", "protected"] + protected: Optional[StrictBool] = Field( + default=None, description="When true the image is prevented from being deleted." + ) + __properties: ClassVar[List[str]] = [ + "agent", + "config", + "diskFormat", + "labels", + "minDiskSize", + "minRam", + "name", + "protected", + ] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -103,6 +116,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict["agent"] = self.agent.to_dict() # override the default output from pydantic by calling `to_dict()` of config if self.config: _dict["config"] = self.config.to_dict() @@ -119,6 +135,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "agent": ImageAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, "diskFormat": obj.get("diskFormat"), "labels": obj.get("labels"), 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 index be1f0952..52abf970 100644 --- a/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py @@ -29,7 +29,7 @@ class UpdateKeyPairPayload(BaseModel): labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) __properties: ClassVar[List[str]] = ["labels"] diff --git a/services/iaas/src/stackit/iaas/models/update_network_area_route_payload.py b/services/iaas/src/stackit/iaas/models/update_network_area_route_payload.py index 43c5fac5..ed1f757e 100644 --- a/services/iaas/src/stackit/iaas/models/update_network_area_route_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_network_area_route_payload.py @@ -29,7 +29,7 @@ class UpdateNetworkAreaRoutePayload(BaseModel): labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) __properties: ClassVar[List[str]] = ["labels"] 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 08fa0e48..08089e9e 100644 --- a/services/iaas/src/stackit/iaas/models/update_nic_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_nic_payload.py @@ -35,7 +35,7 @@ class UpdateNicPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/update_public_ip_payload.py b/services/iaas/src/stackit/iaas/models/update_public_ip_payload.py index b2062a16..13e5d685 100644 --- a/services/iaas/src/stackit/iaas/models/update_public_ip_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_public_ip_payload.py @@ -36,7 +36,7 @@ class UpdatePublicIPPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Associate the public IP with a network interface (ID).", alias="networkInterface" diff --git a/services/iaas/src/stackit/iaas/models/update_security_group_payload.py b/services/iaas/src/stackit/iaas/models/update_security_group_payload.py index a37be0a0..aa46728b 100644 --- a/services/iaas/src/stackit/iaas/models/update_security_group_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_security_group_payload.py @@ -33,7 +33,7 @@ class UpdateSecurityGroupPayload(BaseModel): ) labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/update_server_payload.py b/services/iaas/src/stackit/iaas/models/update_server_payload.py index a850054d..fd8eaaad 100644 --- a/services/iaas/src/stackit/iaas/models/update_server_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_server_payload.py @@ -30,11 +30,11 @@ class UpdateServerPayload(BaseModel): labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) metadata: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`.", + description="Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a Server." diff --git a/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py b/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py index 98d59d16..27018b27 100644 --- a/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py @@ -30,7 +30,7 @@ class UpdateSnapshotPayload(BaseModel): labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." 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 1eeefe2a..3b07877b 100644 --- a/services/iaas/src/stackit/iaas/models/update_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_volume_payload.py @@ -27,7 +27,7 @@ class UpdateVolumePayload(BaseModel): """ - Object that represents an update request body of a volume. + Object that represents an update request body of a volume. """ # noqa: E501 bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") @@ -37,7 +37,7 @@ class UpdateVolumePayload(BaseModel): image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/volume.py b/services/iaas/src/stackit/iaas/models/volume.py index 281fc637..f98ab446 100644 --- a/services/iaas/src/stackit/iaas/models/volume.py +++ b/services/iaas/src/stackit/iaas/models/volume.py @@ -32,12 +32,13 @@ from typing_extensions import Annotated, Self from stackit.iaas.models.image_config import ImageConfig +from stackit.iaas.models.volume_encryption_parameter import VolumeEncryptionParameter from stackit.iaas.models.volume_source import VolumeSource class Volume(BaseModel): """ - Object that represents a volume and its parameters. Used for Creating and returning (get/list). + Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. """ # noqa: E501 availability_zone: StrictStr = Field( @@ -50,13 +51,15 @@ class Volume(BaseModel): description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) + encrypted: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is encrypted.") + encryption_parameters: Optional[VolumeEncryptionParameter] = Field(default=None, alias="encryptionParameters") id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." @@ -83,6 +86,8 @@ class Volume(BaseModel): "bootable", "createdAt", "description", + "encrypted", + "encryptionParameters", "id", "imageConfig", "labels", @@ -174,10 +179,12 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ "created_at", + "encrypted", "id", "image_config", "server_id", @@ -191,6 +198,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of encryption_parameters + if self.encryption_parameters: + _dict["encryptionParameters"] = self.encryption_parameters.to_dict() # override the default output from pydantic by calling `to_dict()` of image_config if self.image_config: _dict["imageConfig"] = self.image_config.to_dict() @@ -214,6 +224,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "bootable": obj.get("bootable"), "createdAt": obj.get("createdAt"), "description": obj.get("description"), + "encrypted": obj.get("encrypted"), + "encryptionParameters": ( + VolumeEncryptionParameter.from_dict(obj["encryptionParameters"]) + if obj.get("encryptionParameters") is not None + else None + ), "id": obj.get("id"), "imageConfig": ( ImageConfig.from_dict(obj["imageConfig"]) if obj.get("imageConfig") is not None else None diff --git a/services/iaas/src/stackit/iaas/models/volume_encryption_parameter.py b/services/iaas/src/stackit/iaas/models/volume_encryption_parameter.py new file mode 100644 index 00000000..8af7eeb0 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/volume_encryption_parameter.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBytes, + StrictInt, + StrictStr, + field_validator, +) +from typing_extensions import Annotated, Self + + +class VolumeEncryptionParameter(BaseModel): + """ + Parameter to connect to a key-encryption-key within the STACKIT-KMS to create encrypted volumes. If no key_payload is set, a random passphrase is generated, which will be encrypted against the STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the responses. + """ # noqa: E501 + + kek_key_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="UUID of the Key within the STACKIT-KMS to use for the encryption.", alias="kekKeyId" + ) + kek_key_version: StrictInt = Field( + description="Version of the key within the STACKIT-KMS to use for the encryption.", alias="kekKeyVersion" + ) + kek_keyring_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="UUID of the keyring where the key is located within the STACKTI-KMS.", alias="kekKeyringId" + ) + kek_project_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, + description="Id of the project, where the key in the STACKIT-KMS belongs to, in case the key is located in a different project. By default the same project ID is used, like for the volume itself. Defining a key in a different project is only allowed for privileged internal projects.", + alias="kekProjectId", + ) + key_payload: Optional[Union[StrictBytes, StrictStr]] = Field( + default=None, + description="Optional predefined secret, which will be encrypted against the key-encryption-key within the STACKIT-KMS. If not defined, a random secret will be generated by the API and encrypted against the STACKIT-KMS. If a key-payload is provided here, it must be base64 encoded.", + alias="keyPayload", + ) + service_account: Annotated[str, Field(strict=True, max_length=255)] = Field( + description="Service-Account linked to the Key within the STACKIT-KMS.", alias="serviceAccount" + ) + __properties: ClassVar[List[str]] = [ + "kekKeyId", + "kekKeyVersion", + "kekKeyringId", + "kekProjectId", + "keyPayload", + "serviceAccount", + ] + + @field_validator("kek_key_id") + def kek_key_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): + raise ValueError( + r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" + ) + return value + + @field_validator("kek_keyring_id") + def kek_keyring_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): + raise ValueError( + r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" + ) + return value + + @field_validator("kek_project_id") + def kek_project_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): + raise ValueError( + r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" + ) + return value + + @field_validator("service_account") + def service_account_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match( + r"[a-z0-9-]+(?:\.[a-z0-9]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", value + ): + raise ValueError( + r"must validate the regular expression /[a-z0-9-]+(?:\.[a-z0-9]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-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 VolumeEncryptionParameter 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 VolumeEncryptionParameter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "kekKeyId": obj.get("kekKeyId"), + "kekKeyVersion": obj.get("kekKeyVersion"), + "kekKeyringId": obj.get("kekKeyringId"), + "kekProjectId": obj.get("kekProjectId"), + "keyPayload": obj.get("keyPayload"), + "serviceAccount": obj.get("serviceAccount"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/volume_performance_class.py b/services/iaas/src/stackit/iaas/models/volume_performance_class.py index 8720d728..15fa4c10 100644 --- a/services/iaas/src/stackit/iaas/models/volume_performance_class.py +++ b/services/iaas/src/stackit/iaas/models/volume_performance_class.py @@ -34,7 +34,7 @@ class VolumePerformanceClass(BaseModel): 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove that key.", ) name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs."