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
8 changes: 4 additions & 4 deletions scaleway-async/scaleway_async/mongodb/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
)
from scaleway_core.utils import (
WaitForOptions,
random_name,
validate_path_param,
fetch_all_pages_async,
wait_for_resource_async,
Expand Down Expand Up @@ -391,29 +392,29 @@ async def wait_for_instance(
async def create_instance(
self,
*,
name: str,
version: str,
node_number: int,
node_type: str,
user_name: str,
password: str,
region: Optional[Region] = None,
project_id: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[List[str]] = None,
volume: Optional[CreateInstanceRequestVolumeDetails] = None,
endpoints: Optional[List[EndpointSpec]] = None,
) -> Instance:
"""
Create a MongoDB™ Database Instance.
Create a new MongoDB™ Database Instance.
:param name: Name of the Database Instance.
:param version: Version of the MongoDB™ engine.
:param node_number: Number of node to use for the Database Instance.
:param node_type: Type of node to use for the Database Instance.
:param user_name: Username created when the Database Instance is created.
:param password: Password of the initial user.
:param region: Region to target. If none is passed will use default region from the config.
:param project_id: The Project ID on which the Database Instance will be created.
:param name: Name of the Database Instance.
:param tags: Tags to apply to the Database Instance.
:param volume: Instance volume information.
:param endpoints: One or multiple EndpointSpec used to expose your Database Instance.
Expand All @@ -423,7 +424,6 @@ async def create_instance(
::

result = await api.create_instance(
name="example",
version="example",
node_number=1,
node_type="example",
Expand All @@ -441,14 +441,14 @@ async def create_instance(
f"/mongodb/v1alpha1/regions/{param_region}/instances",
body=marshal_CreateInstanceRequest(
CreateInstanceRequest(
name=name,
version=version,
node_number=node_number,
node_type=node_type,
user_name=user_name,
password=password,
region=region,
project_id=project_id,
name=name or random_name(prefix="mgdb"),
tags=tags,
volume=volume,
endpoints=endpoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,6 @@ def marshal_CreateInstanceRequest(
) -> Dict[str, Any]:
output: Dict[str, Any] = {}

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

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

Expand All @@ -677,6 +674,9 @@ def marshal_CreateInstanceRequest(
if request.project_id is not None:
output["project_id"] = request.project_id or defaults.default_project_id

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

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

Expand Down
10 changes: 5 additions & 5 deletions scaleway-async/scaleway_async/mongodb/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,6 @@ class RestoreSnapshotRequestVolumeDetails:

@dataclass
class CreateInstanceRequest:
name: str
"""
Name of the Database Instance.
"""

version: str
"""
Version of the MongoDB™ engine.
Expand Down Expand Up @@ -553,6 +548,11 @@ class CreateInstanceRequest:
The Project ID on which the Database Instance will be created.
"""

name: Optional[str]
"""
Name of the Database Instance.
"""

tags: Optional[List[str]]
"""
Tags to apply to the Database Instance.
Expand Down
8 changes: 4 additions & 4 deletions scaleway/scaleway/mongodb/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
)
from scaleway_core.utils import (
WaitForOptions,
random_name,
validate_path_param,
fetch_all_pages,
wait_for_resource,
Expand Down Expand Up @@ -389,29 +390,29 @@ def wait_for_instance(
def create_instance(
self,
*,
name: str,
version: str,
node_number: int,
node_type: str,
user_name: str,
password: str,
region: Optional[Region] = None,
project_id: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[List[str]] = None,
volume: Optional[CreateInstanceRequestVolumeDetails] = None,
endpoints: Optional[List[EndpointSpec]] = None,
) -> Instance:
"""
Create a MongoDB™ Database Instance.
Create a new MongoDB™ Database Instance.
:param name: Name of the Database Instance.
:param version: Version of the MongoDB™ engine.
:param node_number: Number of node to use for the Database Instance.
:param node_type: Type of node to use for the Database Instance.
:param user_name: Username created when the Database Instance is created.
:param password: Password of the initial user.
:param region: Region to target. If none is passed will use default region from the config.
:param project_id: The Project ID on which the Database Instance will be created.
:param name: Name of the Database Instance.
:param tags: Tags to apply to the Database Instance.
:param volume: Instance volume information.
:param endpoints: One or multiple EndpointSpec used to expose your Database Instance.
Expand All @@ -421,7 +422,6 @@ def create_instance(
::

result = api.create_instance(
name="example",
version="example",
node_number=1,
node_type="example",
Expand All @@ -439,14 +439,14 @@ def create_instance(
f"/mongodb/v1alpha1/regions/{param_region}/instances",
body=marshal_CreateInstanceRequest(
CreateInstanceRequest(
name=name,
version=version,
node_number=node_number,
node_type=node_type,
user_name=user_name,
password=password,
region=region,
project_id=project_id,
name=name or random_name(prefix="mgdb"),
tags=tags,
volume=volume,
endpoints=endpoints,
Expand Down
6 changes: 3 additions & 3 deletions scaleway/scaleway/mongodb/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,6 @@ def marshal_CreateInstanceRequest(
) -> Dict[str, Any]:
output: Dict[str, Any] = {}

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

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

Expand All @@ -677,6 +674,9 @@ def marshal_CreateInstanceRequest(
if request.project_id is not None:
output["project_id"] = request.project_id or defaults.default_project_id

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

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

Expand Down
10 changes: 5 additions & 5 deletions scaleway/scaleway/mongodb/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,6 @@ class RestoreSnapshotRequestVolumeDetails:

@dataclass
class CreateInstanceRequest:
name: str
"""
Name of the Database Instance.
"""

version: str
"""
Version of the MongoDB™ engine.
Expand Down Expand Up @@ -553,6 +548,11 @@ class CreateInstanceRequest:
The Project ID on which the Database Instance will be created.
"""

name: Optional[str]
"""
Name of the Database Instance.
"""

tags: Optional[List[str]]
"""
Tags to apply to the Database Instance.
Expand Down