Skip to content

Commit

Permalink
Merge branch 'main' into v1.5903.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax authored Dec 24, 2024
2 parents 153c66f + 2bdbb0d commit 3f8771f
Show file tree
Hide file tree
Showing 20 changed files with 5,156 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from .types import ConnectivityDiagnosticActionType
from .types import ConnectivityDiagnosticDiagnosticStatus
from .types import ListServersRequestOrderBy
from .types import ServerPrivateNetworkStatus
from .content import SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES
from .types import ServerStatus
from .content import SERVER_TRANSIENT_STATUSES
from .types import ServerTypeStock
Expand Down Expand Up @@ -39,6 +41,8 @@
"ConnectivityDiagnosticActionType",
"ConnectivityDiagnosticDiagnosticStatus",
"ListServersRequestOrderBy",
"ServerPrivateNetworkStatus",
"SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES",
"ServerStatus",
"SERVER_TRANSIENT_STATUSES",
"ServerTypeStock",
Expand Down
7 changes: 7 additions & 0 deletions scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ async def create_server(
self,
*,
type_: str,
enable_vpc: bool,
zone: Optional[Zone] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -125,6 +126,7 @@ async def create_server(
Create a server.
Create a new server in the targeted zone, specifying its configuration including name and type.
:param type_: Create a server of the given type.
:param enable_vpc: Activate the Private Network feature for this server. This feature is configured through the Apple Silicon - Private Networks API.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param name: Create a server with this given name.
:param project_id: Create a server in the given project ID.
Expand All @@ -136,6 +138,7 @@ async def create_server(
result = await api.create_server(
type="example",
enable_vpc=False,
)
"""

Expand All @@ -147,6 +150,7 @@ async def create_server(
body=marshal_CreateServerRequest(
CreateServerRequest(
type_=type_,
enable_vpc=enable_vpc,
zone=zone,
name=name or random_name(prefix="as"),
project_id=project_id,
Expand Down Expand Up @@ -432,6 +436,7 @@ async def update_server(
zone: Optional[Zone] = None,
name: Optional[str] = None,
schedule_deletion: Optional[bool] = None,
enable_vpc: Optional[bool] = None,
) -> Server:
"""
Update a server.
Expand All @@ -440,6 +445,7 @@ async def update_server(
:param zone: Zone to target. If none is passed will use default zone from the config.
:param name: Updated name for your server.
:param schedule_deletion: Specify whether the server should be flagged for automatic deletion.
:param enable_vpc: Activate or deactivate Private Network support for this server.
:return: :class:`Server <Server>`
Usage:
Expand All @@ -462,6 +468,7 @@ async def update_server(
zone=zone,
name=name,
schedule_deletion=schedule_deletion,
enable_vpc=enable_vpc,
),
self.client,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
from typing import List

from .types import (
ServerPrivateNetworkStatus,
ServerStatus,
)

SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: List[ServerPrivateNetworkStatus] = [
ServerPrivateNetworkStatus.VPC_UPDATING,
]
"""
Lists transient statutes of the enum :class:`ServerPrivateNetworkStatus <ServerPrivateNetworkStatus>`.
"""
SERVER_TRANSIENT_STATUSES: List[ServerStatus] = [
ServerStatus.STARTING,
ServerStatus.REBOOTING,
Expand Down
10 changes: 10 additions & 0 deletions scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ def unmarshal_Server(data: Any) -> Server:
if field is not None:
args["delivered"] = field

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

field = data.get("os", None)
if field is not None:
args["os"] = unmarshal_OS(field)
Expand Down Expand Up @@ -485,6 +489,9 @@ def marshal_CreateServerRequest(
if request.type_ is not None:
output["type"] = request.type_

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

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

Expand Down Expand Up @@ -533,4 +540,7 @@ def marshal_UpdateServerRequest(
if request.schedule_deletion is not None:
output["schedule_deletion"] = request.schedule_deletion

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

return output
25 changes: 25 additions & 0 deletions scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ def __str__(self) -> str:
return str(self.value)


class ServerPrivateNetworkStatus(str, Enum, metaclass=StrEnumMeta):
VPC_UNKNOWN_STATUS = "vpc_unknown_status"
VPC_ENABLED = "vpc_enabled"
VPC_UPDATING = "vpc_updating"
VPC_DISABLED = "vpc_disabled"

def __str__(self) -> str:
return str(self.value)


class ServerStatus(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_STATUS = "unknown_status"
STARTING = "starting"
Expand Down Expand Up @@ -284,6 +294,11 @@ class Server:
Set to true once the server has completed its provisioning steps and is ready to use. Some OS configurations might require a reinstallation of the server before delivery depending on the available stock. A reinstallation after the initial delivery will not change this flag and can be tracked using the server status.
"""

vpc_status: ServerPrivateNetworkStatus
"""
Activation status of optional Private Network feature support for this server.
"""

os: Optional[OS]
"""
Initially installed OS, this does not necessarily reflect the current OS version.
Expand Down Expand Up @@ -327,6 +342,11 @@ class CreateServerRequest:
Create a server of the given type.
"""

enable_vpc: bool
"""
Activate the Private Network feature for this server. This feature is configured through the Apple Silicon - Private Networks API.
"""

zone: Optional[Zone]
"""
Zone to target. If none is passed will use default zone from the config.
Expand Down Expand Up @@ -580,3 +600,8 @@ class UpdateServerRequest:
"""
Specify whether the server should be flagged for automatic deletion.
"""

enable_vpc: Optional[bool]
"""
Activate or deactivate Private Network support for this server.
"""
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/interlink/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.
75 changes: 75 additions & 0 deletions scaleway-async/scaleway_async/interlink/v1beta1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.
from .types import BgpStatus
from .types import LinkStatus
from .types import ListLinksRequestOrderBy
from .types import ListPartnersRequestOrderBy
from .types import ListPopsRequestOrderBy
from .types import ListRoutingPoliciesRequestOrderBy
from .types import Link
from .types import Partner
from .types import Pop
from .types import RoutingPolicy
from .types import AttachRoutingPolicyRequest
from .types import AttachVpcRequest
from .types import CreateLinkRequest
from .types import CreateRoutingPolicyRequest
from .types import DeleteLinkRequest
from .types import DeleteRoutingPolicyRequest
from .types import DetachRoutingPolicyRequest
from .types import DetachVpcRequest
from .types import DisableRoutePropagationRequest
from .types import EnableRoutePropagationRequest
from .types import GetLinkRequest
from .types import GetPartnerRequest
from .types import GetPopRequest
from .types import GetRoutingPolicyRequest
from .types import ListLinksRequest
from .types import ListLinksResponse
from .types import ListPartnersRequest
from .types import ListPartnersResponse
from .types import ListPopsRequest
from .types import ListPopsResponse
from .types import ListRoutingPoliciesRequest
from .types import ListRoutingPoliciesResponse
from .types import UpdateLinkRequest
from .types import UpdateRoutingPolicyRequest
from .api import InterlinkV1Beta1API

__all__ = [
"BgpStatus",
"LinkStatus",
"ListLinksRequestOrderBy",
"ListPartnersRequestOrderBy",
"ListPopsRequestOrderBy",
"ListRoutingPoliciesRequestOrderBy",
"Link",
"Partner",
"Pop",
"RoutingPolicy",
"AttachRoutingPolicyRequest",
"AttachVpcRequest",
"CreateLinkRequest",
"CreateRoutingPolicyRequest",
"DeleteLinkRequest",
"DeleteRoutingPolicyRequest",
"DetachRoutingPolicyRequest",
"DetachVpcRequest",
"DisableRoutePropagationRequest",
"EnableRoutePropagationRequest",
"GetLinkRequest",
"GetPartnerRequest",
"GetPopRequest",
"GetRoutingPolicyRequest",
"ListLinksRequest",
"ListLinksResponse",
"ListPartnersRequest",
"ListPartnersResponse",
"ListPopsRequest",
"ListPopsResponse",
"ListRoutingPoliciesRequest",
"ListRoutingPoliciesResponse",
"UpdateLinkRequest",
"UpdateRoutingPolicyRequest",
"InterlinkV1Beta1API",
]
Loading

0 comments on commit 3f8771f

Please sign in to comment.