talos/api/resource/resource.proto
Andrey Smirnov fbfd1eb2b1 refactor: pull new version of os-runtime, update code
This is mostly refactoring to adapt to the new APIs.

There are some small changes which are not user-visible immediately (but
visible when using `talosctl get` to inspect low-level details):

* `extras` namespace is removed, it was a hack to distinguish extra and
system manifests
* `Manifests` are managed by two controllers as shared outputs, stored
in the `controlplane` namespace now
* `talosctl inspect dependencies` output got slightly changed
* resources now have `md.owner` set to the controller name which manages
the resource

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-04-07 06:55:09 -07:00

91 lines
1.8 KiB
Protocol Buffer

syntax = "proto3";
package resource;
option go_package = "github.com/talos-systems/talos/pkg/machinery/api/resource";
option java_multiple_files = true;
option java_outer_classname = "ResourceApi";
option java_package = "com.resource.api";
import "common/common.proto";
// The resource service definition.
//
// ResourceService provides user-facing API for the Talos resources.
service ResourceService {
rpc Get(GetRequest) returns (GetResponse);
rpc List(ListRequest) returns (stream ListResponse);
rpc Watch(WatchRequest) returns (stream WatchResponse);
}
// common resource definition
message Resource {
Metadata metadata = 1;
Spec spec = 2;
}
message Metadata {
string namespace = 1;
string type = 2;
string id = 3;
string version = 4;
string owner = 7;
string phase = 5;
repeated string finalizers = 6;
}
message Spec {
bytes yaml = 1;
}
// rpc Get
message GetRequest {
string namespace = 1;
string type = 2;
string id = 3;
}
// The GetResponse message contains the Resource returned.
message Get {
common.Metadata metadata = 1;
Resource definition = 2;
Resource resource = 3;
}
message GetResponse { repeated Get messages = 1; }
// rpc List
// The ListResponse message contains the Resource returned.
message ListRequest {
string namespace = 1;
string type = 2;
}
message ListResponse {
common.Metadata metadata = 1;
Resource definition = 2;
Resource resource = 3;
}
// rpc Watch
// The WatchResponse message contains the Resource returned.
message WatchRequest {
string namespace = 1;
string type = 2;
string id = 3;
}
enum EventType {
CREATED = 0;
UPDATED = 1;
DESTROYED = 2;
}
message WatchResponse {
common.Metadata metadata = 1;
EventType event_type = 2;
Resource definition = 3;
Resource resource = 4;
}