Skip to content

feat(edge_services): add route rule search endpoint #2244

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 8, 2025
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
26 changes: 26 additions & 0 deletions packages_generated/edge_services/src/v1beta1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ import type {
PurgeRequest,
RouteStage,
SearchBackendStagesRequest,
SearchRouteRulesRequest,
SearchWafStagesRequest,
SelectPlanRequest,
SetHeadStageRequest,
Expand Down Expand Up @@ -993,6 +994,31 @@ export class API extends ParentAPI {
unmarshalAddRouteRulesResponse,
)

/**
* List route rules. List all route rules of an organization or project.
*
* @param request - The request {@link SearchRouteRulesRequest}
* @returns A Promise of ListRouteRulesResponse
*/
searchRouteRules = (request: Readonly<SearchRouteRulesRequest> = {}) =>
this.client.fetch<ListRouteRulesResponse>(
{
method: 'GET',
path: `/edge-services/v1beta1/search-route-rules`,
urlParams: urlParams(
['order_by', request.orderBy],
['organization_id', request.organizationId],
['page', request.page],
[
'page_size',
request.pageSize ?? this.client.settings.defaultPageSize,
],
['project_id', request.projectId],
),
},
unmarshalListRouteRulesResponse,
)

checkDomain = (request: Readonly<CheckDomainRequest>) =>
this.client.fetch<CheckDomainResponse>(
{
Expand Down
2 changes: 2 additions & 0 deletions packages_generated/edge_services/src/v1beta1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export type {
ScalewayS3BackendConfig,
SearchBackendStagesRequest,
SearchBackendStagesRequestOrderBy,
SearchRouteRulesRequest,
SearchRouteRulesRequestOrderBy,
SearchWafStagesRequest,
SearchWafStagesRequestOrderBy,
SelectPlanRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ export const unmarshalListRouteRulesResponse = (

return {
routeRules: unmarshalArrayOfObject(data.route_rules, unmarshalRouteRule),
totalCount: data.total_count,
} as ListRouteRulesResponse
}

Expand Down
16 changes: 16 additions & 0 deletions packages_generated/edge_services/src/v1beta1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ export type SearchBackendStagesRequestOrderBy =
| 'created_at_asc'
| 'created_at_desc'

export type SearchRouteRulesRequestOrderBy =
| 'created_at_asc'
| 'created_at_desc'

export type SearchWafStagesRequestOrderBy = 'created_at_asc' | 'created_at_desc'

export type WafStageMode = 'unknown_mode' | 'disable' | 'log_only' | 'enable'
Expand Down Expand Up @@ -1299,6 +1303,10 @@ export interface ListRouteRulesResponse {
* List of rules to be checked against every HTTP request. The first matching rule will forward the request to its specified backend stage. If no rules are matched, the request is forwarded to the WAF stage defined by `waf_stage_id`.
*/
routeRules: RouteRule[]
/**
* Count of all route rules matching the requested criteria.
*/
totalCount: number
}

export type ListRouteStagesRequest = {
Expand Down Expand Up @@ -1413,6 +1421,14 @@ export type SearchBackendStagesRequest = {
lbId?: string
}

export type SearchRouteRulesRequest = {
orderBy?: SearchRouteRulesRequestOrderBy
page?: number
pageSize?: number
organizationId?: string
projectId?: string
}

export type SearchWafStagesRequest = {
orderBy?: SearchWafStagesRequestOrderBy
page?: number
Expand Down
Loading