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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .types import RuleHttpMatchMethodFilter
from .types import RuleHttpMatchPathFilterPathFilterType
from .types import SearchBackendStagesRequestOrderBy
from .types import SearchWafStagesRequestOrderBy
from .types import WafStageMode
from .types import ScalewayLb
from .types import RuleHttpMatchPathFilter
Expand Down Expand Up @@ -112,6 +113,7 @@
from .types import ListWafStagesResponse
from .types import Plan
from .types import SearchBackendStagesRequest
from .types import SearchWafStagesRequest
from .types import SelectPlanRequest
from .types import SetHeadStageRequest
from .types import SetRouteRulesRequest
Expand Down Expand Up @@ -149,6 +151,7 @@
"RuleHttpMatchMethodFilter",
"RuleHttpMatchPathFilterPathFilterType",
"SearchBackendStagesRequestOrderBy",
"SearchWafStagesRequestOrderBy",
"WafStageMode",
"ScalewayLb",
"RuleHttpMatchPathFilter",
Expand Down Expand Up @@ -238,6 +241,7 @@
"ListWafStagesResponse",
"Plan",
"SearchBackendStagesRequest",
"SearchWafStagesRequest",
"SelectPlanRequest",
"SetHeadStageRequest",
"SetRouteRulesRequest",
Expand Down
124 changes: 80 additions & 44 deletions scaleway-async/scaleway_async/edge_services/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ListWafStagesRequestOrderBy,
PlanName,
SearchBackendStagesRequestOrderBy,
SearchWafStagesRequestOrderBy,
WafStageMode,
AddRouteRulesRequest,
AddRouteRulesResponse,
Expand Down Expand Up @@ -1584,6 +1585,50 @@ async def delete_backend_stage(

self._throw_on_error(res)

async def search_backend_stages(
self,
*,
order_by: Optional[SearchBackendStagesRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
project_id: Optional[str] = None,
bucket_name: Optional[str] = None,
bucket_region: Optional[str] = None,
lb_id: Optional[str] = None,
) -> ListBackendStagesResponse:
"""
:param order_by:
:param page:
:param page_size:
:param project_id:
:param bucket_name:
:param bucket_region:
:param lb_id:
:return: :class:`ListBackendStagesResponse <ListBackendStagesResponse>`

Usage:
::

result = await api.search_backend_stages()
"""

res = self._request(
"GET",
"/edge-services/v1beta1/search-backend-stages",
params={
"bucket_name": bucket_name,
"bucket_region": bucket_region,
"lb_id": lb_id,
"order_by": order_by,
"page": page,
"page_size": page_size or self.client.default_page_size,
"project_id": project_id or self.client.default_project_id,
},
)

self._throw_on_error(res)
return unmarshal_ListBackendStagesResponse(res.json())

async def list_waf_stages(
self,
*,
Expand Down Expand Up @@ -1808,6 +1853,41 @@ async def delete_waf_stage(

self._throw_on_error(res)

async def search_waf_stages(
self,
*,
order_by: Optional[SearchWafStagesRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
project_id: Optional[str] = None,
) -> ListWafStagesResponse:
"""
:param order_by:
:param page:
:param page_size:
:param project_id:
:return: :class:`ListWafStagesResponse <ListWafStagesResponse>`

Usage:
::

result = await api.search_waf_stages()
"""

res = self._request(
"GET",
"/edge-services/v1beta1/search-waf-stages",
params={
"order_by": order_by,
"page": page,
"page_size": page_size or self.client.default_page_size,
"project_id": project_id or self.client.default_project_id,
},
)

self._throw_on_error(res)
return unmarshal_ListWafStagesResponse(res.json())

async def list_route_stages(
self,
*,
Expand Down Expand Up @@ -2212,50 +2292,6 @@ async def check_pem_chain(
self._throw_on_error(res)
return unmarshal_CheckPEMChainResponse(res.json())

async def search_backend_stages(
self,
*,
order_by: Optional[SearchBackendStagesRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
project_id: Optional[str] = None,
bucket_name: Optional[str] = None,
bucket_region: Optional[str] = None,
lb_id: Optional[str] = None,
) -> ListBackendStagesResponse:
"""
:param order_by:
:param page:
:param page_size:
:param project_id:
:param bucket_name:
:param bucket_region:
:param lb_id:
:return: :class:`ListBackendStagesResponse <ListBackendStagesResponse>`

Usage:
::

result = await api.search_backend_stages()
"""

res = self._request(
"GET",
"/edge-services/v1beta1/search-backend-stages",
params={
"bucket_name": bucket_name,
"bucket_region": bucket_region,
"lb_id": lb_id,
"order_by": order_by,
"page": page,
"page_size": page_size or self.client.default_page_size,
"project_id": project_id or self.client.default_project_id,
},
)

self._throw_on_error(res)
return unmarshal_ListBackendStagesResponse(res.json())

async def list_purge_requests(
self,
*,
Expand Down
19 changes: 19 additions & 0 deletions scaleway-async/scaleway_async/edge_services/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ def __str__(self) -> str:
return str(self.value)


class SearchWafStagesRequestOrderBy(str, Enum, metaclass=StrEnumMeta):
CREATED_AT_ASC = "created_at_asc"
CREATED_AT_DESC = "created_at_desc"

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


class WafStageMode(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_MODE = "unknown_mode"
DISABLE = "disable"
Expand Down Expand Up @@ -1610,6 +1618,17 @@ class SearchBackendStagesRequest:
lb_id: Optional[str]


@dataclass
class SearchWafStagesRequest:
order_by: Optional[SearchWafStagesRequestOrderBy]

page: Optional[int]

page_size: Optional[int]

project_id: Optional[str]


@dataclass
class SelectPlanRequest:
project_id: Optional[str]
Expand Down
4 changes: 4 additions & 0 deletions scaleway/scaleway/edge_services/v1beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .types import RuleHttpMatchMethodFilter
from .types import RuleHttpMatchPathFilterPathFilterType
from .types import SearchBackendStagesRequestOrderBy
from .types import SearchWafStagesRequestOrderBy
from .types import WafStageMode
from .types import ScalewayLb
from .types import RuleHttpMatchPathFilter
Expand Down Expand Up @@ -112,6 +113,7 @@
from .types import ListWafStagesResponse
from .types import Plan
from .types import SearchBackendStagesRequest
from .types import SearchWafStagesRequest
from .types import SelectPlanRequest
from .types import SetHeadStageRequest
from .types import SetRouteRulesRequest
Expand Down Expand Up @@ -149,6 +151,7 @@
"RuleHttpMatchMethodFilter",
"RuleHttpMatchPathFilterPathFilterType",
"SearchBackendStagesRequestOrderBy",
"SearchWafStagesRequestOrderBy",
"WafStageMode",
"ScalewayLb",
"RuleHttpMatchPathFilter",
Expand Down Expand Up @@ -238,6 +241,7 @@
"ListWafStagesResponse",
"Plan",
"SearchBackendStagesRequest",
"SearchWafStagesRequest",
"SelectPlanRequest",
"SetHeadStageRequest",
"SetRouteRulesRequest",
Expand Down
Loading