Skip to content

BGP API: Rename name_or_id path param #6497

@david-crespo

Description

@david-crespo

It would make sense to call it announce_set. bgp_announce_set is probably unnecessary.

/// Delete BGP announce set
#[endpoint {
method = DELETE,
path = "/v1/system/networking/bgp-announce-set/{name_or_id}",
tags = ["system/networking"],
}]
async fn networking_bgp_announce_set_delete(
rqctx: RequestContext<Self::Context>,
path_params: Path<params::BgpAnnounceSetSelector>,
) -> Result<HttpResponseUpdatedNoContent, HttpError>;
// TODO: is pagination necessary here? How large do we expect the list of
// announcements to become in real usage?
/// Get originated routes for a specified BGP announce set
#[endpoint {
method = GET,
path = "/v1/system/networking/bgp-announce-set/{name_or_id}/announcement",
tags = ["system/networking"],
}]
async fn networking_bgp_announcement_list(
rqctx: RequestContext<Self::Context>,
path_params: Path<params::BgpAnnounceSetSelector>,
) -> Result<HttpResponseOk<Vec<BgpAnnouncement>>, HttpError>;

Name or ID path params should be named with the kind of resource they are so that in the CLI or other clients, it's clear what it is the name or ID of. Example:

/// Fetch IP pool
#[endpoint {
method = GET,
path = "/v1/ip-pools/{pool}",
tags = ["projects"],
}]
async fn project_ip_pool_view(
rqctx: RequestContext<Self::Context>,
path_params: Path<params::IpPoolPath>,
) -> Result<HttpResponseOk<views::SiloIpPool>, HttpError>;

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions