List
Lists origins of origin group.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListOriginGroupsRequest =
cloudApi.cdn.origin_group_service.ListOriginGroupsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.OriginGroupServiceClient);
const result = await client.list(
ListOriginGroupsRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.cdn.v1.origin_group_service_pb2 import ListOriginGroupsRequest
from yandex.cloud.cdn.v1.origin_group_service_pb2_grpc import OriginGroupServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(OriginGroupServiceStub)
response = service.List(
ListOriginGroupsRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListOriginGroupsRequest
folderId
: string
ID of the folder that the origin group belongs to..
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 ListOriginGroupsResponse.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 ListOriginGroupsResponse.next_page_token returned by a previous list request.
ListOriginGroupsResponse
originGroups
: OriginGroup
List of all Origin Groups associated with folder.
nextPageToken
: string
next_page_token token allows you to get the next page of results for list requests. If the number of results is larger than ListOriginGroupsRequest.page_size, use the next_page_token as the value for the ListOriginGroupsRequest.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.
OriginGroup
Origin group parameters. For details about the concept, see documentation.
id
: int64
ID of the origin group. Generated at creation time.
folderId
: string
ID of the folder that the origin group belongs to.
name
: string
Name of the origin group.
useNext
: bool
This option have two possible conditions: true - the option is active. In case the origin responds with 4XX or 5XX codes, use the next origin from the list. false - the option is disabled.
origins
: Origin
List of origins.
Origin
An origin. For details about the concept, see documentation.
id
: int64
ID of the origin.
originGroupId
: int64
ID of the parent origin group.
source
: string
IP address or Domain name of your origin and the port (if custom).
Used if meta variant is common
.
enabled
: bool
The setting allows to enable or disable an Origin source in the Origins group.
It has two possible values:
True - The origin is enabled and used as a source for the CDN. An origins group must contain at least one enabled origin. False - The origin is disabled and the CDN is not using it to pull content.
backup
: bool
Specifies whether the origin is used in its origin group as backup. A backup origin is used when one of active origins becomes unavailable.
meta
: OriginMeta
Set up origin of the content.
OriginMeta
Origin type. For details about the concept, see documentation.
One of originMetaVariant
Type of the origin.
common
: OriginNamedMetaA server with a domain name linked to it
bucket
: OriginNamedMetaAn Object Storage bucket not configured as a static site hosting.
website
: OriginNamedMetaAn Object Storage bucket configured as a static site hosting.
balancer
: OriginBalancerMetaAn L7 load balancer from Application Load Balancer.
CDN servers will access the load balancer at one of its IP addresses that must be selected in the origin settings.
OriginNamedMeta
Origin info. For details about the concept, see documentation.
name
: string
Name of the origin.
OriginBalancerMeta
Application Load Balancer origin info. For details about the concept, see documentation.
id
: string
ID of the origin.