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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
syntax = "proto3";
package yandex.cloud.loadtesting.api.v1;
option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/loadtesting/api/v1;loadtesting";
option java_package = "yandex.cloud.api.loadtesting.api.v1";
import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
import "yandex/cloud/operation/operation.proto";
import "yandex/cloud/api/operation.proto";
import "yandex/cloud/loadtesting/api/v1/agent/create_compute_instance.proto";
import "yandex/cloud/loadtesting/api/v1/agent/agent.proto";
import "yandex/cloud/validation.proto";
// A set of methods for managing Load Testing agents.
service AgentService {
// Creates an agent in the specified folder.
//
// Also creates a corresponding compute instance.
rpc Create(CreateAgentRequest) returns (operation.Operation) {
option (google.api.http) = { post: "/loadtesting/api/v1/agent" body: "*" };
option (yandex.cloud.api.operation) = {
metadata: "CreateAgentMetadata"
response: "agent.Agent"
};
};
// Returns the specified agent.
//
// To get the list of all available agents, make a [List] request.
rpc Get(GetAgentRequest) returns (agent.Agent) {
option (google.api.http) = { get: "/loadtesting/api/v1/agent/{agent_id}" };
};
// Retrieves the list of agents in the specified folder.
rpc List(ListAgentsRequest) returns (ListAgentsResponse) {
option (google.api.http) = { get: "/loadtesting/api/v1/agent" };
};
// Deletes the specified agent.
//
// Also deletes a corresponding compute instance.
rpc Delete(DeleteAgentRequest) returns (operation.Operation) {
option (google.api.http) = { delete: "/loadtesting/api/v1/agent/{agent_id}"};
option (yandex.cloud.api.operation) = {
metadata: "DeleteAgentMetadata"
response: "google.protobuf.Empty"
};
};
// Updates the specified agent.
rpc Update(UpdateAgentRequest) returns (operation.Operation) {
option (google.api.http) = { patch: "/loadtesting/api/v1/agent/{agent_id}" body: "*"};
option (yandex.cloud.api.operation) = {
metadata: "UpdateAgentMetadata"
response: "agent.Agent"
};
};
}
message CreateAgentRequest {
// ID of the folder to create an agent in.
string folder_id = 1 [(required) = true, (length) = "<=50"];
// Name of the agent.
//
// A created compute instance will have the same name.
string name = 2 [(pattern) = "|[a-z][-a-z0-9]{1,61}[a-z0-9]"];
// Description of the agent.
//
// A created compute instance will have the same description.
string description = 3 [(length) = "<=256"];
// Parameters for compute instance to be created.
agent.CreateComputeInstance compute_instance_params = 4;
// Version of the agent.
//
// If not provided, the most recent agent version will be used.
string agent_version = 5;
// Agent labels as `key:value` pairs.
map<string, string> labels = 6 [(size) = "<=64", (length) = "<=63",
(pattern) = "[-_0-9a-z]*", (map_key).length = "1-63",
(map_key).pattern = "[a-z][-_0-9a-z]*"];
}
message CreateAgentMetadata {
// ID of the agent that is being created.
string agent_id = 1;
}
message GetAgentRequest {
// ID of the agent to return.
string agent_id = 2;
}
message DeleteAgentRequest {
// ID of the agent to delete.
string agent_id = 1;
}
message DeleteAgentMetadata {
// ID of the agent that is being deleted.
string agent_id = 1;
}
message ListAgentsRequest {
// ID of the folder to list agents in.
string folder_id = 1 [(required) = true, (length) = "<=50"];
// The maximum number of results per page to return. If the number of available
// results is larger than `page_size`, the service returns a [ListAgentsResponse.next_page_token]
// that can be used to get the next page of results in subsequent list requests.
// Default value: 100.
int64 page_size = 2 [(value) = "<=1000"];
// Page token. To get the next page of results, set `page_token` to the
// [ListAgentsResponse.next_page_token] returned by a previous list request.
string page_token = 3 [(length) = "<=100"];
// A filter expression that filters agents listed in the response.
//
// The filter expression may contain multiple field expressions joined by `AND`.
// The field expression must specify:
// 1. The field name.
// 2. An operator:
// - `=`, `!=`, `CONTAINS`, for single values.
// - `IN` or `NOT IN` for lists of values.
// 3. The value. String values must be encosed in `"`, boolean values are {`true`, `false`}, timestamp values in ISO-8601.
//
// Currently supported fields:
// - `id` [yandex.cloud.loadtesting.api.v1.agent.Agent.id]
// - operators: `=`, `!=`, `IN`, `NOT IN`
// - `name` [yandex.cloud.loadtesting.api.v1.agent.Agent.name]
// - operators: `=`, `!=`, `IN`, `NOT IN`, `CONTAINS`
//
// Examples:
// - `id IN ("1", "2", "3")`
// - `name CONTAINS "compute-agent-large" AND id NOT IN ("4", "5")`
string filter = 4 [(length) = "<=1000"];
}
message ListAgentsResponse {
// List of agents in the specified folder.
repeated agent.Agent agents = 1;
// Token for getting the next page of the list. If the number of results is greater than
// the specified [ListAgentsRequest.page_size], use `next_page_token` as the value
// for the [ListAgentsRequest.page_token] parameter in the next list request.
//
// Each subsequent page will have its own `next_page_token` to continue paging through the results.
string next_page_token = 2 [(length) = "<=100"];
}
message UpdateAgentRequest {
// ID of the agent to update.
string agent_id = 1 [(required) = true];
// Field mask that specifies which attributes of the agent are going to be updated.
google.protobuf.FieldMask update_mask = 2 [(required) = true];
// New name of the agent.
string name = 3 [(pattern) = "|[a-z][-a-z0-9]{1,61}[a-z0-9]"];
// New description of the agent.
string description = 4 [(length) = "<=256"];
// New parameters of compute instance managed by the agent.
agent.CreateComputeInstance compute_instance_params = 5;
// New labels of the agent.
map<string, string> labels = 6 [(size) = "<=64", (length) = "<=63",
(pattern) = "[-_0-9a-z]*", (map_key).length = "1-63",
(map_key).pattern = "[a-z][-_0-9a-z]*"];
}
message UpdateAgentMetadata {
// ID of the agent that is being updated.
string agent_id = 1;
}
|