Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions services/iaas/src/stackit/iaas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"SecurityGroupRuleListResponse",
"SecurityGroupRuleProtocol",
"Server",
"ServerAgent",
"ServerConsoleUrl",
"ServerListResponse",
"ServerMaintenance",
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions services/iaas/src/stackit/iaas/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion services/iaas/src/stackit/iaas/models/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
)
Expand All @@ -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",
Expand All @@ -66,6 +74,7 @@ class BaseSecurityGroupRule(BaseModel):
"portRange",
"remoteSecurityGroupId",
"securityGroupId",
"updatedAt",
]

@field_validator("id")
Expand Down Expand Up @@ -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",
]
)

Expand Down Expand Up @@ -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",
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)."
)
Expand All @@ -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."
Expand All @@ -79,6 +82,7 @@ class CreateNicPayload(BaseModel):
)
__properties: ClassVar[List[str]] = [
"allowedAddresses",
"description",
"device",
"id",
"ipv4",
Expand Down Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
)
Expand All @@ -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",
Expand All @@ -68,6 +76,7 @@ class CreateSecurityGroupRulePayload(BaseModel):
"portRange",
"remoteSecurityGroupId",
"securityGroupId",
"updatedAt",
"protocol",
]

Expand Down Expand Up @@ -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",
]
)

Expand Down Expand Up @@ -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",
Expand All @@ -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,
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.",
Expand All @@ -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"
Expand Down Expand Up @@ -118,6 +120,7 @@ class CreateServerPayload(BaseModel):
)
__properties: ClassVar[List[str]] = [
"affinityGroup",
"agent",
"availabilityZone",
"bootVolume",
"createdAt",
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Loading