Skip to main content

Get

Gets origin group with specified origin group id.

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

const GetOriginGroupRequest =
cloudApi.cdn.origin_group_service.GetOriginGroupRequest;

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

const result = await client.get(
GetOriginGroupRequest.fromPartial({
folderId: "folderId",
// originGroupId: 0
})
);
console.log(result);
})();

GetOriginGroupRequest​

folderId : string​

ID of the folder that the origin group belongs to.

originGroupId : int64​

ID of the origin group to return.

To get a origin group ID, make a OriginGroupService.List request.

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 : OriginNamedMeta​

    A server with a domain name linked to it

  • bucket : OriginNamedMeta​

    An Object Storage bucket not configured as a static site hosting.

  • website : OriginNamedMeta​

    An Object Storage bucket configured as a static site hosting.

  • balancer : OriginBalancerMeta​
    An 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.