From ac67a4cfca94b9dac15de229855f358a24368dc8 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 12 Sep 2024 16:43:04 -0500 Subject: [PATCH] bump omicron version to latest --- OMICRON_VERSION | 2 +- app/api/__generated__/Api.ts | 107 ++++++++++++++++++++------ app/api/__generated__/OMICRON_VERSION | 2 +- app/api/__generated__/msw-handlers.ts | 39 ++++++++-- app/api/__generated__/validate.ts | 71 +++++++++++++---- mock-api/msw/handlers.ts | 2 + 6 files changed, 176 insertions(+), 47 deletions(-) diff --git a/OMICRON_VERSION b/OMICRON_VERSION index 2f61bc760..999546ee4 100644 --- a/OMICRON_VERSION +++ b/OMICRON_VERSION @@ -1 +1 @@ -b449abb736c10313df1d5e0c8f126970b2b968e5 +049663724ecf779e43dad7908a16f07055a68a4e diff --git a/app/api/__generated__/Api.ts b/app/api/__generated__/Api.ts index 9de8c9928..6442b5866 100644 --- a/app/api/__generated__/Api.ts +++ b/app/api/__generated__/Api.ts @@ -380,6 +380,14 @@ export type BgpConfigResultsPage = { nextPage?: string } +/** + * The current status of a BGP peer. + */ +export type BgpExported = { + /** Exported routes indexed by peer address. */ + exports: Record +} + /** * A route imported from a BGP peer. */ @@ -2071,13 +2079,23 @@ export type LinkFec = | 'rs' /** - * The LLDP configuration associated with a port. LLDP may be either enabled or disabled, if enabled, an LLDP configuration must be provided by name or id. + * The LLDP configuration associated with a port. */ -export type LldpServiceConfigCreate = { +export type LldpLinkConfigCreate = { + /** The LLDP chassis identifier TLV. */ + chassisId?: string /** Whether or not LLDP is enabled. */ enabled: boolean - /** A reference to the LLDP configuration used. Must not be `None` when `enabled` is `true`. */ - lldpConfig?: NameOrId + /** The LLDP link description TLV. */ + linkDescription?: string + /** The LLDP link name TLV. */ + linkName?: string + /** The LLDP management IP TLV. */ + managementIp?: string + /** The LLDP system description TLV. */ + systemDescription?: string + /** The LLDP system name TLV. */ + systemName?: string } /** @@ -2120,7 +2138,7 @@ export type LinkConfigCreate = { /** The forward error correction mode of the link. */ fec: LinkFec /** The link-layer discovery protocol (LLDP) configuration for the link. */ - lldp: LldpServiceConfigCreate + lldp: LldpLinkConfigCreate /** Maximum transmission unit for the link. */ mtu: number /** The speed of the link. */ @@ -2130,13 +2148,23 @@ export type LinkConfigCreate = { /** * A link layer discovery protocol (LLDP) service configuration. */ -export type LldpServiceConfig = { +export type LldpLinkConfig = { + /** The LLDP chassis identifier TLV. */ + chassisId?: string /** Whether or not the LLDP service is enabled. */ enabled: boolean /** The id of this LLDP service instance. */ id: string - /** The link-layer discovery protocol configuration for this service. */ - lldpConfigId?: string + /** The LLDP link description TLV. */ + linkDescription?: string + /** The LLDP link name TLV. */ + linkName?: string + /** The LLDP management IP TLV. */ + managementIp?: IpNet + /** The LLDP system description TLV. */ + systemDescription?: string + /** The LLDP system name TLV. */ + systemName?: string } /** @@ -2536,6 +2564,8 @@ export type Route = { dst: IpNet /** The route gateway. */ gw: string + /** Local preference for route. Higher preference indictes precedence within and across protocols. */ + localPref?: number /** VLAN id the gateway is reachable over. */ vid?: number } @@ -3293,7 +3323,7 @@ export type SwitchPortLinkConfig = { /** The name of this link. */ linkName: string /** The link-layer discovery protocol service configuration id for this link. */ - lldpServiceConfigId: string + lldpLinkConfigId?: string /** The maximum transmission unit for this link. */ mtu: number /** The port settings this link configuration belongs to. */ @@ -3322,6 +3352,8 @@ export type SwitchPortRouteConfig = { gw: IpNet /** The interface name this route configuration is assigned to. */ interfaceName: string + /** Local preference indicating priority within and across protocols. */ + localPref?: number /** The port settings object this route configuration belongs to. */ portSettingsId: string /** The VLAN identifier for the route. Use this if the gateway is reachable over an 802.1Q tagged L2 segment. */ @@ -3407,7 +3439,7 @@ export type SwitchPortSettingsView = { /** Layer 3 interface settings. */ interfaces: SwitchInterfaceConfig[] /** Link-layer discovery protocol (LLDP) settings. */ - linkLldp: LldpServiceConfig[] + linkLldp: LldpLinkConfig[] /** Layer 2 link settings. */ links: SwitchPortLinkConfig[] /** Layer 1 physical port settings. */ @@ -3460,7 +3492,8 @@ export type Units = | 'nanoseconds' | 'volts' | 'amps' - | 'degrees_celcius' + | 'watts' + | 'degrees_celsius' /** No meaningful units, e.g. a dimensionless quanity. */ | 'none' @@ -4662,7 +4695,6 @@ export interface NetworkingAddressLotBlockListQueryParams { export interface NetworkingBgpConfigListQueryParams { limit?: number - nameOrId?: NameOrId pageToken?: string sortBy?: NameOrIdSortMode } @@ -4672,11 +4704,17 @@ export interface NetworkingBgpConfigDeleteQueryParams { } export interface NetworkingBgpAnnounceSetListQueryParams { - nameOrId: NameOrId + limit?: number + pageToken?: string + sortBy?: NameOrIdSortMode } -export interface NetworkingBgpAnnounceSetDeleteQueryParams { - nameOrId: NameOrId +export interface NetworkingBgpAnnounceSetDeletePathParams { + announceSet: NameOrId +} + +export interface NetworkingBgpAnnouncementListPathParams { + announceSet: NameOrId } export interface NetworkingBgpMessageHistoryQueryParams { @@ -5033,6 +5071,7 @@ export type ApiListMethods = Pick< | 'networkingAddressLotBlockList' | 'networkingBgpConfigList' | 'networkingBgpAnnounceSetList' + | 'networkingBgpAnnouncementList' | 'networkingLoopbackAddressList' | 'networkingSwitchPortSettingsList' | 'roleList' @@ -7073,14 +7112,14 @@ export class Api extends HttpClient { }) }, /** - * Get originated routes for a BGP configuration + * List BGP announce sets */ networkingBgpAnnounceSetList: ( - { query }: { query: NetworkingBgpAnnounceSetListQueryParams }, + { query = {} }: { query?: NetworkingBgpAnnounceSetListQueryParams }, params: FetchParams = {} ) => { - return this.request({ - path: `/v1/system/networking/bgp-announce`, + return this.request({ + path: `/v1/system/networking/bgp-announce-set`, method: 'GET', query, ...params, @@ -7094,7 +7133,7 @@ export class Api extends HttpClient { params: FetchParams = {} ) => { return this.request({ - path: `/v1/system/networking/bgp-announce`, + path: `/v1/system/networking/bgp-announce-set`, method: 'PUT', body, ...params, @@ -7104,13 +7143,35 @@ export class Api extends HttpClient { * Delete BGP announce set */ networkingBgpAnnounceSetDelete: ( - { query }: { query: NetworkingBgpAnnounceSetDeleteQueryParams }, + { path }: { path: NetworkingBgpAnnounceSetDeletePathParams }, params: FetchParams = {} ) => { return this.request({ - path: `/v1/system/networking/bgp-announce`, + path: `/v1/system/networking/bgp-announce-set/${path.announceSet}`, method: 'DELETE', - query, + ...params, + }) + }, + /** + * Get originated routes for a specified BGP announce set + */ + networkingBgpAnnouncementList: ( + { path }: { path: NetworkingBgpAnnouncementListPathParams }, + params: FetchParams = {} + ) => { + return this.request({ + path: `/v1/system/networking/bgp-announce-set/${path.announceSet}/announcement`, + method: 'GET', + ...params, + }) + }, + /** + * Get BGP exported routes + */ + networkingBgpExported: (_: EmptyObj, params: FetchParams = {}) => { + return this.request({ + path: `/v1/system/networking/bgp-exported`, + method: 'GET', ...params, }) }, diff --git a/app/api/__generated__/OMICRON_VERSION b/app/api/__generated__/OMICRON_VERSION index 324a038ac..f744bd9fb 100644 --- a/app/api/__generated__/OMICRON_VERSION +++ b/app/api/__generated__/OMICRON_VERSION @@ -1,2 +1,2 @@ # generated file. do not update manually. see docs/update-pinned-api.md -b449abb736c10313df1d5e0c8f126970b2b968e5 +049663724ecf779e43dad7908a16f07055a68a4e diff --git a/app/api/__generated__/msw-handlers.ts b/app/api/__generated__/msw-handlers.ts index f97ded037..27fb72c2f 100644 --- a/app/api/__generated__/msw-handlers.ts +++ b/app/api/__generated__/msw-handlers.ts @@ -924,24 +924,35 @@ export interface MSWHandlers { req: Request cookies: Record }) => Promisable - /** `GET /v1/system/networking/bgp-announce` */ + /** `GET /v1/system/networking/bgp-announce-set` */ networkingBgpAnnounceSetList: (params: { query: Api.NetworkingBgpAnnounceSetListQueryParams req: Request cookies: Record - }) => Promisable> - /** `PUT /v1/system/networking/bgp-announce` */ + }) => Promisable> + /** `PUT /v1/system/networking/bgp-announce-set` */ networkingBgpAnnounceSetUpdate: (params: { body: Json req: Request cookies: Record }) => Promisable> - /** `DELETE /v1/system/networking/bgp-announce` */ + /** `DELETE /v1/system/networking/bgp-announce-set/:announceSet` */ networkingBgpAnnounceSetDelete: (params: { - query: Api.NetworkingBgpAnnounceSetDeleteQueryParams + path: Api.NetworkingBgpAnnounceSetDeletePathParams req: Request cookies: Record }) => Promisable + /** `GET /v1/system/networking/bgp-announce-set/:announceSet/announcement` */ + networkingBgpAnnouncementList: (params: { + path: Api.NetworkingBgpAnnouncementListPathParams + req: Request + cookies: Record + }) => Promisable> + /** `GET /v1/system/networking/bgp-exported` */ + networkingBgpExported: (params: { + req: Request + cookies: Record + }) => Promisable> /** `GET /v1/system/networking/bgp-message-history` */ networkingBgpMessageHistory: (params: { query: Api.NetworkingBgpMessageHistoryQueryParams @@ -2080,7 +2091,7 @@ export function makeHandlers(handlers: MSWHandlers): HttpHandler[] { ) ), http.get( - '/v1/system/networking/bgp-announce', + '/v1/system/networking/bgp-announce-set', handler( handlers['networkingBgpAnnounceSetList'], schema.NetworkingBgpAnnounceSetListParams, @@ -2088,17 +2099,29 @@ export function makeHandlers(handlers: MSWHandlers): HttpHandler[] { ) ), http.put( - '/v1/system/networking/bgp-announce', + '/v1/system/networking/bgp-announce-set', handler(handlers['networkingBgpAnnounceSetUpdate'], null, schema.BgpAnnounceSetCreate) ), http.delete( - '/v1/system/networking/bgp-announce', + '/v1/system/networking/bgp-announce-set/:announceSet', handler( handlers['networkingBgpAnnounceSetDelete'], schema.NetworkingBgpAnnounceSetDeleteParams, null ) ), + http.get( + '/v1/system/networking/bgp-announce-set/:announceSet/announcement', + handler( + handlers['networkingBgpAnnouncementList'], + schema.NetworkingBgpAnnouncementListParams, + null + ) + ), + http.get( + '/v1/system/networking/bgp-exported', + handler(handlers['networkingBgpExported'], null, null) + ), http.get( '/v1/system/networking/bgp-message-history', handler( diff --git a/app/api/__generated__/validate.ts b/app/api/__generated__/validate.ts index 38e308bf4..9ba8e5dc2 100644 --- a/app/api/__generated__/validate.ts +++ b/app/api/__generated__/validate.ts @@ -388,6 +388,14 @@ export const BgpConfigResultsPage = z.preprocess( z.object({ items: BgpConfig.array(), nextPage: z.string().optional() }) ) +/** + * The current status of a BGP peer. + */ +export const BgpExported = z.preprocess( + processResponseBody, + z.object({ exports: z.record(z.string().min(1), Ipv4Net.array()) }) +) + /** * A route imported from a BGP peer. */ @@ -1977,11 +1985,19 @@ export const L4PortRange = z.preprocess( export const LinkFec = z.preprocess(processResponseBody, z.enum(['firecode', 'none', 'rs'])) /** - * The LLDP configuration associated with a port. LLDP may be either enabled or disabled, if enabled, an LLDP configuration must be provided by name or id. + * The LLDP configuration associated with a port. */ -export const LldpServiceConfigCreate = z.preprocess( +export const LldpLinkConfigCreate = z.preprocess( processResponseBody, - z.object({ enabled: SafeBoolean, lldpConfig: NameOrId.optional() }) + z.object({ + chassisId: z.string().optional(), + enabled: SafeBoolean, + linkDescription: z.string().optional(), + linkName: z.string().optional(), + managementIp: z.string().ip().optional(), + systemDescription: z.string().optional(), + systemName: z.string().optional(), + }) ) /** @@ -2010,7 +2026,7 @@ export const LinkConfigCreate = z.preprocess( z.object({ autoneg: SafeBoolean, fec: LinkFec, - lldp: LldpServiceConfigCreate, + lldp: LldpLinkConfigCreate, mtu: z.number().min(0).max(65535), speed: LinkSpeed, }) @@ -2019,12 +2035,17 @@ export const LinkConfigCreate = z.preprocess( /** * A link layer discovery protocol (LLDP) service configuration. */ -export const LldpServiceConfig = z.preprocess( +export const LldpLinkConfig = z.preprocess( processResponseBody, z.object({ + chassisId: z.string().optional(), enabled: SafeBoolean, id: z.string().uuid(), - lldpConfigId: z.string().uuid().optional(), + linkDescription: z.string().optional(), + linkName: z.string().optional(), + managementIp: IpNet.optional(), + systemDescription: z.string().optional(), + systemName: z.string().optional(), }) ) @@ -2440,6 +2461,7 @@ export const Route = z.preprocess( z.object({ dst: IpNet, gw: z.string().ip(), + localPref: z.number().min(0).max(4294967295).optional(), vid: z.number().min(0).max(65535).optional(), }) ) @@ -3070,7 +3092,7 @@ export const SwitchPortLinkConfig = z.preprocess( autoneg: SafeBoolean, fec: LinkFec, linkName: z.string(), - lldpServiceConfigId: z.string().uuid(), + lldpLinkConfigId: z.string().uuid().optional(), mtu: z.number().min(0).max(65535), portSettingsId: z.string().uuid(), speed: LinkSpeed, @@ -3094,6 +3116,7 @@ export const SwitchPortRouteConfig = z.preprocess( dst: IpNet, gw: IpNet, interfaceName: z.string(), + localPref: z.number().min(0).max(4294967295).optional(), portSettingsId: z.string().uuid(), vlanId: z.number().min(0).max(65535).optional(), }) @@ -3165,7 +3188,7 @@ export const SwitchPortSettingsView = z.preprocess( bgpPeers: BgpPeer.array(), groups: SwitchPortSettingsGroups.array(), interfaces: SwitchInterfaceConfig.array(), - linkLldp: LldpServiceConfig.array(), + linkLldp: LldpLinkConfig.array(), links: SwitchPortLinkConfig.array(), port: SwitchPortConfig, routes: SwitchPortRouteConfig.array(), @@ -3223,7 +3246,8 @@ export const Units = z.preprocess( 'nanoseconds', 'volts', 'amps', - 'degrees_celcius', + 'watts', + 'degrees_celsius', ]), z.enum(['none']), z.enum(['rpm']), @@ -5159,7 +5183,6 @@ export const NetworkingBgpConfigListParams = z.preprocess( path: z.object({}), query: z.object({ limit: z.number().min(1).max(4294967295).optional(), - nameOrId: NameOrId.optional(), pageToken: z.string().optional(), sortBy: NameOrIdSortMode.optional(), }), @@ -5189,7 +5212,9 @@ export const NetworkingBgpAnnounceSetListParams = z.preprocess( z.object({ path: z.object({}), query: z.object({ - nameOrId: NameOrId, + limit: z.number().min(1).max(4294967295).optional(), + pageToken: z.string().optional(), + sortBy: NameOrIdSortMode.optional(), }), }) ) @@ -5205,10 +5230,28 @@ export const NetworkingBgpAnnounceSetUpdateParams = z.preprocess( export const NetworkingBgpAnnounceSetDeleteParams = z.preprocess( processResponseBody, z.object({ - path: z.object({}), - query: z.object({ - nameOrId: NameOrId, + path: z.object({ + announceSet: NameOrId, + }), + query: z.object({}), + }) +) + +export const NetworkingBgpAnnouncementListParams = z.preprocess( + processResponseBody, + z.object({ + path: z.object({ + announceSet: NameOrId, }), + query: z.object({}), + }) +) + +export const NetworkingBgpExportedParams = z.preprocess( + processResponseBody, + z.object({ + path: z.object({}), + query: z.object({}), }) ) diff --git a/mock-api/msw/handlers.ts b/mock-api/msw/handlers.ts index 8089c8351..7898990fa 100644 --- a/mock-api/msw/handlers.ts +++ b/mock-api/msw/handlers.ts @@ -1451,12 +1451,14 @@ export const handlers = makeHandlers({ networkingBfdDisable: NotImplemented, networkingBfdEnable: NotImplemented, networkingBfdStatus: NotImplemented, + networkingBgpAnnouncementList: NotImplemented, networkingBgpAnnounceSetUpdate: NotImplemented, networkingBgpAnnounceSetDelete: NotImplemented, networkingBgpAnnounceSetList: NotImplemented, networkingBgpConfigCreate: NotImplemented, networkingBgpConfigDelete: NotImplemented, networkingBgpConfigList: NotImplemented, + networkingBgpExported: NotImplemented, networkingBgpImportedRoutesIpv4: NotImplemented, networkingBgpMessageHistory: NotImplemented, networkingBgpStatus: NotImplemented,