Skip to main content

Get

Get origin in origin group.

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

const GetOriginRequest = cloudApi.cdn.origin_service.GetOriginRequest;

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

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

GetOriginRequest

folderId : string

ID of the folder that the origin belongs to.

originId : int64

origin_id group ID to request origin from.

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.