List
Retrieves the list of SKUs.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListSkusRequest = cloudApi.billing.sku_service.ListSkusRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.SkuServiceClient);
const result = await client.list(
ListSkusRequest.fromPartial({
currency: "currency",
// billingAccountId: "billingAccountId",
// filter: "filter",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.billing.v1.sku_service_pb2 import ListSkusRequest
from yandex.cloud.billing.v1.sku_service_pb2_grpc import SkuServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(SkuServiceStub)
response = service.List(
ListSkusRequest(
currency="currency",
# billing_account_id = "billingAccountId",
# filter = "filter",
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListSkusRequest
currency
: string
Currency of the prices. Can be one of the following:
RUB
USD
KZT
billingAccountId
: string
Optional ID of the billing account. If specified, contract prices for a particular billing account are included in the response. To get the billing account ID, use BillingAccountService.List request.
filter
: string
A filter expression that filters resources listed in the response. The expression must specify:
- The field name. Currently you can use filtering only on the yandex.cloud.billing.v1.Sku.id and yandex.cloud.billing.v1.Sku.service_id 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]
. E.g.filter=serviceId="dn28hpu6268356q0j8mk"
.
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 ListSkusResponse.next_page_token that can be used to get the next page of results in subsequent list requests.
pageToken
: string
Page token. To get the next page of results, set page_token to the ListSkusResponse.next_page_token returned by a previous list request.
ListSkusResponse
skus
: Sku
List of skus.
nextPageToken
: string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListSkusRequest.page_size, use next_page_token as the value for the ListSkusRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.
Sku
A Stock keeping unit resource.
id
: string
ID of the SKU.
name
: string
Name of the SKU.
description
: string
Description of the sku.
serviceId
: string
ID of the service that sku belongs to.
pricingUnit
: string
Pricing unit of the SKU, e.g. core*hour
, gbyte*hour
.
pricingVersions
: PricingVersion
List of pricing versions.
PricingVersion
Pricing version of the SKU. Defines current and past prices for the sku.
type
: PricingVersionType
Type of the pricing version.
effectiveTime
: google.protobuf.Timestamp
Timestamp pricing version is active since inclusive. The pricing version is active until next pricing version effective time exclusive.
pricingExpressions
: PricingExpression
List of pricing expressions.
PricingExpression
Pricing expression of the pricing version. Defines price for the sku.
rates
: Rate
List of rates.
Rate
Rate of the pricing expression. Define unit price for pricing quantity interval.
startPricingQuantity
: string
Start of the pricing quantity interval. The end of the interval is the start pricing quantity of the next rate.
unitPrice
: string
Unit price for the pricing quantity interval.
currency
: string
Currency of the unit price. Can be one of the following:
RUB
USD
KZT