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
4 changes: 4 additions & 0 deletions scaleway-async/scaleway_async/cockpit/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,15 @@ async def create_datasource(
*,
name: str,
type_: DatasourceType,
is_default: bool,
project_id: Optional[str] = None,
) -> Datasource:
"""
Create a datasource for the specified Project ID and the given type.
:param project_id: ID of the Project the Cockpit belongs to.
:param name: Datasource name.
:param type_: Datasource type.
:param is_default: Specifies that the returned output is the default datasource per type.
:return: :class:`Datasource <Datasource>`

Usage:
Expand All @@ -298,6 +300,7 @@ async def create_datasource(
result = await api.create_datasource(
name="example",
type_=unknown_datasource_type,
is_default=True,
)
"""

Expand All @@ -308,6 +311,7 @@ async def create_datasource(
CreateDatasourceRequest(
name=name,
type_=type_,
is_default=is_default,
project_id=project_id,
),
self.client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,9 @@ def marshal_CreateDatasourceRequest(
) -> Dict[str, Any]:
output: Dict[str, Any] = {}

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

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

Expand Down
5 changes: 5 additions & 0 deletions scaleway-async/scaleway_async/cockpit/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,11 @@ class CreateDatasourceRequest:
Datasource type.
"""

is_default: bool
"""
Specifies that the returned output is the default datasource per type.
"""


@dataclass
class ListDatasourcesRequest:
Expand Down
4 changes: 4 additions & 0 deletions scaleway/scaleway/cockpit/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,15 @@ def create_datasource(
*,
name: str,
type_: DatasourceType,
is_default: bool,
project_id: Optional[str] = None,
) -> Datasource:
"""
Create a datasource for the specified Project ID and the given type.
:param project_id: ID of the Project the Cockpit belongs to.
:param name: Datasource name.
:param type_: Datasource type.
:param is_default: Specifies that the returned output is the default datasource per type.
:return: :class:`Datasource <Datasource>`

Usage:
Expand All @@ -298,6 +300,7 @@ def create_datasource(
result = api.create_datasource(
name="example",
type_=unknown_datasource_type,
is_default=True,
)
"""

Expand All @@ -308,6 +311,7 @@ def create_datasource(
CreateDatasourceRequest(
name=name,
type_=type_,
is_default=is_default,
project_id=project_id,
),
self.client,
Expand Down
3 changes: 3 additions & 0 deletions scaleway/scaleway/cockpit/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,9 @@ def marshal_CreateDatasourceRequest(
) -> Dict[str, Any]:
output: Dict[str, Any] = {}

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

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

Expand Down
5 changes: 5 additions & 0 deletions scaleway/scaleway/cockpit/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,11 @@ class CreateDatasourceRequest:
Datasource type.
"""

is_default: bool
"""
Specifies that the returned output is the default datasource per type.
"""


@dataclass
class ListDatasourcesRequest:
Expand Down