Skip to content

feat(secret_manager): add secret type to browse secret request #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2024
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
6 changes: 3 additions & 3 deletions scaleway-async/scaleway_async/jobs/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def create_job_definition(
:param project_id: UUID of the Scaleway Project containing the job.
:param environment_variables: Environment variables of the job.
:param job_timeout: Timeout of the job in seconds.
:param cron_schedule:
:param cron_schedule: Configure a cron for the job.
:return: :class:`JobDefinition <JobDefinition>`

Usage:
Expand All @@ -101,11 +101,11 @@ async def create_job_definition(
cpu_limit=cpu_limit,
memory_limit=memory_limit,
image_uri=image_uri,
command=command,
description=description,
region=region,
name=name or random_name(prefix="job"),
local_storage_capacity=local_storage_capacity,
command=command,
description=description,
project_id=project_id,
environment_variables=environment_variables,
job_timeout=job_timeout,
Expand Down
12 changes: 6 additions & 6 deletions scaleway-async/scaleway_async/jobs/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,18 @@ def marshal_CreateJobDefinitionRequest(
if request.image_uri is not None:
output["image_uri"] = request.image_uri

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

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

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

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

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

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

if request.project_id is not None:
output["project_id"] = request.project_id or defaults.default_project_id

Expand Down
23 changes: 13 additions & 10 deletions scaleway-async/scaleway_async/jobs/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,6 @@ class CreateJobDefinitionRequest:
Image to use for the job.
"""

command: str
"""
Startup command. If empty or not defined, the image's default command is used.
"""

description: str
"""
Description of the job.
"""

region: Optional[Region]
"""
Region to target. If none is passed will use default region from the config.
Expand All @@ -195,6 +185,16 @@ class CreateJobDefinitionRequest:
Local storage capacity of the job (in MiB).
"""

command: str
"""
Startup command. If empty or not defined, the image's default command is used.
"""

description: str
"""
Description of the job.
"""

project_id: Optional[str]
"""
UUID of the Scaleway Project containing the job.
Expand All @@ -211,6 +211,9 @@ class CreateJobDefinitionRequest:
"""

cron_schedule: Optional[CreateJobDefinitionRequestCronScheduleConfig]
"""
Configure a cron for the job.
"""


@dataclass
Expand Down
3 changes: 3 additions & 0 deletions scaleway-async/scaleway_async/secret/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ async def browse_secrets(
page: Optional[int] = None,
page_size: Optional[int] = None,
tags: Optional[List[str]] = None,
type_: Optional[SecretType] = None,
) -> BrowseSecretsResponse:
"""
Browse secrets.
Expand All @@ -378,6 +379,7 @@ async def browse_secrets(
:param page:
:param page_size:
:param tags: Filter secrets by tags.
:param type_: Filter by secret type (optional).
:return: :class:`BrowseSecretsResponse <BrowseSecretsResponse>`

Usage:
Expand All @@ -402,6 +404,7 @@ async def browse_secrets(
"prefix": prefix,
"project_id": project_id or self.client.default_project_id,
"tags": tags,
"type": type_,
},
)

Expand Down
5 changes: 5 additions & 0 deletions scaleway-async/scaleway_async/secret/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ class BrowseSecretsRequest:
Filter secrets by tags.
"""

type_: Optional[SecretType]
"""
Filter by secret type (optional).
"""


@dataclass
class BrowseSecretsResponse:
Expand Down
6 changes: 3 additions & 3 deletions scaleway/scaleway/jobs/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def create_job_definition(
:param project_id: UUID of the Scaleway Project containing the job.
:param environment_variables: Environment variables of the job.
:param job_timeout: Timeout of the job in seconds.
:param cron_schedule:
:param cron_schedule: Configure a cron for the job.
:return: :class:`JobDefinition <JobDefinition>`

Usage:
Expand All @@ -101,11 +101,11 @@ def create_job_definition(
cpu_limit=cpu_limit,
memory_limit=memory_limit,
image_uri=image_uri,
command=command,
description=description,
region=region,
name=name or random_name(prefix="job"),
local_storage_capacity=local_storage_capacity,
command=command,
description=description,
project_id=project_id,
environment_variables=environment_variables,
job_timeout=job_timeout,
Expand Down
12 changes: 6 additions & 6 deletions scaleway/scaleway/jobs/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,18 @@ def marshal_CreateJobDefinitionRequest(
if request.image_uri is not None:
output["image_uri"] = request.image_uri

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

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

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

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

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

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

if request.project_id is not None:
output["project_id"] = request.project_id or defaults.default_project_id

Expand Down
23 changes: 13 additions & 10 deletions scaleway/scaleway/jobs/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,6 @@ class CreateJobDefinitionRequest:
Image to use for the job.
"""

command: str
"""
Startup command. If empty or not defined, the image's default command is used.
"""

description: str
"""
Description of the job.
"""

region: Optional[Region]
"""
Region to target. If none is passed will use default region from the config.
Expand All @@ -195,6 +185,16 @@ class CreateJobDefinitionRequest:
Local storage capacity of the job (in MiB).
"""

command: str
"""
Startup command. If empty or not defined, the image's default command is used.
"""

description: str
"""
Description of the job.
"""

project_id: Optional[str]
"""
UUID of the Scaleway Project containing the job.
Expand All @@ -211,6 +211,9 @@ class CreateJobDefinitionRequest:
"""

cron_schedule: Optional[CreateJobDefinitionRequestCronScheduleConfig]
"""
Configure a cron for the job.
"""


@dataclass
Expand Down
3 changes: 3 additions & 0 deletions scaleway/scaleway/secret/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ def browse_secrets(
page: Optional[int] = None,
page_size: Optional[int] = None,
tags: Optional[List[str]] = None,
type_: Optional[SecretType] = None,
) -> BrowseSecretsResponse:
"""
Browse secrets.
Expand All @@ -378,6 +379,7 @@ def browse_secrets(
:param page:
:param page_size:
:param tags: Filter secrets by tags.
:param type_: Filter by secret type (optional).
:return: :class:`BrowseSecretsResponse <BrowseSecretsResponse>`

Usage:
Expand All @@ -402,6 +404,7 @@ def browse_secrets(
"prefix": prefix,
"project_id": project_id or self.client.default_project_id,
"tags": tags,
"type": type_,
},
)

Expand Down
5 changes: 5 additions & 0 deletions scaleway/scaleway/secret/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ class BrowseSecretsRequest:
Filter secrets by tags.
"""

type_: Optional[SecretType]
"""
Filter by secret type (optional).
"""


@dataclass
class BrowseSecretsResponse:
Expand Down