diff --git a/arista/configlet.v1/configlet-changelog.yaml b/arista/configlet.v1/configlet-changelog.yaml index af5324ee..7e010c2b 100644 --- a/arista/configlet.v1/configlet-changelog.yaml +++ b/arista/configlet.v1/configlet-changelog.yaml @@ -7,6 +7,11 @@ # New entries go on top. Changes: + - date: 2024-05-20 + description: Add configlet body filter + onprem: true + cvaas: true + version: 1.1.1 - date: 2024-05-16 description: Update GetSome, SetSome, DeleteSome REST endpoints onprem: true diff --git a/arista/configlet.v1/configlet.proto b/arista/configlet.v1/configlet.proto index 83cd5aba..79bdf596 100644 --- a/arista/configlet.v1/configlet.proto +++ b/arista/configlet.v1/configlet.proto @@ -44,6 +44,7 @@ message Filter { // Use GetOne to get the body of individual configlets message Configlet { option (fmp.model) = "ro"; + option (fmp.custom_filter) = "Filter"; ConfigletKey key = 1; // display_name is the display name of the static configlet. @@ -72,6 +73,7 @@ message Configlet { // ConfigletConfig updates a static configlet in a workspace. message ConfigletConfig { option (fmp.model) = "rw"; + option (fmp.custom_filter) = "Filter"; ConfigletKey key = 1; // remove specifies the static configlet is to be removed from the workspace. diff --git a/arista/configlet.v1/services.gen.proto b/arista/configlet.v1/services.gen.proto index dd45a4a3..82669aca 100644 --- a/arista/configlet.v1/services.gen.proto +++ b/arista/configlet.v1/services.gen.proto @@ -82,6 +82,10 @@ message ConfigletStreamRequest { // While transparent to users, this field also allows services to optimize internal // subscriptions if filter(s) are sufficiently specific. repeated Configlet partial_eq_filter = 1; + // For each Configlet in the list, all populated fields are considered ANDed together + // as a filtering operation. Similarly, the list itself is ORed such that any individual + // filter that matches a given Configlet is streamed to the user. + Filter filter = 2; // TimeRange allows limiting response data to within a specified time window. // If this field is populated, at least one of the two time fields are required. @@ -124,6 +128,10 @@ message ConfigletBatchedStreamRequest { // While transparent to users, this field also allows services to optimize internal // subscriptions if filter(s) are sufficiently specific. repeated Configlet partial_eq_filter = 1; + // For each Configlet in the list, all populated fields are considered ANDed together + // as a filtering operation. Similarly, the list itself is ORed such that any individual + // filter that matches a given Configlet is streamed to the user. + Filter filter = 2; // TimeRange allows limiting response data to within a specified time window. // If this field is populated, at least one of the two time fields are required. @@ -576,6 +584,10 @@ message ConfigletConfigStreamRequest { // While transparent to users, this field also allows services to optimize internal // subscriptions if filter(s) are sufficiently specific. repeated ConfigletConfig partial_eq_filter = 1; + // For each ConfigletConfig in the list, all populated fields are considered ANDed together + // as a filtering operation. Similarly, the list itself is ORed such that any individual + // filter that matches a given ConfigletConfig is streamed to the user. + Filter filter = 2; // TimeRange allows limiting response data to within a specified time window. // If this field is populated, at least one of the two time fields are required. @@ -618,6 +630,10 @@ message ConfigletConfigBatchedStreamRequest { // While transparent to users, this field also allows services to optimize internal // subscriptions if filter(s) are sufficiently specific. repeated ConfigletConfig partial_eq_filter = 1; + // For each ConfigletConfig in the list, all populated fields are considered ANDed together + // as a filtering operation. Similarly, the list itself is ORed such that any individual + // filter that matches a given ConfigletConfig is streamed to the user. + Filter filter = 2; // TimeRange allows limiting response data to within a specified time window. // If this field is populated, at least one of the two time fields are required. @@ -720,6 +736,10 @@ message ConfigletConfigDeleteAllRequest { // This requires all provided fields to be equal to the response. // A filtered DeleteAll will use GetAll with filter to find things to delete. repeated ConfigletConfig partial_eq_filter = 1; + // For each ConfigletConfig in the list, all populated fields are considered ANDed together + // as a filtering operation. Similarly, the list itself is ORed such that any individual + // filter that matches a given ConfigletConfig will be deleted. + Filter filter = 2; }; message ConfigletConfigDeleteAllResponse { diff --git a/arista/configlet.v1/services.gen.swagger.json b/arista/configlet.v1/services.gen.swagger.json index a9ecc90d..5c3a323e 100644 --- a/arista/configlet.v1/services.gen.swagger.json +++ b/arista/configlet.v1/services.gen.swagger.json @@ -105,6 +105,13 @@ } }, "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "time.start", "in": "query", @@ -223,6 +230,13 @@ } }, "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "time.start", "in": "query", @@ -300,6 +314,13 @@ } }, "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "time.start", "in": "query", @@ -386,6 +407,13 @@ } }, "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "time.start", "in": "query", @@ -1589,6 +1617,13 @@ } }, "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "time.start", "in": "query", @@ -1633,6 +1668,15 @@ } } }, + "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + } + ], "tags": [ "ConfigletConfigService" ] @@ -1777,6 +1821,13 @@ } }, "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "time.start", "in": "query", @@ -1895,6 +1946,13 @@ } }, "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "time.start", "in": "query", @@ -1981,6 +2039,13 @@ } }, "parameters": [ + { + "name": "filter.includeBody", + "description": "include_body specifies the static configlet body is to be included.", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "time.start", "in": "query", @@ -2704,6 +2769,10 @@ }, "description": "PartialEqFilter provides a way to server-side filter a GetAll/Subscribe.\nThis requires all provided fields to be equal to the response.\n\nWhile transparent to users, this field also allows services to optimize internal\nsubscriptions if filter(s) are sufficiently specific." }, + "filter": { + "$ref": "#/definitions/arista.configlet.v1.Filter", + "description": "For each ConfigletConfig in the list, all populated fields are considered ANDed together\nas a filtering operation. Similarly, the list itself is ORed such that any individual\nfilter that matches a given ConfigletConfig is streamed to the user." + }, "time": { "$ref": "#/definitions/arista.time.TimeBounds", "description": "TimeRange allows limiting response data to within a specified time window.\nIf this field is populated, at least one of the two time fields are required.\n\nFor GetAll, the fields start and end can be used as follows:\n\n * end: Returns the state of each ConfigletConfig at end.\n * Each ConfigletConfig response is fully-specified (all fields set).\n * start: Returns the state of each ConfigletConfig at start, followed by updates until now.\n * Each ConfigletConfig response at start is fully-specified, but updates may be partial.\n * start and end: Returns the state of each ConfigletConfig at start, followed by updates\n until end.\n * Each ConfigletConfig response at start is fully-specified, but updates until end may\n be partial.\n\nThis field is not allowed in the Subscribe RPC." @@ -2805,6 +2874,10 @@ }, "description": "PartialEqFilter provides a way to server-side filter a GetAll/Subscribe.\nThis requires all provided fields to be equal to the response.\n\nWhile transparent to users, this field also allows services to optimize internal\nsubscriptions if filter(s) are sufficiently specific." }, + "filter": { + "$ref": "#/definitions/arista.configlet.v1.Filter", + "description": "For each Configlet in the list, all populated fields are considered ANDed together\nas a filtering operation. Similarly, the list itself is ORed such that any individual\nfilter that matches a given Configlet is streamed to the user." + }, "time": { "$ref": "#/definitions/arista.time.TimeBounds", "description": "TimeRange allows limiting response data to within a specified time window.\nIf this field is populated, at least one of the two time fields are required.\n\nFor GetAll, the fields start and end can be used as follows:\n\n * end: Returns the state of each Configlet at end.\n * Each Configlet response is fully-specified (all fields set).\n * start: Returns the state of each Configlet at start, followed by updates until now.\n * Each Configlet response at start is fully-specified, but updates may be partial.\n * start and end: Returns the state of each Configlet at start, followed by updates\n until end.\n * Each Configlet response at start is fully-specified, but updates until end may\n be partial.\n\nThis field is not allowed in the Subscribe RPC." @@ -2829,6 +2902,16 @@ } } }, + "arista.configlet.v1.Filter": { + "type": "object", + "properties": { + "includeBody": { + "type": "boolean", + "description": "include_body specifies the static configlet body is to be included." + } + }, + "description": "Filter is used to filter static configlets." + }, "arista.configlet.v1.MatchPolicy": { "type": "string", "enum": [