Skip to main content

Get

Returns the specified function.

To get the list of all available functions, make a List request.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetFunctionRequest =
cloudApi.serverless.functions_function_service.GetFunctionRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.FunctionServiceClient);

const result = await client.get(
GetFunctionRequest.fromPartial({
functionId: "functionId",
})
);
console.log(result);
})();

GetFunctionRequest

functionId : string

ID of the function to return.

To get a function ID make a FunctionService.List request.

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.