Yandex Cloud
  • Сервисы
  • Решения
  • Почему Yandex Cloud
  • Сообщество
  • Тарифы
  • Документация
  • Связаться с нами
Подключиться
Language / Region
© 2022 ООО «Яндекс.Облако»
Yandex Cloud CDN
  • Начало работы
  • Пошаговые инструкции
    • Все инструкции
    • Ресурсы
      • Создать ресурс
      • Изменить основные настройки ресурса
      • Настроить кеширование ресурса
      • Настроить выгрузку логов
      • Предзагрузить файлы на CDN-серверы
      • Очистить кеш ресурса
      • Настроить заголовки запросов и ответов
      • Настроить CORS при ответах клиентам
      • Настроить HTTP-методы
      • Включить сжатие файлов
      • Включить сегментацию файлов
      • Включить экранирование источников
      • Отключить ресурс
      • Удалить ресурс
    • Группы источников
      • Создать группу источников
      • Изменить группу источников
      • Подключить группу источников к ресурсу
      • Удалить группу источников
  • Практические руководства
    • Публикация обновлений для игр
    • Интеграция L7-балансировщика с CDN и Object Storage
    • Сине-зеленое и канареечное развертывание версий сервиса
  • Концепции
    • Обзор сервиса
    • Ресурс
    • Источники и их группы
    • Обмен данными между клиентами и CDN
      • Обзор
      • TLS-сертификаты
      • CORS
      • Сжатие контента
    • Обмен данными между CDN и источниками
      • Обзор
      • Заголовок Host
      • Сегментация контента
      • Экранирование источников
    • Кеширование контента
    • Выгрузка логов
    • Квоты и лимиты
  • Управление доступом
  • Решение проблем
  • Справочник API
    • Аутентификация в API
    • gRPC (англ.)
      • Overview
      • CacheService
      • OriginGroupService
      • OriginService
      • ProviderService
      • RawLogsService
      • ResourceService
      • OperationService
    • REST (англ.)
      • Overview
      • Cache
        • Overview
        • prefetch
        • purge
      • OriginGroup
        • Overview
        • create
        • delete
        • get
        • list
        • update
      • Origin
        • Overview
        • create
        • delete
        • get
        • list
        • update
      • Provider
        • Overview
        • activate
        • listActivated
      • RawLogs
        • Overview
        • activate
        • deactivate
        • get
        • update
      • Resource
        • Overview
        • create
        • delete
        • get
        • getProviderCName
        • list
        • update
  • Правила тарификации
  1. Справочник API
  2. REST (англ.)
  3. Resource
  4. Overview

Resource

Статья создана
Yandex Cloud
  • JSON Representation
  • Methods

Provider's resources management service.

JSON Representation

{
  "id": "string",
  "folderId": "string",
  "cname": "string",
  "createdAt": "string",
  "updatedAt": "string",
  "active": true,
  "options": {
    "disableCache": {
      "enabled": true,
      "value": true
    },
    "edgeCacheSettings": {
      "enabled": true,

      // `options.edgeCacheSettings` includes only one of the fields `value`, `defaultValue`
      "value": {
        "simpleValue": "string",
        "customValues": "object"
      },
      "defaultValue": "string",
      // end of the list of possible fields`options.edgeCacheSettings`

    },
    "browserCacheSettings": {
      "enabled": true,
      "value": "string"
    },
    "cacheHttpHeaders": {
      "enabled": true,
      "value": [
        "string"
      ]
    },
    "queryParamsOptions": {

      // `options.queryParamsOptions` includes only one of the fields `ignoreQueryString`, `queryParamsWhitelist`, `queryParamsBlacklist`
      "ignoreQueryString": {
        "enabled": true,
        "value": true
      },
      "queryParamsWhitelist": {
        "enabled": true,
        "value": [
          "string"
        ]
      },
      "queryParamsBlacklist": {
        "enabled": true,
        "value": [
          "string"
        ]
      },
      // end of the list of possible fields`options.queryParamsOptions`

    },
    "slice": {
      "enabled": true,
      "value": true
    },
    "compressionOptions": {

      // `options.compressionOptions` includes only one of the fields `fetchCompressed`, `gzipOn`, `brotliCompression`
      "fetchCompressed": {
        "enabled": true,
        "value": true
      },
      "gzipOn": {
        "enabled": true,
        "value": true
      },
      "brotliCompression": {
        "enabled": true,
        "value": [
          "string"
        ]
      },
      // end of the list of possible fields`options.compressionOptions`

    },
    "redirectOptions": {

      // `options.redirectOptions` includes only one of the fields `redirectHttpToHttps`, `redirectHttpsToHttp`
      "redirectHttpToHttps": {
        "enabled": true,
        "value": true
      },
      "redirectHttpsToHttp": {
        "enabled": true,
        "value": true
      },
      // end of the list of possible fields`options.redirectOptions`

    },
    "hostOptions": {

      // `options.hostOptions` includes only one of the fields `host`, `forwardHostHeader`
      "host": {
        "enabled": true,
        "value": "string"
      },
      "forwardHostHeader": {
        "enabled": true,
        "value": true
      },
      // end of the list of possible fields`options.hostOptions`

    },
    "staticHeaders": {
      "enabled": true,
      "value": "object"
    },
    "cors": {
      "enabled": true,
      "value": [
        "string"
      ]
    },
    "stale": {
      "enabled": true,
      "value": [
        "string"
      ]
    },
    "allowedHttpMethods": {
      "enabled": true,
      "value": [
        "string"
      ]
    },
    "proxyCacheMethodsSet": {
      "enabled": true,
      "value": true
    },
    "disableProxyForceRanges": {
      "enabled": true,
      "value": true
    },
    "staticRequestHeaders": {
      "enabled": true,
      "value": "object"
    },
    "customServerName": {
      "enabled": true,
      "value": "string"
    },
    "ignoreCookie": {
      "enabled": true,
      "value": true
    },
    "rewrite": {
      "enabled": true,
      "body": "string",
      "flag": "string"
    }
  },
  "secondaryHostnames": [
    "string"
  ],
  "originGroupId": "string",
  "originGroupName": "string",
  "originProtocol": "string",
  "sslCertificate": {
    "type": "string",
    "status": "string",
    "data": {
      "cm": {
        "id": "string"
      }
    }
  }
}
Field Description
id string

ID of the resource.

folderId string

Folder id.

cname string

CDN endpoint CNAME, must be unique among resources.

createdAt string (date-time)

Creation timestamp.

String in RFC3339 text format.

updatedAt string (date-time)

Update timestamp.

String in RFC3339 text format.

active boolean (boolean)

Flag to create Resource either in active or disabled state. True - the content from CDN is available to clients. False - the content from CDN isn't available to clients.

options object

Resource settings and options to tune CDN edge behavior.

A major set of various resource options.

options.
disableCache
object

Set up a cache status.

Set up bool values.

options.
disableCache.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
disableCache.
value
boolean (boolean)

Value of the option.

options.
edgeCacheSettings
object

Set up ResourceOptionsEdgeCacheSettings.

A set of the edge cache parameters.

options.
edgeCacheSettings.
enabled
boolean (boolean)

True - the option is enabled and its values_variant is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
edgeCacheSettings.
value
object
options.edgeCacheSettings includes only one of the fields value, defaultValue

A set of the caching response time parameters.

options.
edgeCacheSettings.
value.
simpleValue
string (int64)

Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use 0s disable to caching. Use customValues field to specify a custom caching time for a response with specific codes.

options.
edgeCacheSettings.
value.
customValues
object

Caching time for a response with specific codes. These settings have a higher priority than the value field. Response code (304, 404 for example). Use any to specify caching time for all response codes. Caching time in seconds (0s, 600s for example). Use 0s to disable caching for a specific response code.

options.
edgeCacheSettings.
defaultValue
string (int64)
options.edgeCacheSettings includes only one of the fields value, defaultValue

Content will be cached according to origin cache settings. The value applies for a response with codes 200, 201, 204, 206, 301, 302, 303, 304, 307, 308 if an origin server does not have caching HTTP headers. Responses with other codes will not be cached.

options.
browserCacheSettings
object

Using ResourceOptionsInt64Option. Set up a cache period for the end-users browser. Content will be cached due to origin settings. If there are no cache settings on your origin, the content will not be cached. The list of HTTP response codes that can be cached in browsers: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308. Other response codes will not be cached. The default value is 4 days.

A set of the numeric parameters.

options.
browserCacheSettings.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
browserCacheSettings.
value
string (int64)

Value of the option.

options.
cacheHttpHeaders
object

List HTTP headers that must be included in responses to clients.

A set of the string list parameters.

options.
cacheHttpHeaders.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
cacheHttpHeaders.
value[]
string

Value of the option.

options.
queryParamsOptions
object

Set up ResourceOptionsQueryParamsOptions.

A set of the query parameters.

options.
queryParamsOptions.
ignoreQueryString
object
options.queryParamsOptions includes only one of the fields ignoreQueryString, queryParamsWhitelist, queryParamsBlacklist

Set up bool values.

options.
queryParamsOptions.
ignoreQueryString.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
queryParamsOptions.
ignoreQueryString.
value
boolean (boolean)

Value of the option.

options.
queryParamsOptions.
queryParamsWhitelist
object
options.queryParamsOptions includes only one of the fields ignoreQueryString, queryParamsWhitelist, queryParamsBlacklist

A set of the string list parameters.

options.
queryParamsOptions.
queryParamsWhitelist.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
queryParamsOptions.
queryParamsWhitelist.
value[]
string

Value of the option.

options.
queryParamsOptions.
queryParamsBlacklist
object
Ignore All Except. Files with the specified query parameters are cached as objects with different keys, files with other parameters are cached as objects with the same key.
options.queryParamsOptions includes only one of the fields ignoreQueryString, queryParamsWhitelist, queryParamsBlacklist

A set of the string list parameters.

options.
queryParamsOptions.
queryParamsBlacklist.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
queryParamsOptions.
queryParamsBlacklist.
value[]
string

Value of the option.

options.
slice
object

Files larger than 10 MB will be requested and cached in parts (no larger than 10 MB each part). It reduces time to first byte.

The origin must support HTTP Range requests.

By default the option is disabled.

Set up bool values.

options.
slice.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
slice.
value
boolean (boolean)

Value of the option.

options.
compressionOptions
object

Set up compression variant.

A set of the compression variant parameters.

options.
compressionOptions.
fetchCompressed
object
Using ResourceOptionsBoolOption. Selected by default. Files with different query parameters are cached as objects with the same key regardless of the parameter value.
options.compressionOptions includes only one of the fields fetchCompressed, gzipOn, brotliCompression

Set up bool values.

options.
compressionOptions.
fetchCompressed.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
compressionOptions.
fetchCompressed.
value
boolean (boolean)

Value of the option.

options.
compressionOptions.
gzipOn
object
The Fetch compressed option helps you to reduce the bandwidth between origin and CDN servers. Also, content delivery speed becomes higher because of reducing the time for compressing files in a CDN.
options.compressionOptions includes only one of the fields fetchCompressed, gzipOn, brotliCompression

Set up bool values.

options.
compressionOptions.
gzipOn.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
compressionOptions.
gzipOn.
value
boolean (boolean)

Value of the option.

options.
compressionOptions.
brotliCompression
object
Ignore only. Files with the specified query parameters are cached as objects with the same key, files with other parameters are cached as objects with different keys.
options.compressionOptions includes only one of the fields fetchCompressed, gzipOn, brotliCompression

A set of the string list parameters.

options.
compressionOptions.
brotliCompression.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
compressionOptions.
brotliCompression.
value[]
string

Value of the option.

options.
redirectOptions
object

Set up redirects.

A set of the redirect parameters.

options.
redirectOptions.
redirectHttpToHttps
object
Using ResourceOptionsBoolOption. GZip compression at CDN servers reduces file size by 70% and can be as high as 90%.
options.redirectOptions includes only one of the fields redirectHttpToHttps, redirectHttpsToHttp

Set up bool values.

options.
redirectOptions.
redirectHttpToHttps.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
redirectOptions.
redirectHttpToHttps.
value
boolean (boolean)

Value of the option.

options.
redirectOptions.
redirectHttpsToHttp
object
Using ResourceOptionsBoolOption. Set up a redirect from HTTPS to HTTP.
options.redirectOptions includes only one of the fields redirectHttpToHttps, redirectHttpsToHttp

Set up bool values.

options.
redirectOptions.
redirectHttpsToHttp.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
redirectOptions.
redirectHttpsToHttp.
value
boolean (boolean)

Value of the option.

options.
hostOptions
object

Set up host parameters.

A set of the host parameters.

options.
hostOptions.
host
object
options.hostOptions includes only one of the fields host, forwardHostHeader

A set of the string parameters.

options.
hostOptions.
host.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
hostOptions.
host.
value
string

Value of the option.

options.
hostOptions.
forwardHostHeader
object
Using ResourceOptionsBoolOption. Set up a redirect from HTTP to HTTPS.
options.hostOptions includes only one of the fields host, forwardHostHeader

Set up bool values.

options.
hostOptions.
forwardHostHeader.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
hostOptions.
forwardHostHeader.
value
boolean (boolean)

Value of the option.

options.
staticHeaders
object

Set up static headers that CDN servers send in responses to clients.

A set of the strings map parameters.

options.
staticHeaders.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
staticHeaders.
value
object

Value of the option.

options.
cors
object

Parameter that lets browsers get access to selected resources from a domain different to a domain from which the request is received. Read more.

A set of the string list parameters.

options.
cors.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
cors.
value[]
string

Value of the option.

options.
stale
object

List of errors which instruct CDN servers to serve stale content to clients.

Possible values: error, http_403, http_404, http_429, http_500, http_502, http_503, http_504, invalid_header, timeout, updating.

A set of the string list parameters.

options.
stale.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
stale.
value[]
string

Value of the option.

options.
allowedHttpMethods
object

HTTP methods for your CDN content. By default the following methods are allowed: GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS. In case some methods are not allowed to the user, they will get the 405 (Method Not Allowed) response. If the method is not supported, the user gets the 501 (Not Implemented) response.

A set of the string list parameters.

options.
allowedHttpMethods.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
allowedHttpMethods.
value[]
string

Value of the option.

options.
proxyCacheMethodsSet
object

Allows caching for GET, HEAD and POST requests.

Set up bool values.

options.
proxyCacheMethodsSet.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
proxyCacheMethodsSet.
value
boolean (boolean)

Value of the option.

options.
disableProxyForceRanges
object

Disabling proxy force ranges.

Set up bool values.

options.
disableProxyForceRanges.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
disableProxyForceRanges.
value
boolean (boolean)

Value of the option.

options.
staticRequestHeaders
object

Set up custom headers that CDN servers send in requests to origins. The Header name field can contain letters (A-Z, a-z), numbers (0-9), dashes (-) and underscores (). The Value field can contain letters (A-Z, a-z), numbers (0-9), dashes (-), underscores (), slashes (/), colons (:), equal (=), dots (.), and spaces.

A set of the strings map parameters.

options.
staticRequestHeaders.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
staticRequestHeaders.
value
object

Value of the option.

options.
customServerName
object

Wildcard additional CNAME. If a resource has a wildcard additional CNAME, you can use your own certificate for content delivery via HTTPS. Read-only.

A set of the string parameters.

options.
customServerName.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
customServerName.
value
string

Value of the option.

options.
ignoreCookie
object

Using ResourceOptionsBoolOption for ignoring cookie.

Set up bool values.

options.
ignoreCookie.
enabled
boolean (boolean)

True - the option is enabled and its value is applied to the resource. False - the option is disabled and its default value is used for the resource.

options.
ignoreCookie.
value
boolean (boolean)

Value of the option.

options.
rewrite
object

Changing or redirecting query paths.

An option for changing or redirecting query paths.

options.
rewrite.
enabled
boolean (boolean)

True - the option is enabled and its flag is applied to the resource. False - the option is disabled and its default value of the flag is used for the resource.

options.
rewrite.
body
string

Pattern for rewrite.

The value must have the following format: <source path> <destination path>, where both paths are regular expressions which use at least one group. E.g., /foo/(.*) /bar/$1.

options.
rewrite.
flag
string

Break flag is applied to the option by default. It is not shown in the field.

RewriteFlag defines flag for the Rewrite option.

  • LAST: Stops processing of the current set of ngx_http_rewrite_module directives and starts a search for a new location matching changed URI.
  • BREAK: Stops processing of the current set of the Rewrite option.
  • REDIRECT: Returns a temporary redirect with the 302 code; It is used when a replacement string does not start with "http://", "https://", or "$scheme".
  • PERMANENT: Returns a permanent redirect with the 301 code.
secondaryHostnames[] string

List of secondary hostname strings.

originGroupId string (int64)

ID of the origin group.

originGroupName string

Name of the origin group.

originProtocol string

Specify the protocol schema to be used in communication with origin.

This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, we will use HTTP to connect to an origin server.

  • HTTP: CDN servers will connect to your origin via HTTP.
  • HTTPS: CDN servers will connect to your origin via HTTPS.
  • MATCH: Connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).
sslCertificate object

SSL certificate options.

A SSL certificate parameters.

sslCertificate.
type
string

Type of the certificate.

A certificate type parameters.

  • SSL_CERTIFICATE_TYPE_UNSPECIFIED: SSL certificate is unspecified.
  • DONT_USE: No SSL certificate is added, the requests are sent via HTTP.
  • LETS_ENCRYPT_GCORE: Works only if you have already pointed your domain name to the protected IP address in your DNS
  • CM: Add your SSL certificate by uploading the certificate in PEM format and your private key
sslCertificate.
status
string

Active status.

A certificate status parameters.

  • SSL_CERTIFICATE_STATUS_UNSPECIFIED: SSL certificate is unspecified.
  • READY: SSL certificate is ready to use.
  • CREATING: SSL certificate is creating.
sslCertificate.
data
object

Certificate data.

A certificate data parameters.

sslCertificate.
data.
cm
object

A certificate data custom parameters.

sslCertificate.
data.
cm.
id
string

ID of the custom certificate.

Methods

Method Description
create Creates a CDN resource in the specified folder.
delete Deletes client's CDN resource.
get Get client's CDN resource by resource id.
getProviderCName Get Provider's CNAME (edge endpoint) bind to specified folder id. Returns UNIMPLEMENTED error, if provider doesn't support CNAME request.
list Lists CDN resources.
update Updates the specified CDN resource.

Была ли статья полезна?

Language / Region
© 2022 ООО «Яндекс.Облако»
В этой статье:
  • JSON Representation
  • Methods