List
Retrieves the list of agents in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListAgentsRequest =
cloudApi.loadtesting.api_agent_service.ListAgentsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.AgentServiceClient);
const result = await client.list(
ListAgentsRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.loadtesting.agent.v1.agent_service_pb2_grpc import AgentServiceStub
from yandex.cloud.loadtesting.api.v1.agent_service_pb2 import ListAgentsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(AgentServiceStub)
response = service.List(
ListAgentsRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListAgentsRequest
folderId
: string
ID of the folder to list agents in.
pageSize
: int64
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.
pageToken
: string
Page token. To get the next page of results, set page_token
to the
ListAgentsResponse.next_page_token returned by a previous list request.
filter
: string
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:
- The field name.
- An operator:
=
,!=
,CONTAINS
, for single values.IN
orNOT IN
for lists of values.
- 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")
ListAgentsResponse
agents
: agent.Agent
List of agents in the specified folder.
nextPageToken
: string
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.
Agent
Load testing agent on which tests are executed.
id
: string
ID of the agent. Generated at creation time.
folderId
: string
ID of the folder that the agent belongs to.
name
: string
Name of the agent.
description
: string
Description of the agent.
computeInstanceId
: string
ID of the compute instance managed by the agent.
Empty if there is no such instance (i.e. the case of external agent).
status
: Status
Status of the agent.
errors
: string
List of errors reported by the agent.
currentJobId
: string
ID of the test that is currently being executed by the agent.
agentVersionId
: string
Version of the agent.
labels
: string
Agent labels as key:value
pairs.
logSettings
: agent.LogSettings
Agent log settings
LogSettings
cloudLogGroupId
: string
Id of Yandex Cloud log group to upload agent logs to