Skip to main content

ListScalingPolicies

Lists existing scaling policies for specified function

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

const ListScalingPoliciesRequest =
cloudApi.serverless.functions_function_service.ListScalingPoliciesRequest;

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

const result = await client.listScalingPolicies(
ListScalingPoliciesRequest.fromPartial({
functionId: "functionId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListScalingPoliciesRequest

functionId : string

ID of the function to retrieve scaling policies for.

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

pageSize : int64

The maximum number of results per page that should be returned. If the number of available results is larger than pageSize, the service returns a ListScalingPoliciesResponse.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 ListScalingPoliciesResponse.next_page_token returned by a previous list request.

ListScalingPoliciesResponse

scalingPolicies : ScalingPolicy

Set of relevant scaling policies.

nextPageToken : string

Token for getting the next page of the list. If the number of results is greater than the specified ListScalingPoliciesRequest.page_size, use nextPageToken as the value for the ListScalingPoliciesRequest.page_token parameter in the next list request.

Each subsequent page will have its own nextPageToken to continue paging through the results.

ScalingPolicy

functionId : string

ID of the function that the scaling policy belongs to.

tag : string

Tag of the version that the scaling policy belongs to. For details, see Version tag.

createdAt : google.protobuf.Timestamp

Creation timestamp for the scaling policy

modifiedAt : google.protobuf.Timestamp

Modification timestamp for the scaling policy

provisionedInstancesCount : int64

Minimum guaranteed provisioned instances count for all zones in total. Billed separately.

zoneInstancesLimit : int64

Upper limit for instance count in each zone. 0 means no limit.

zoneRequestsLimit : int64

Upper limit of requests count in each zone. 0 means no limit.