From 5650f68f1247df3495e96cf80cb3ecd478e49bc3 Mon Sep 17 00:00:00 2001 From: Michael Ou Date: Tue, 9 Apr 2024 16:39:28 -0500 Subject: [PATCH] release/redirector.v1: Update redirector.v1 XXX_SKIP_CHECK_BREAKING Change-Id: I4be0c606382e3c7a6436b6fdc3c230e2dae83528 --- .../redirector.v1/redirector-changelog.yaml | 4 + arista/redirector.v1/redirector.proto | 2 +- arista/redirector.v1/services.gen.proto | 52 +++- .../redirector.v1/services.gen.swagger.json | 248 +++++++++++++++++- 4 files changed, 303 insertions(+), 3 deletions(-) diff --git a/arista/redirector.v1/redirector-changelog.yaml b/arista/redirector.v1/redirector-changelog.yaml index a8e2dbe5..34bb3fce 100644 --- a/arista/redirector.v1/redirector-changelog.yaml +++ b/arista/redirector.v1/redirector-changelog.yaml @@ -7,6 +7,10 @@ # New entries go on top. Changes: + - date: 2024-03-28 + description: Update available APIs + version: 1.0.2 + cvaas: true - date: 2022-12-15 description: Open Sourcing version: 1.0.1 diff --git a/arista/redirector.v1/redirector.proto b/arista/redirector.v1/redirector.proto index c53d4941..1ac04556 100644 --- a/arista/redirector.v1/redirector.proto +++ b/arista/redirector.v1/redirector.proto @@ -6,7 +6,7 @@ syntax = "proto3"; package arista.redirector.v1; -option go_package = "arista/resources/arista/redirector.v1;redirector"; +option go_package = "github.com/aristanetworks/cloudvision-go/api/arista/redirector.v1;redirector"; import "google/protobuf/wrappers.proto"; diff --git a/arista/redirector.v1/services.gen.proto b/arista/redirector.v1/services.gen.proto index bae260b4..7027def9 100644 --- a/arista/redirector.v1/services.gen.proto +++ b/arista/redirector.v1/services.gen.proto @@ -9,12 +9,27 @@ syntax = "proto3"; package arista.redirector.v1; -option go_package = "arista/resources/arista/redirector.v1;redirector"; +option go_package = "github.com/aristanetworks/cloudvision-go/api/arista/redirector.v1;redirector"; import "arista/redirector.v1/redirector.proto"; import "arista/time/time.proto"; import "arista/subscriptions/subscriptions.proto"; import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +message MetaResponse { + // Time holds the timestamp of the last item included in the metadata calculation. + google.protobuf.Timestamp time = 1; + + // Operation indicates how the value in this response should be considered. + // Under non-subscribe requests, this value should always be INITIAL. In a subscription, + // once all initial data is streamed and the client begins to receive modification updates, + // you should not see INITIAL again. + arista.subscriptions.Operation type = 2; + + // Count is the number of items present under the conditions of the request. + google.protobuf.UInt32Value count = 3; +}; message AssignmentRequest { // Key uniquely identifies a Assignment instance to retrieve. @@ -38,6 +53,27 @@ message AssignmentResponse { google.protobuf.Timestamp time = 2; }; +message AssignmentSomeRequest { + repeated AssignmentKey keys = 1; + + // Time indicates the time for which you are interested in the data. + // If no time is given, the server will use the time at which it makes the request. + google.protobuf.Timestamp time = 2; +}; + +message AssignmentSomeResponse { + // Value is the value requested. + // This structure will be fully-populated as it exists in the datastore. If + // optional fields were not given at creation, these fields will be empty or + // set to default values. + Assignment value = 1; + + // Error is an optional field. + // It should be filled when there is an error in the GetSome process. + google.protobuf.StringValue error = 2; + google.protobuf.Timestamp time = 3; +}; + message AssignmentStreamRequest { // PartialEqFilter provides a way to server-side filter a GetAll/Subscribe. // This requires all provided fields to be equal to the response. @@ -49,6 +85,17 @@ message AssignmentStreamRequest { // 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. // + // For GetAll, the fields start and end can be used as follows: + // + // * end: Returns the state of each Assignment at end. + // * Each Assignment response is fully-specified (all fields set). + // * start: Returns the state of each Assignment at start, followed by updates until now. + // * Each Assignment response at start is fully-specified, but updates may be partial. + // * start and end: Returns the state of each Assignment at start, followed by updates + // until end. + // * Each Assignment response at start is fully-specified, but updates until end may + // be partial. + // // This field is not allowed in the Subscribe RPC. arista.time.TimeBounds time = 3; }; @@ -71,6 +118,9 @@ message AssignmentStreamResponse { service AssignmentService { rpc GetOne (AssignmentRequest) returns (AssignmentResponse); + rpc GetSome (AssignmentSomeRequest) returns (stream AssignmentSomeResponse); rpc GetAll (AssignmentStreamRequest) returns (stream AssignmentStreamResponse); rpc Subscribe (AssignmentStreamRequest) returns (stream AssignmentStreamResponse); + rpc GetMeta (AssignmentStreamRequest) returns (MetaResponse); + rpc SubscribeMeta (AssignmentStreamRequest) returns (stream MetaResponse); } diff --git a/arista/redirector.v1/services.gen.swagger.json b/arista/redirector.v1/services.gen.swagger.json index d0a3e387..a11477b9 100644 --- a/arista/redirector.v1/services.gen.swagger.json +++ b/arista/redirector.v1/services.gen.swagger.json @@ -148,6 +148,127 @@ ] } }, + "/api/resources/redirector/v1/Assignment/getsome": { + "post": { + "operationId": "AssignmentService_GetSome", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/arista.redirector.v1.AssignmentSomeResponse" + }, + "error": { + "$ref": "#/definitions/google.rpc.Status" + } + }, + "title": "Stream result of arista.redirector.v1.AssignmentSomeResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "keys", + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/arista.redirector.v1.AssignmentKey" + } + } + }, + { + "name": "time", + "description": "Time indicates the time for which you are interested in the data.\nIf no time is given, the server will use the time at which it makes the request.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + } + ], + "tags": [ + "AssignmentService" + ] + } + }, + "/api/resources/redirector/v1/Assignment/metadata": { + "get": { + "operationId": "AssignmentService_GetMeta", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/arista.redirector.v1.MetaResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "time.start", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "time.end", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + } + ], + "tags": [ + "AssignmentService" + ] + }, + "post": { + "operationId": "AssignmentService_GetMeta2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/arista.redirector.v1.MetaResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/arista.redirector.v1.AssignmentStreamRequest" + } + } + ], + "tags": [ + "AssignmentService" + ] + } + }, "/api/resources/redirector/v1/Assignment/watch": { "get": { "operationId": "AssignmentService_Subscribe", @@ -233,6 +354,92 @@ "AssignmentService" ] } + }, + "/api/resources/redirector/v1/Assignment/watchmetadata": { + "get": { + "operationId": "AssignmentService_SubscribeMeta", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/arista.redirector.v1.MetaResponse" + }, + "error": { + "$ref": "#/definitions/google.rpc.Status" + } + }, + "title": "Stream result of arista.redirector.v1.MetaResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "time.start", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "time.end", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + } + ], + "tags": [ + "AssignmentService" + ] + }, + "post": { + "operationId": "AssignmentService_SubscribeMeta2", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/arista.redirector.v1.MetaResponse" + }, + "error": { + "$ref": "#/definitions/google.rpc.Status" + } + }, + "title": "Stream result of arista.redirector.v1.MetaResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/arista.redirector.v1.AssignmentStreamRequest" + } + } + ], + "tags": [ + "AssignmentService" + ] + } } }, "definitions": { @@ -277,19 +484,37 @@ } } }, + "arista.redirector.v1.AssignmentSomeResponse": { + "type": "object", + "properties": { + "value": { + "$ref": "#/definitions/arista.redirector.v1.Assignment", + "description": "Value is the value requested.\nThis structure will be fully-populated as it exists in the datastore. If\noptional fields were not given at creation, these fields will be empty or\nset to default values." + }, + "error": { + "type": "string", + "description": "Error is an optional field.\nIt should be filled when there is an error in the GetSome process." + }, + "time": { + "type": "string", + "format": "date-time" + } + } + }, "arista.redirector.v1.AssignmentStreamRequest": { "type": "object", "properties": { "partialEqFilter": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/arista.redirector.v1.Assignment" }, "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." }, "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\nThis field is not allowed in the Subscribe RPC." + "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 Assignment at end.\n * Each Assignment response is fully-specified (all fields set).\n * start: Returns the state of each Assignment at start, followed by updates until now.\n * Each Assignment response at start is fully-specified, but updates may be partial.\n * start and end: Returns the state of each Assignment at start, followed by updates\n until end.\n * Each Assignment response at start is fully-specified, but updates until end may\n be partial.\n\nThis field is not allowed in the Subscribe RPC." } } }, @@ -330,6 +555,7 @@ "values": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/arista.redirector.v1.Cluster" }, "title": "values contains the list of clusters associated with the region" @@ -337,6 +563,25 @@ }, "description": "Clusters wraps a cluster list which contain the information about the hosts." }, + "arista.redirector.v1.MetaResponse": { + "type": "object", + "properties": { + "time": { + "type": "string", + "format": "date-time", + "description": "Time holds the timestamp of the last item included in the metadata calculation." + }, + "type": { + "$ref": "#/definitions/arista.subscriptions.Operation", + "description": "Operation indicates how the value in this response should be considered.\nUnder non-subscribe requests, this value should always be INITIAL. In a subscription,\nonce all initial data is streamed and the client begins to receive modification updates,\nyou should not see INITIAL again." + }, + "count": { + "type": "integer", + "format": "int64", + "description": "Count is the number of items present under the conditions of the request." + } + } + }, "arista.subscriptions.Operation": { "type": "string", "enum": [ @@ -397,6 +642,7 @@ "details": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/google.protobuf.Any" } }