| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 syntax = "proto3"; | 5 syntax = "proto3"; |
| 6 | 6 |
| 7 package logdog; | 7 package logdog; |
| 8 | 8 |
| 9 import "github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1/state.p
roto"; | 9 import "github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1/state.p
roto"; |
| 10 import "github.com/luci/luci-go/logdog/api/logpb/log.proto"; | 10 import "github.com/luci/luci-go/logdog/api/logpb/log.proto"; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 // The list of streams that were identified as the result of the query. | 260 // The list of streams that were identified as the result of the query. |
| 261 repeated Stream streams = 2; | 261 repeated Stream streams = 2; |
| 262 | 262 |
| 263 // If not empty, indicates that there are more query results available. | 263 // If not empty, indicates that there are more query results available. |
| 264 // These results can be requested by repeating the Query request with the | 264 // These results can be requested by repeating the Query request with the |
| 265 // same Path field and supplying this value in the Next field. | 265 // same Path field and supplying this value in the Next field. |
| 266 string next = 3; | 266 string next = 3; |
| 267 } | 267 } |
| 268 | 268 |
| 269 // ListRequest is the request structure for the user List endpoint. | |
| 270 // | |
| 271 // The List endpoint enables a directory-tree style traversal of the project | |
| 272 // and log stream space. | |
| 273 // | |
| 274 // For example, if project "myproj" had streams "a/+/baz", a listing would | |
| 275 // return: | |
| 276 // - Request: project="", path="", Response: {myproj} (Project names) | |
| 277 // - Request: project="myproj", path="", Response: {a} (Path components) | |
| 278 // - Request: project="myproj", path="a", Response: {+} (Path component) | |
| 279 // - Request: project="myproj", path="a/+", Response: {baz} (Stream component) | |
| 280 message ListRequest { | |
| 281 // The project to query. | |
| 282 // | |
| 283 // If this is empty, the list results will show all projects that the user can | |
| 284 // access. | |
| 285 string project = 1; | |
| 286 | |
| 287 // The path base to query. | |
| 288 // | |
| 289 // For example, log streams: | |
| 290 // - foo/bar/+/baz | |
| 291 // - foo/+/qux | |
| 292 // | |
| 293 // A query to path_base "foo" will return "bar" and "+", both path | |
| 294 // components. | |
| 295 string path_base = 2; | |
| 296 | |
| 297 // State, if true, returns that the streams' full state instead of just its | |
| 298 // Path. | |
| 299 bool state = 3; | |
| 300 | |
| 301 // If not empty, indicates that this query should continue at the point where | |
| 302 // the previous query left off. | |
| 303 string next = 4; | |
| 304 | |
| 305 // If true, will return only streams. Otherwise, intermediate path components | |
| 306 // will also be returned. | |
| 307 bool stream_only = 5; | |
| 308 | |
| 309 // If true, indicates that purged streams should show up in the listing. It is | |
| 310 // an error if a non-admin user requests this option. | |
| 311 bool include_purged = 6; | |
| 312 | |
| 313 // Offset, if >= 0, instructs the list operation to skip the supplied number | |
| 314 // of results. This can be used for pagination. | |
| 315 int32 offset = 7; | |
| 316 // The maximum number of componts to return. | |
| 317 // | |
| 318 // If <= 0, no upper bound will be indicated. However, the returned result | |
| 319 // count is still be subject to internal constraints. | |
| 320 int32 max_results = 8; | |
| 321 } | |
| 322 | |
| 323 // ListResponse is the response structure for the user List endpoint. | |
| 324 message ListResponse { | |
| 325 // The project that the streams belong to. | |
| 326 // | |
| 327 // If the request was for the project tier of the list hierarchy, this will | |
| 328 // be empty, and the components list will contain project elements. | |
| 329 string project = 1; | |
| 330 // The hierarchy base that was requested. | |
| 331 string path_base = 2; | |
| 332 | |
| 333 // If not empty, indicates that there are more list results available. | |
| 334 // These results can be requested by repeating the List request with the | |
| 335 // same Path field and supplying this value in the Next field. | |
| 336 string next = 3; | |
| 337 | |
| 338 // The set of listed stream components. | |
| 339 message Component { | |
| 340 enum Type { | |
| 341 PATH = 0; | |
| 342 STREAM = 1; | |
| 343 PROJECT = 2; | |
| 344 } | |
| 345 | |
| 346 // Name is the name of this path component. When combined with the | |
| 347 // response Base, this will form the full stream path. | |
| 348 string name = 1; | |
| 349 // The type of the component. | |
| 350 Type type = 2; | |
| 351 | |
| 352 // State is the log stream descriptor and state for this stream. It will | |
| 353 // only be filled if this is a STREAM component. | |
| 354 // | |
| 355 // It can be requested by setting the request's State field to true. If the | |
| 356 // Proto field is true, the State's Descriptor field will not be included. | |
| 357 LogStreamState state = 3; | |
| 358 | |
| 359 // Descriptor is the JSON-packed log stream descriptor protobuf. It will | |
| 360 // only be filled if this is a STREAM component. | |
| 361 // | |
| 362 // A Descriptor entry corresponds to the Path with the same index. | |
| 363 // | |
| 364 // If the list request's State field is set, the descriptor will be | |
| 365 // populated. | |
| 366 logpb.LogStreamDescriptor desc = 4; | |
| 367 } | |
| 368 repeated Component components = 4; | |
| 369 } | |
| 370 | |
| 371 // Logs is the user-facing log access and query endpoint service. | 269 // Logs is the user-facing log access and query endpoint service. |
| 372 service Logs { | 270 service Logs { |
| 373 // Get returns state and log data for a single log stream. | 271 // Get returns state and log data for a single log stream. |
| 374 rpc Get(GetRequest) returns (GetResponse); | 272 rpc Get(GetRequest) returns (GetResponse); |
| 375 | 273 |
| 376 // Tail returns the last log in the log stream at the time of the request. | 274 // Tail returns the last log in the log stream at the time of the request. |
| 377 rpc Tail(TailRequest) returns (GetResponse); | 275 rpc Tail(TailRequest) returns (GetResponse); |
| 378 | 276 |
| 379 // Query returns log stream paths that match the requested query. | 277 // Query returns log stream paths that match the requested query. |
| 380 rpc Query(QueryRequest) returns (QueryResponse); | 278 rpc Query(QueryRequest) returns (QueryResponse); |
| 381 | |
| 382 // List returns log stream paths rooted under the path hierarchy. | |
| 383 rpc List(ListRequest) returns (ListResponse); | |
| 384 } | 279 } |
| OLD | NEW |