-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uDiscovery Redesign #219
Closed
stevenhartley
wants to merge
1
commit into
eclipse-uprotocol:main
from
stevenhartley:uDiscovery-redesign
+1,119
−1,926
Closed
uDiscovery Redesign #219
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
356 changes: 60 additions & 296 deletions
356
up-core-api/uprotocol/core/udiscovery/v3/udiscovery.proto
Large diffs are not rendered by default.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
up-core-api/uprotocol/core/udiscovery/v3/udiscovery_replicator.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under | ||
* the terms of the Apache License Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-FileType: SOURCE | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
syntax = "proto3"; | ||
|
||
package uprotocol.core.udiscovery.v3; | ||
import "google/protobuf/timestamp.proto"; | ||
import "uprotocol/uoptions.proto"; | ||
import "uprotocol/v1/uri.proto"; | ||
import "uprotocol/core/udiscovery/v3/udiscovery.proto"; | ||
|
||
option java_package = "org.eclipse.uprotocol.core.udiscovery.v3"; | ||
option java_outer_classname = "UDiscoveryReplicatorProto"; | ||
option java_multiple_files = true; | ||
|
||
|
||
// UDiscovery Replicator is a set of APIs that are used internal to UDiscovery to populate and replicate | ||
// information in the uDiscovery database. This API is for internal (to UDiscovery service) use only and | ||
// not accessible for client uEs to use. | ||
service UDiscoveryReplicator { | ||
option (uprotocol.service_name) = "core.udiscovery"; // Service name | ||
option (uprotocol.service_version_major) = 3; | ||
option (uprotocol.service_version_minor) = 0; | ||
option (uprotocol.service_id) = 1; | ||
|
||
|
||
// Add, update, or remove one or more UServiceTopic from the Udiscovery database. | ||
// | ||
// This API is used to add, update, or remove UServiceTopic information and is called from | ||
// between UDiscovery services (ex. local to domain, domain to central, etc..). | ||
// To remove a topic, simply set the ttl in SetServiceTopicsRequest to be 0. | ||
// The API returns a SetServiceTopicsResponse when the operation was successful, or it will return an | ||
// error (the method invocation fails) with one of the following reasons: | ||
// UCode.INVALID_ARGUMENT - The URI passed is invalid | ||
// UCode.PERMISSION_DENIED - The caller is not permissed to set the UServiceTopics for that service. | ||
rpc SetServiceTopics(SetServiceTopicsRequest) returns (SetServiceTopicsResponse) { | ||
option (uprotocol.method_id) = 10; | ||
} | ||
} | ||
|
||
// Request message for SetServiceTopics that contains a repeated list of service topic metadata | ||
message SetServiceTopicsRequest { | ||
// The topics to add (update) in the database. | ||
repeated ServiceTopicInfo topics = 1; | ||
|
||
// How long the topic metadata (in seconds) is valid for from the moment the API is called. | ||
// If the metadata has expired, the UDiscovery service that received this data must flush the ServiceTopic info. | ||
// If the field is missed, the ServiceTopicInfo is valid forever. | ||
// If the field is set to 0, the ServiceTopicInfo should be removed from the database immediately. | ||
optional uint32 ttl = 2; | ||
} | ||
|
||
|
||
// Empty message returned from SetServiceTopics when the command returned successfully | ||
message SetServiceTopicsResponse {} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removal is not obvious when ttl is used to request that. Default value 0 by generated code is returned if field is not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mishap4 , Because the field is optional, there is a difference from default and not present, this means we can treat them differntly.