Skip to content
Merged
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
10 changes: 10 additions & 0 deletions scaleway-async/scaleway_async/baremetal/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from scaleway_core.api import API
from scaleway_core.bridge import (
ScwFile,
Zone as ScwZone,
)
from scaleway_core.utils import (
Expand Down Expand Up @@ -288,6 +289,7 @@ async def create_server(
tags: Optional[list[str]] = None,
install: Optional[CreateServerRequestInstall] = None,
option_ids: Optional[list[str]] = None,
user_data: Optional[str] = None,
) -> Server:
"""
Create an Elastic Metal server.
Expand All @@ -304,6 +306,7 @@ async def create_server(
:param tags: Tags to associate to the server.
:param install: Object describing the configuration details of the OS installation on the server.
:param option_ids: IDs of options to enable on server.
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
:return: :class:`Server <Server>`

Usage:
Expand Down Expand Up @@ -332,6 +335,7 @@ async def create_server(
tags=tags,
install=install,
option_ids=option_ids,
user_data=user_data,
project_id=project_id,
organization_id=organization_id,
),
Expand All @@ -351,6 +355,7 @@ async def update_server(
description: Optional[str] = None,
tags: Optional[list[str]] = None,
protected: Optional[bool] = None,
user_data: Optional[str] = None,
) -> Server:
"""
Update an Elastic Metal server.
Expand All @@ -361,6 +366,7 @@ async def update_server(
:param description: Description associated with the server, max 255 characters, not updated if null.
:param tags: Tags associated with the server, not updated if null.
:param protected: If enabled, the server can not be deleted.
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
:return: :class:`Server <Server>`

Usage:
Expand All @@ -385,6 +391,7 @@ async def update_server(
description=description,
tags=tags,
protected=protected,
user_data=user_data,
),
self.client,
),
Expand All @@ -406,6 +413,7 @@ async def install_server(
service_user: Optional[str] = None,
service_password: Optional[str] = None,
partitioning_schema: Optional[Schema] = None,
user_data: Optional[ScwFile] = None,
) -> Server:
"""
Install an Elastic Metal server.
Expand All @@ -420,6 +428,7 @@ async def install_server(
:param service_user: User used for the service to install.
:param service_password: Password used for the service to install.
:param partitioning_schema: Partitioning schema.
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
:return: :class:`Server <Server>`

Usage:
Expand Down Expand Up @@ -451,6 +460,7 @@ async def install_server(
service_user=service_user,
service_password=service_password,
partitioning_schema=partitioning_schema,
user_data=user_data,
),
self.client,
),
Expand Down
16 changes: 16 additions & 0 deletions scaleway-async/scaleway_async/baremetal/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from scaleway_core.profile import ProfileDefaults
from scaleway_core.bridge import (
unmarshal_Money,
marshal_ScwFile,
unmarshal_TimeSeries,
)
from scaleway_core.utils import (
Expand Down Expand Up @@ -706,6 +707,12 @@ def unmarshal_Server(data: Any) -> Server:
else:
args["rescue_server"] = None

field = data.get("user_data", None)
if field is not None:
args["user_data"] = field
else:
args["user_data"] = None

return Server(**args)


Expand Down Expand Up @@ -1930,6 +1937,9 @@ def marshal_CreateServerRequest(
if request.option_ids is not None:
output["option_ids"] = request.option_ids

if request.user_data is not None:
output["user_data"] = request.user_data

return output


Expand Down Expand Up @@ -1977,6 +1987,9 @@ def marshal_InstallServerRequest(
request.partitioning_schema, defaults
)

if request.user_data is not None:
output["user_data"] = marshal_ScwFile(request.user_data, defaults)

return output


Expand Down Expand Up @@ -2076,6 +2089,9 @@ def marshal_UpdateServerRequest(
if request.protected is not None:
output["protected"] = request.protected

if request.user_data is not None:
output["user_data"] = request.user_data

return output


Expand Down
21 changes: 21 additions & 0 deletions scaleway-async/scaleway_async/baremetal/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from scaleway_core.bridge import (
Money,
ScwFile,
TimeSeries,
Zone as ScwZone,
)
Expand Down Expand Up @@ -661,6 +662,11 @@ class CreateServerRequest:
IDs of options to enable on server.
"""

user_data: Optional[str] = None
"""
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
"""

project_id: Optional[str] = None

organization_id: Optional[str] = None
Expand Down Expand Up @@ -768,6 +774,11 @@ class Server:
Configuration of rescue boot.
"""

user_data: Optional[str] = None
"""
Optional configuration data passed to cloud-init.
"""


@dataclass
class OS:
Expand Down Expand Up @@ -1325,6 +1336,11 @@ class InstallServerRequest:
Partitioning schema.
"""

user_data: Optional[ScwFile] = None
"""
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
"""


@dataclass
class ListOSRequest:
Expand Down Expand Up @@ -1868,6 +1884,11 @@ class UpdateServerRequest:
If enabled, the server can not be deleted.
"""

user_data: Optional[str] = None
"""
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
"""


@dataclass
class UpdateSettingRequest:
Expand Down
10 changes: 10 additions & 0 deletions scaleway/scaleway/baremetal/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from scaleway_core.api import API
from scaleway_core.bridge import (
ScwFile,
Zone as ScwZone,
)
from scaleway_core.utils import (
Expand Down Expand Up @@ -288,6 +289,7 @@ def create_server(
tags: Optional[list[str]] = None,
install: Optional[CreateServerRequestInstall] = None,
option_ids: Optional[list[str]] = None,
user_data: Optional[str] = None,
) -> Server:
"""
Create an Elastic Metal server.
Expand All @@ -304,6 +306,7 @@ def create_server(
:param tags: Tags to associate to the server.
:param install: Object describing the configuration details of the OS installation on the server.
:param option_ids: IDs of options to enable on server.
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
:return: :class:`Server <Server>`

Usage:
Expand Down Expand Up @@ -332,6 +335,7 @@ def create_server(
tags=tags,
install=install,
option_ids=option_ids,
user_data=user_data,
project_id=project_id,
organization_id=organization_id,
),
Expand All @@ -351,6 +355,7 @@ def update_server(
description: Optional[str] = None,
tags: Optional[list[str]] = None,
protected: Optional[bool] = None,
user_data: Optional[str] = None,
) -> Server:
"""
Update an Elastic Metal server.
Expand All @@ -361,6 +366,7 @@ def update_server(
:param description: Description associated with the server, max 255 characters, not updated if null.
:param tags: Tags associated with the server, not updated if null.
:param protected: If enabled, the server can not be deleted.
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
:return: :class:`Server <Server>`

Usage:
Expand All @@ -385,6 +391,7 @@ def update_server(
description=description,
tags=tags,
protected=protected,
user_data=user_data,
),
self.client,
),
Expand All @@ -406,6 +413,7 @@ def install_server(
service_user: Optional[str] = None,
service_password: Optional[str] = None,
partitioning_schema: Optional[Schema] = None,
user_data: Optional[ScwFile] = None,
) -> Server:
"""
Install an Elastic Metal server.
Expand All @@ -420,6 +428,7 @@ def install_server(
:param service_user: User used for the service to install.
:param service_password: Password used for the service to install.
:param partitioning_schema: Partitioning schema.
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
:return: :class:`Server <Server>`

Usage:
Expand Down Expand Up @@ -451,6 +460,7 @@ def install_server(
service_user=service_user,
service_password=service_password,
partitioning_schema=partitioning_schema,
user_data=user_data,
),
self.client,
),
Expand Down
16 changes: 16 additions & 0 deletions scaleway/scaleway/baremetal/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from scaleway_core.profile import ProfileDefaults
from scaleway_core.bridge import (
unmarshal_Money,
marshal_ScwFile,
unmarshal_TimeSeries,
)
from scaleway_core.utils import (
Expand Down Expand Up @@ -706,6 +707,12 @@ def unmarshal_Server(data: Any) -> Server:
else:
args["rescue_server"] = None

field = data.get("user_data", None)
if field is not None:
args["user_data"] = field
else:
args["user_data"] = None

return Server(**args)


Expand Down Expand Up @@ -1930,6 +1937,9 @@ def marshal_CreateServerRequest(
if request.option_ids is not None:
output["option_ids"] = request.option_ids

if request.user_data is not None:
output["user_data"] = request.user_data

return output


Expand Down Expand Up @@ -1977,6 +1987,9 @@ def marshal_InstallServerRequest(
request.partitioning_schema, defaults
)

if request.user_data is not None:
output["user_data"] = marshal_ScwFile(request.user_data, defaults)

return output


Expand Down Expand Up @@ -2076,6 +2089,9 @@ def marshal_UpdateServerRequest(
if request.protected is not None:
output["protected"] = request.protected

if request.user_data is not None:
output["user_data"] = request.user_data

return output


Expand Down
21 changes: 21 additions & 0 deletions scaleway/scaleway/baremetal/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from scaleway_core.bridge import (
Money,
ScwFile,
TimeSeries,
Zone as ScwZone,
)
Expand Down Expand Up @@ -661,6 +662,11 @@ class CreateServerRequest:
IDs of options to enable on server.
"""

user_data: Optional[str] = None
"""
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
"""

project_id: Optional[str] = None

organization_id: Optional[str] = None
Expand Down Expand Up @@ -768,6 +774,11 @@ class Server:
Configuration of rescue boot.
"""

user_data: Optional[str] = None
"""
Optional configuration data passed to cloud-init.
"""


@dataclass
class OS:
Expand Down Expand Up @@ -1325,6 +1336,11 @@ class InstallServerRequest:
Partitioning schema.
"""

user_data: Optional[ScwFile] = None
"""
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
"""


@dataclass
class ListOSRequest:
Expand Down Expand Up @@ -1868,6 +1884,11 @@ class UpdateServerRequest:
If enabled, the server can not be deleted.
"""

user_data: Optional[str] = None
"""
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
"""


@dataclass
class UpdateSettingRequest:
Expand Down