List
Retrieves the list of functions in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListFunctionsRequest =
cloudApi.serverless.functions_function_service.ListFunctionsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.FunctionServiceClient);
const result = await client.list(
ListFunctionsRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.functions.v1.function_service_pb2_grpc import FunctionServiceStub
from yandex.cloud.serverless.functions.v1.function_service_pb2 import ListFunctionsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(FunctionServiceStub)
response = service.List(
ListFunctionsRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListFunctionsRequest
folderId : string
ID of the folder to list functions in.
To get a folder ID make a yandex.cloud.resourcemanager.v1.FolderService.List request.
pageSize : int64
The maximum number of results per page to return. If the number of available
results is larger than pageSize, the service returns a ListFunctionsResponse.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 pageToken to the
ListFunctionsResponse.next_page_token returned by a previous list request.
filter : string
A filter expression that filters functions listed in the response.
The expression must specify:
- The field name. Currently filtering can only be applied to the Function.name field.
- An
=operator. - The value in double quotes (
"). Must be 3-63 characters long and match the regular expression[a-z][-a-z0-9]{1,61}[a-z0-9]. Example of a filter:name="my-function".
ListFunctionsResponse
functions : Function
List of functions 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 ListFunctionsRequest.page_size, use nextPageToken as the value
for the ListFunctionsRequest.page_token parameter in the next list request.
Each subsequent page will have its own nextPageToken to continue paging through the results.
Function
A serverless function. For details about the concept, see Functions.
Status
STATUS_UNSPECIFIEDCREATINGFunction is being created.
ACTIVEFunction is ready to be invoked.
DELETINGFunction is being deleted.
ERRORFunction failed.
id : string
ID of the function. Generated at creation time.
folderId : string
ID of the folder that the function belongs to.
createdAt : google.protobuf.Timestamp
Creation timestamp for the function.
name : string
Name of the function. The name is unique within the folder.
description : string
Description of the function.
labels : string
Function labels as key:value pairs.
httpInvokeUrl : string
URL that needs to be requested to invoke the function.
status : Status
Status of the function.