Skip to main content

List

Retrieves the list of functions in the specified folder.

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);
})();

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:

  1. The field name. Currently filtering can only be applied to the Function.name field.
  2. An = operator.
  3. 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_UNSPECIFIED

  • CREATING

    Function is being created.

  • ACTIVE

    Function is ready to be invoked.

  • DELETING

    Function is being deleted.

  • ERROR

    Function 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.