Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.3.11"
version = "2.3.12"
authors = ["Gaius <gaius.qi@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
2,731 changes: 1,409 additions & 1,322 deletions pkg/apis/scheduler/v2/scheduler.pb.go

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions pkg/apis/scheduler/v2/scheduler.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions pkg/apis/scheduler/v2/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,23 @@ message ListPeersRequest {
min_len: 1
ignore_empty: true
}];
// Page size is the maximum number of peers to return. The scheduler may
// return fewer peers than this value. If unspecified, all the peers are
// returned.
optional int32 page_size = 2 [(validate.rules).int32.gte = 0];
// Page token is the next page token received from a previous ListPeers
// call, provide it to retrieve the subsequent page. When paginating, all
// other parameters must match the call that provided the page token.
optional string page_token = 3;
}

// ListPeersResponse represents response of ListPeers.
message ListPeersResponse {
// Peers info.
repeated common.v2.Peer peers = 1;
// Next page token is sent as the page token to retrieve the next page. If it
// is not set, there are no subsequent pages.
optional string next_page_token = 2;
}

// AnnounceHostRequest represents request of AnnounceHost.
Expand All @@ -252,12 +263,23 @@ message AnnounceHostRequest {
message ListHostsRequest {
// Type to filter hosts.
optional uint32 type = 1;
// Page size is the maximum number of hosts to return. The scheduler may
// return fewer hosts than this value. If unspecified, all the hosts are
// returned.
optional int32 page_size = 2 [(validate.rules).int32.gte = 0];
// Page token is the next page token received from a previous ListHosts
// call, provide it to retrieve the subsequent page. When paginating, all
// other parameters must match the call that provided the page token.
optional string page_token = 3;
}

// ListHostsResponse represents response of ListHosts.
message ListHostsResponse {
// Hosts info.
repeated common.v2.Host hosts = 1;
// Next page token is sent as the page token to retrieve the next page. If it
// is not set, there are no subsequent pages.
optional string next_page_token = 2;
}

// DeleteHostRequest represents request of DeleteHost.
Expand Down
22 changes: 22 additions & 0 deletions proto/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,23 @@ message DeleteTaskRequest {
message ListPeersRequest {
// Task id to filter peers.
optional string task_id = 1;
// Page size is the maximum number of peers to return. The scheduler may
// return fewer peers than this value. If unspecified, all the peers are
// returned.
optional int32 page_size = 2;
// Page token is the next page token received from a previous ListPeers
// call, provide it to retrieve the subsequent page. When paginating, all
// other parameters must match the call that provided the page token.
optional string page_token = 3;
}

// ListPeersResponse represents response of ListPeers.
message ListPeersResponse {
// Peers info.
repeated common.v2.Peer peers = 1;
// Next page token is sent as the page token to retrieve the next page. If it
// is not set, there are no subsequent pages.
optional string next_page_token = 2;
}

// AnnounceHostRequest represents request of AnnounceHost.
Expand All @@ -224,12 +235,23 @@ message AnnounceHostRequest {
message ListHostsRequest {
// Type to filter hosts.
optional uint32 type = 1;
// Page size is the maximum number of hosts to return. The scheduler may
// return fewer hosts than this value. If unspecified, all the hosts are
// returned.
optional int32 page_size = 2;
// Page token is the next page token received from a previous ListHosts
// call, provide it to retrieve the subsequent page. When paginating, all
// other parameters must match the call that provided the page token.
optional string page_token = 3;
}

// ListHostsResponse represents response of ListHosts.
message ListHostsResponse {
// Hosts info.
repeated common.v2.Host hosts = 1;
// Next page token is sent as the page token to retrieve the next page. If it
// is not set, there are no subsequent pages.
optional string next_page_token = 2;
}

// DeleteHostRequest represents request of DeleteHost.
Expand Down
298 changes: 149 additions & 149 deletions python/dragonfly_api/scheduler_pb2.py

Large diffs are not rendered by default.

28 changes: 20 additions & 8 deletions python/dragonfly_api/scheduler_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,22 @@ class DeleteTaskRequest(_message.Message):
def __init__(self, host_id: _Optional[str] = ..., task_id: _Optional[str] = ...) -> None: ...

class ListPeersRequest(_message.Message):
__slots__ = ("task_id",)
__slots__ = ("task_id", "page_size", "page_token")
TASK_ID_FIELD_NUMBER: _ClassVar[int]
PAGE_SIZE_FIELD_NUMBER: _ClassVar[int]
PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
task_id: str
def __init__(self, task_id: _Optional[str] = ...) -> None: ...
page_size: int
page_token: str
def __init__(self, task_id: _Optional[str] = ..., page_size: _Optional[int] = ..., page_token: _Optional[str] = ...) -> None: ...

class ListPeersResponse(_message.Message):
__slots__ = ("peers",)
__slots__ = ("peers", "next_page_token")
PEERS_FIELD_NUMBER: _ClassVar[int]
NEXT_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
peers: _containers.RepeatedCompositeFieldContainer[_common_pb2.Peer]
def __init__(self, peers: _Optional[_Iterable[_Union[_common_pb2.Peer, _Mapping]]] = ...) -> None: ...
next_page_token: str
def __init__(self, peers: _Optional[_Iterable[_Union[_common_pb2.Peer, _Mapping]]] = ..., next_page_token: _Optional[str] = ...) -> None: ...

class AnnounceHostRequest(_message.Message):
__slots__ = ("host", "interval")
Expand All @@ -211,16 +217,22 @@ class AnnounceHostRequest(_message.Message):
def __init__(self, host: _Optional[_Union[_common_pb2.Host, _Mapping]] = ..., interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ...) -> None: ...

class ListHostsRequest(_message.Message):
__slots__ = ("type",)
__slots__ = ("type", "page_size", "page_token")
TYPE_FIELD_NUMBER: _ClassVar[int]
PAGE_SIZE_FIELD_NUMBER: _ClassVar[int]
PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
type: int
def __init__(self, type: _Optional[int] = ...) -> None: ...
page_size: int
page_token: str
def __init__(self, type: _Optional[int] = ..., page_size: _Optional[int] = ..., page_token: _Optional[str] = ...) -> None: ...

class ListHostsResponse(_message.Message):
__slots__ = ("hosts",)
__slots__ = ("hosts", "next_page_token")
HOSTS_FIELD_NUMBER: _ClassVar[int]
NEXT_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
hosts: _containers.RepeatedCompositeFieldContainer[_common_pb2.Host]
def __init__(self, hosts: _Optional[_Iterable[_Union[_common_pb2.Host, _Mapping]]] = ...) -> None: ...
next_page_token: str
def __init__(self, hosts: _Optional[_Iterable[_Union[_common_pb2.Host, _Mapping]]] = ..., next_page_token: _Optional[str] = ...) -> None: ...

class DeleteHostRequest(_message.Message):
__slots__ = ("host_id",)
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.
30 changes: 29 additions & 1 deletion src/scheduler.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ pub struct ListPeersRequest {
/// Task id to filter peers.
#[prost(string, optional, tag = "1")]
pub task_id: ::core::option::Option<::prost::alloc::string::String>,
/// Page size is the maximum number of peers to return. The scheduler may
/// return fewer peers than this value. If unspecified, all the peers are
/// returned.
#[prost(int32, optional, tag = "2")]
pub page_size: ::core::option::Option<i32>,
/// Page token is the next page token received from a previous ListPeers
/// call, provide it to retrieve the subsequent page. When paginating, all
/// other parameters must match the call that provided the page token.
#[prost(string, optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// ListPeersResponse represents response of ListPeers.
#[derive(serde::Serialize, serde::Deserialize)]
Expand All @@ -284,6 +294,10 @@ pub struct ListPeersResponse {
/// Peers info.
#[prost(message, repeated, tag = "1")]
pub peers: ::prost::alloc::vec::Vec<super::super::common::v2::Peer>,
/// Next page token is sent as the page token to retrieve the next page. If it
/// is not set, there are no subsequent pages.
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// AnnounceHostRequest represents request of AnnounceHost.
#[derive(serde::Serialize, serde::Deserialize)]
Expand All @@ -298,11 +312,21 @@ pub struct AnnounceHostRequest {
}
/// ListHostsRequest represents request of ListHosts.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListHostsRequest {
/// Type to filter hosts.
#[prost(uint32, optional, tag = "1")]
pub r#type: ::core::option::Option<u32>,
/// Page size is the maximum number of hosts to return. The scheduler may
/// return fewer hosts than this value. If unspecified, all the hosts are
/// returned.
#[prost(int32, optional, tag = "2")]
pub page_size: ::core::option::Option<i32>,
/// Page token is the next page token received from a previous ListHosts
/// call, provide it to retrieve the subsequent page. When paginating, all
/// other parameters must match the call that provided the page token.
#[prost(string, optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// ListHostsResponse represents response of ListHosts.
#[derive(serde::Serialize, serde::Deserialize)]
Expand All @@ -311,6 +335,10 @@ pub struct ListHostsResponse {
/// Hosts info.
#[prost(message, repeated, tag = "1")]
pub hosts: ::prost::alloc::vec::Vec<super::super::common::v2::Host>,
/// Next page token is sent as the page token to retrieve the next page. If it
/// is not set, there are no subsequent pages.
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// DeleteHostRequest represents request of DeleteHost.
#[derive(serde::Serialize, serde::Deserialize)]
Expand Down
Loading