diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a2779701..e45d8a5a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ ## Release (2025-xx-xx) - `authorization`: [v0.4.0](services/authorization/CHANGELOG.md#v040) - **Feature**: Add support for assignable subjects +- `iaas`: [v0.9.0](services/iaas/CHANGELOG.md#v090) + - Add `created_at` and `updated_at` attribute to `SecurityGroupRule`, `BaseSecurityGroupRule` and `CreateSecurityGroupRulePayload` model classes + - Add `description` attribute to `NIC`, `CreateNicPayload` and `UpdateNicPayload` model classes + - New model class `ServerAgent` + - Add `agent` and `description` attribute to `Server` and `CreateServerPayload` model classes - `intake`: [v0.2.0](services/intake/CHANGELOG.md#v020) - **Feature:** Add response `IntakeRunnerResponse` to `UpdateIntakeRunnerExecute` request - **Feature:** Add response `IntakeUserResponse` to `UpdateIntakeUserExecute` request diff --git a/services/iaas/CHANGELOG.md b/services/iaas/CHANGELOG.md index 4b085b342..d68e53acd 100644 --- a/services/iaas/CHANGELOG.md +++ b/services/iaas/CHANGELOG.md @@ -1,3 +1,9 @@ +## v0.9.0 +- Add `created_at` and `updated_at` attribute to `SecurityGroupRule`, `BaseSecurityGroupRule` and `CreateSecurityGroupRulePayload` model classes +- Add `description` attribute to `NIC`, `CreateNicPayload` and `UpdateNicPayload` model classes +- New model class `ServerAgent` +- Add `agent` and `description` attribute to `Server` and `CreateServerPayload` model classes + ## v0.8.1 - **Internal:** Add workaround to fix upstream OpenAPI generator issue where regex patterns include leading/trailing slashes that need to be removed for validation in `AllowedAddressesInner`, `AreaId`, and `CreateProtocol` models diff --git a/services/iaas/pyproject.toml b/services/iaas/pyproject.toml index eba588441..cf58e68b8 100644 --- a/services/iaas/pyproject.toml +++ b/services/iaas/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-iaas" [tool.poetry] name = "stackit-iaas" -version = "v0.8.1" +version = "v0.9.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/iaas/src/stackit/iaas/__init__.py b/services/iaas/src/stackit/iaas/__init__.py index e9f002e2f..9a3fee3ba 100644 --- a/services/iaas/src/stackit/iaas/__init__.py +++ b/services/iaas/src/stackit/iaas/__init__.py @@ -119,6 +119,7 @@ "SecurityGroupRuleListResponse", "SecurityGroupRuleProtocol", "Server", + "ServerAgent", "ServerConsoleUrl", "ServerListResponse", "ServerMaintenance", @@ -364,6 +365,7 @@ SecurityGroupRuleProtocol as SecurityGroupRuleProtocol, ) from stackit.iaas.models.server import Server as Server +from stackit.iaas.models.server_agent import ServerAgent as ServerAgent from stackit.iaas.models.server_console_url import ServerConsoleUrl as ServerConsoleUrl from stackit.iaas.models.server_list_response import ( ServerListResponse as ServerListResponse, diff --git a/services/iaas/src/stackit/iaas/models/__init__.py b/services/iaas/src/stackit/iaas/models/__init__.py index 1e7590a3d..eb45dafeb 100644 --- a/services/iaas/src/stackit/iaas/models/__init__.py +++ b/services/iaas/src/stackit/iaas/models/__init__.py @@ -125,6 +125,7 @@ ) from stackit.iaas.models.security_group_rule_protocol import SecurityGroupRuleProtocol from stackit.iaas.models.server import Server +from stackit.iaas.models.server_agent import ServerAgent from stackit.iaas.models.server_console_url import ServerConsoleUrl from stackit.iaas.models.server_list_response import ServerListResponse from stackit.iaas.models.server_maintenance import ServerMaintenance diff --git a/services/iaas/src/stackit/iaas/models/backup.py b/services/iaas/src/stackit/iaas/models/backup.py index 17de0cb30..076929221 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 4e4fa087e..74d54a3ce 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 @@ -17,6 +17,7 @@ import json import pprint import re # noqa: F401 +from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -31,6 +32,9 @@ class BaseSecurityGroupRule(BaseModel): The base schema for a security group rule. """ # noqa: E501 + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) @@ -56,7 +60,11 @@ class BaseSecurityGroupRule(BaseModel): security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID).", alias="securityGroupId" ) + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) __properties: ClassVar[List[str]] = [ + "createdAt", "description", "direction", "ethertype", @@ -66,6 +74,7 @@ class BaseSecurityGroupRule(BaseModel): "portRange", "remoteSecurityGroupId", "securityGroupId", + "updatedAt", ] @field_validator("id") @@ -150,11 +159,15 @@ def to_dict(self) -> Dict[str, Any]: are ignored. * 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", "id", "security_group_id", + "updated_at", ] ) @@ -182,6 +195,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "createdAt": obj.get("createdAt"), "description": obj.get("description"), "direction": obj.get("direction"), "ethertype": obj.get("ethertype") if obj.get("ethertype") is not None else "IPv4", @@ -193,6 +207,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "portRange": PortRange.from_dict(obj["portRange"]) if obj.get("portRange") is not None else None, "remoteSecurityGroupId": obj.get("remoteSecurityGroupId"), "securityGroupId": obj.get("securityGroupId"), + "updatedAt": obj.get("updatedAt"), } ) return _obj 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 a2c463282..cf27ea401 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 42524a693..84b9c3fec 100644 --- a/services/iaas/src/stackit/iaas/models/create_image_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_image_payload.py @@ -55,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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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") 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 8ab59129c..b3c811f2b 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 801306c05..a5b1cccec 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 028b4e643..a7543b5a2 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 f162f5aad..81556ee71 100644 --- a/services/iaas/src/stackit/iaas/models/create_nic_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_nic_payload.py @@ -40,6 +40,9 @@ class CreateNicPayload(BaseModel): allowed_addresses: Optional[List[AllowedAddressesInner]] = Field( default=None, description="A list of IPs or CIDR notations.", alias="allowedAddresses" ) + description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, description="Description Object. Allows string up to 255 Characters." + ) device: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) @@ -54,7 +57,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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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." @@ -79,6 +82,7 @@ class CreateNicPayload(BaseModel): ) __properties: ClassVar[List[str]] = [ "allowedAddresses", + "description", "device", "id", "ipv4", @@ -256,6 +260,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("allowedAddresses") is not None else None ), + "description": obj.get("description"), "device": obj.get("device"), "id": obj.get("id"), "ipv4": obj.get("ipv4"), 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 a8893ba62..68cc8225c 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 d2b8e9b3e..300652dc0 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 e19c70828..7134da9cb 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 @@ -17,6 +17,7 @@ import json import pprint import re # noqa: F401 +from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -32,6 +33,9 @@ class CreateSecurityGroupRulePayload(BaseModel): Object that represents a request body for security group rule creation. """ # noqa: E501 + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) @@ -57,8 +61,12 @@ class CreateSecurityGroupRulePayload(BaseModel): security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID).", alias="securityGroupId" ) + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) protocol: Optional[CreateProtocol] = None __properties: ClassVar[List[str]] = [ + "createdAt", "description", "direction", "ethertype", @@ -68,6 +76,7 @@ class CreateSecurityGroupRulePayload(BaseModel): "portRange", "remoteSecurityGroupId", "securityGroupId", + "updatedAt", "protocol", ] @@ -153,11 +162,15 @@ def to_dict(self) -> Dict[str, Any]: are ignored. * 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", "id", "security_group_id", + "updated_at", ] ) @@ -188,6 +201,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "createdAt": obj.get("createdAt"), "description": obj.get("description"), "direction": obj.get("direction"), "ethertype": obj.get("ethertype") if obj.get("ethertype") is not None else "IPv4", @@ -199,6 +213,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "portRange": PortRange.from_dict(obj["portRange"]) if obj.get("portRange") is not None else None, "remoteSecurityGroupId": obj.get("remoteSecurityGroupId"), "securityGroupId": obj.get("securityGroupId"), + "updatedAt": obj.get("updatedAt"), "protocol": CreateProtocol.from_dict(obj["protocol"]) if obj.get("protocol") is not None else None, } ) 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 54159cf63..697ab600c 100644 --- a/services/iaas/src/stackit/iaas/models/create_server_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_server_payload.py @@ -34,6 +34,7 @@ from stackit.iaas.models.create_server_payload_networking import ( CreateServerPayloadNetworking, ) +from stackit.iaas.models.server_agent import ServerAgent from stackit.iaas.models.server_maintenance import ServerMaintenance from stackit.iaas.models.server_network import ServerNetwork @@ -46,6 +47,7 @@ class CreateServerPayload(BaseModel): affinity_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="The affinity group the server is assigned to.", alias="affinityGroup" ) + agent: Optional[ServerAgent] = None availability_zone: Optional[StrictStr] = Field( default=None, description="This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone.", @@ -67,7 +69,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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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" @@ -118,6 +120,7 @@ class CreateServerPayload(BaseModel): ) __properties: ClassVar[List[str]] = [ "affinityGroup", + "agent", "availabilityZone", "bootVolume", "createdAt", @@ -265,6 +268,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 boot_volume if self.boot_volume: _dict["bootVolume"] = self.boot_volume.to_dict() @@ -295,6 +301,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "affinityGroup": obj.get("affinityGroup"), + "agent": ServerAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "availabilityZone": obj.get("availabilityZone"), "bootVolume": BootVolume.from_dict(obj["bootVolume"]) if obj.get("bootVolume") is not None else None, "createdAt": obj.get("createdAt"), 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 7ee5d0541..6753f5ffe 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 a23cf6a37..fdb7ed8ae 100644 --- a/services/iaas/src/stackit/iaas/models/create_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_volume_payload.py @@ -59,7 +59,7 @@ class CreateVolumePayload(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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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/image.py b/services/iaas/src/stackit/iaas/models/image.py index aa2d89b7f..0a9456b9d 100644 --- a/services/iaas/src/stackit/iaas/models/image.py +++ b/services/iaas/src/stackit/iaas/models/image.py @@ -55,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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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") diff --git a/services/iaas/src/stackit/iaas/models/keypair.py b/services/iaas/src/stackit/iaas/models/keypair.py index cc0e9adc6..99a92b5fb 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 5fa55c10b..0e0dfac4a 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 653ef4fbd..eb06b0053 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 c485d18f0..6d6dc24af 100644 --- a/services/iaas/src/stackit/iaas/models/nic.py +++ b/services/iaas/src/stackit/iaas/models/nic.py @@ -40,6 +40,9 @@ class NIC(BaseModel): allowed_addresses: Optional[List[AllowedAddressesInner]] = Field( default=None, description="A list of IPs or CIDR notations.", alias="allowedAddresses" ) + description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, description="Description Object. Allows string up to 255 Characters." + ) device: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) @@ -54,7 +57,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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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." @@ -79,6 +82,7 @@ class NIC(BaseModel): ) __properties: ClassVar[List[str]] = [ "allowedAddresses", + "description", "device", "id", "ipv4", @@ -256,6 +260,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("allowedAddresses") is not None else None ), + "description": obj.get("description"), "device": obj.get("device"), "id": obj.get("id"), "ipv4": obj.get("ipv4"), 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 96dc70df5..fd6d0389c 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 d82ca6e15..b9173d8f5 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 59ad9e8ec..b5eb2d3c0 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 527db9384..372444b70 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 37c37aaca..f5d245e7b 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 f88813ea0..59fbdb8cc 100644 --- a/services/iaas/src/stackit/iaas/models/security_group_rule.py +++ b/services/iaas/src/stackit/iaas/models/security_group_rule.py @@ -17,6 +17,7 @@ import json import pprint import re # noqa: F401 +from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -32,6 +33,9 @@ class SecurityGroupRule(BaseModel): Object that represents a security group rule. """ # noqa: E501 + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) @@ -57,8 +61,12 @@ class SecurityGroupRule(BaseModel): security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID).", alias="securityGroupId" ) + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) protocol: Optional[Protocol] = None __properties: ClassVar[List[str]] = [ + "createdAt", "description", "direction", "ethertype", @@ -68,6 +76,7 @@ class SecurityGroupRule(BaseModel): "portRange", "remoteSecurityGroupId", "securityGroupId", + "updatedAt", "protocol", ] @@ -153,11 +162,15 @@ def to_dict(self) -> Dict[str, Any]: are ignored. * 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", "id", "security_group_id", + "updated_at", ] ) @@ -188,6 +201,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "createdAt": obj.get("createdAt"), "description": obj.get("description"), "direction": obj.get("direction"), "ethertype": obj.get("ethertype") if obj.get("ethertype") is not None else "IPv4", @@ -199,6 +213,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "portRange": PortRange.from_dict(obj["portRange"]) if obj.get("portRange") is not None else None, "remoteSecurityGroupId": obj.get("remoteSecurityGroupId"), "securityGroupId": obj.get("securityGroupId"), + "updatedAt": obj.get("updatedAt"), "protocol": Protocol.from_dict(obj["protocol"]) if obj.get("protocol") is not None else None, } ) diff --git a/services/iaas/src/stackit/iaas/models/server.py b/services/iaas/src/stackit/iaas/models/server.py index 5180c52b9..424f3dd31 100644 --- a/services/iaas/src/stackit/iaas/models/server.py +++ b/services/iaas/src/stackit/iaas/models/server.py @@ -34,6 +34,7 @@ from stackit.iaas.models.create_server_payload_networking import ( CreateServerPayloadNetworking, ) +from stackit.iaas.models.server_agent import ServerAgent from stackit.iaas.models.server_maintenance import ServerMaintenance from stackit.iaas.models.server_network import ServerNetwork @@ -46,6 +47,7 @@ class Server(BaseModel): affinity_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="The affinity group the server is assigned to.", alias="affinityGroup" ) + agent: Optional[ServerAgent] = None availability_zone: Optional[StrictStr] = Field( default=None, description="This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone.", @@ -67,7 +69,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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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" @@ -118,6 +120,7 @@ class Server(BaseModel): ) __properties: ClassVar[List[str]] = [ "affinityGroup", + "agent", "availabilityZone", "bootVolume", "createdAt", @@ -265,6 +268,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 boot_volume if self.boot_volume: _dict["bootVolume"] = self.boot_volume.to_dict() @@ -295,6 +301,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "affinityGroup": obj.get("affinityGroup"), + "agent": ServerAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "availabilityZone": obj.get("availabilityZone"), "bootVolume": BootVolume.from_dict(obj["bootVolume"]) if obj.get("bootVolume") is not None else None, "createdAt": obj.get("createdAt"), diff --git a/services/iaas/src/stackit/iaas/models/server_agent.py b/services/iaas/src/stackit/iaas/models/server_agent.py new file mode 100644 index 000000000..ee0ad89ae --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/server_agent.py @@ -0,0 +1,85 @@ +# 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 ServerAgent(BaseModel): + """ + STACKIT server agent options for a server. + """ # noqa: E501 + + provisioned: Optional[StrictBool] = Field( + default=None, + description="Configure the STACKIT server agent provisioning during the first boot of the server. Only works when booting from an images that supports the STACKIT server agent. When `false` the agent IS NOT installed. When `true` the agent IS installed. When its not set the result depend on the used image and its default provisioning setting.", + ) + __properties: ClassVar[List[str]] = ["provisioned"] + + 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 ServerAgent 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 ServerAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"provisioned": obj.get("provisioned")}) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/snapshot.py b/services/iaas/src/stackit/iaas/models/snapshot.py index 801efd6c9..2893ab078 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 92af79c47..c979f2a79 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 44dff40c9..a0bded0c2 100644 --- a/services/iaas/src/stackit/iaas/models/update_image_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_image_payload.py @@ -48,7 +48,7 @@ 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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") 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 52abf9701..e130e0b37 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 ed1f757ed..cfcb762ed 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 08089e9ea..cc4c531cc 100644 --- a/services/iaas/src/stackit/iaas/models/update_nic_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_nic_payload.py @@ -33,9 +33,12 @@ class UpdateNicPayload(BaseModel): allowed_addresses: Optional[List[AllowedAddressesInner]] = Field( default=None, description="A list of IPs or CIDR notations.", alias="allowedAddresses" ) + description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, description="Description Object. Allows string up to 255 Characters." + ) 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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." @@ -48,7 +51,14 @@ class UpdateNicPayload(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" ) - __properties: ClassVar[List[str]] = ["allowedAddresses", "labels", "name", "nicSecurity", "securityGroups"] + __properties: ClassVar[List[str]] = [ + "allowedAddresses", + "description", + "labels", + "name", + "nicSecurity", + "securityGroups", + ] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -122,6 +132,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("allowedAddresses") is not None else None ), + "description": obj.get("description"), "labels": obj.get("labels"), "name": obj.get("name"), "nicSecurity": obj.get("nicSecurity"), 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 13e5d6856..85816cd9a 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 aa46728b3..c1a89abe9 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 fd8eaaadf..93bffd655 100644 --- a/services/iaas/src/stackit/iaas/models/update_server_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_server_payload.py @@ -30,7 +30,7 @@ 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key.", ) metadata: Optional[Dict[str, Any]] = Field( default=None, 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 27018b271..8d6bd1daf 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 3b07877bd..c94fffd5a 100644 --- a/services/iaas/src/stackit/iaas/models/update_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_volume_payload.py @@ -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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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 f98ab4460..694df6d50 100644 --- a/services/iaas/src/stackit/iaas/models/volume.py +++ b/services/iaas/src/stackit/iaas/models/volume.py @@ -59,7 +59,7 @@ class Volume(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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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_performance_class.py b/services/iaas/src/stackit/iaas/models/volume_performance_class.py index 15fa4c109..909d42d1d 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}$`. Providing a `null` value for a key will remove that key.", + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. 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."