Skip to content

Commit

Permalink
arista/configlet.v1: include body filter
Browse files Browse the repository at this point in the history
Change-Id: I3fc7735edfcd4ac44ec142cb759fbb8f02c2195e
  • Loading branch information
niraj gupta committed Jun 24, 2024
1 parent 174e367 commit 46df071
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arista/configlet.v1/configlet-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions arista/configlet.v1/configlet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
20 changes: 20 additions & 0 deletions arista/configlet.v1/services.gen.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
83 changes: 83 additions & 0 deletions arista/configlet.v1/services.gen.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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."
Expand All @@ -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": [
Expand Down

0 comments on commit 46df071

Please sign in to comment.