forked from TheThingsNetwork/lorawan-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch_services.proto
More file actions
131 lines (112 loc) · 5.22 KB
/
search_services.proto
File metadata and controls
131 lines (112 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// Copyright © 2019 The Things Network Foundation, The Things Industries B.V.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
import "github.com/envoyproxy/protoc-gen-validate/validate/validate.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
import "lorawan-stack/api/application.proto";
import "lorawan-stack/api/client.proto";
import "lorawan-stack/api/end_device.proto";
import "lorawan-stack/api/gateway.proto";
import "lorawan-stack/api/identifiers.proto";
import "lorawan-stack/api/organization.proto";
import "lorawan-stack/api/user.proto";
package ttn.lorawan.v3;
option go_package = "go.thethings.network/lorawan-stack/v3/pkg/ttnpb";
// This message is used for finding entities in the EntityRegistrySearch service.
message SearchEntitiesRequest {
// Find entities where the ID contains this substring.
string id_contains = 1 [(gogoproto.customname) = "IDContains"];
// Find entities where the name contains this substring.
string name_contains = 2;
// Find entities where the description contains this substring.
string description_contains = 3;
// Find entities where the given attributes contain these substrings.
map<string,string> attributes_contain = 4 [(validate.rules).map.keys.string = {pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" , max_len: 36}];
reserved 5; // TODO: Add filter for approval state (admin only).
google.protobuf.FieldMask field_mask = 6 [(gogoproto.nullable) = false];
// Order the results by this field path (must be present in the field mask).
// Default ordering is by ID. Prepend with a minus (-) to reverse the order.
string order = 7;
// Limit the number of results per page.
uint32 limit = 8 [(validate.rules).uint32.lte = 1000];
// Page number for pagination. 0 is interpreted as 1.
uint32 page = 9;
}
// The EntityRegistrySearch service indexes entities in the various registries
// and enables searching for them.
// This service is not implemented on all deployments.
service EntityRegistrySearch {
rpc SearchApplications(SearchEntitiesRequest) returns (Applications) {
option (google.api.http) = {
get: "/search/applications"
};
}
rpc SearchClients(SearchEntitiesRequest) returns (Clients) {
option (google.api.http) = {
get: "/search/clients"
};
}
rpc SearchGateways(SearchEntitiesRequest) returns (Gateways) {
option (google.api.http) = {
get: "/search/gateways"
};
}
rpc SearchOrganizations(SearchEntitiesRequest) returns (Organizations) {
option (google.api.http) = {
get: "/search/organizations"
};
}
rpc SearchUsers(SearchEntitiesRequest) returns (Users) {
option (google.api.http) = {
get: "/search/users"
};
}
}
message SearchEndDevicesRequest {
ApplicationIdentifiers application_ids = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false, (validate.rules).message.required = true];
// Find end devices where the ID contains this substring.
string id_contains = 2 [(gogoproto.customname) = "IDContains"];
// Find end devices where the name contains this substring.
string name_contains = 3;
// Find end devices where the description contains this substring.
string description_contains = 4;
// Find end devices where the given attributes contain these substrings.
map<string,string> attributes_contain = 5 [(validate.rules).map.keys.string = {pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" , max_len: 36}];
// Find end devices where the (hexadecimal) DevEUI contains this substring.
string dev_eui_contains = 6 [(gogoproto.customname) = "DevEUIContains"];
// Find end devices where the (hexadecimal) JoinEUI contains this substring.
string join_eui_contains = 7 [(gogoproto.customname) = "JoinEUIContains"];
// Find end devices where the (hexadecimal) DevAddr contains this substring.
string dev_addr_contains = 8 [(gogoproto.customname) = "DevAddrContains"];
google.protobuf.FieldMask field_mask = 9 [(gogoproto.nullable) = false];
// Order the results by this field path (must be present in the field mask).
// Default ordering is by ID. Prepend with a minus (-) to reverse the order.
string order = 10;
// Limit the number of results per page.
uint32 limit = 11 [(validate.rules).uint32.lte = 1000];
// Page number for pagination. 0 is interpreted as 1.
uint32 page = 12;
}
// The EndDeviceRegistrySearch service indexes devices in the EndDeviceRegistry
// and enables searching for them.
// This service is not implemented on all deployments.
service EndDeviceRegistrySearch {
rpc SearchEndDevices(SearchEndDevicesRequest) returns (EndDevices) {
option (google.api.http) = {
get: "/search/applications/{application_ids.application_id}/devices"
};
}
}