Yandex Cloud
  • Сервисы
  • Решения
  • Почему Yandex Cloud
  • Сообщество
  • Тарифы
  • Документация
  • Связаться с нами
Подключиться
Language / Region
Проект Яндекса
© 2023 ООО «Яндекс.Облако»
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. list

Cloud CDN API, REST: Resource.list

Статья создана
Yandex Cloud
  • HTTP request
  • Query parameters
  • Response

Lists CDN resources.

HTTP request

GET https://cdn.api.cloud.yandex.net/cdn/v1/resources

Query parameters

Parameter Description
folderId

Required. ID of the folder to request listing for.

The maximum string length in characters is 50.

pageSize

The maximum number of results per page to return. If the number of available results is larger than pageSize, the service returns a nextPageToken that can be used to get the next page of results in subsequent list requests.

The maximum value is 1000.

pageToken

Page token. To get the next page of results, set pageToken to the nextPageToken returned by a previous list request.

The maximum string length in characters is 100.

Response

HTTP Code: 200 - OK

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

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

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

          // `resources[].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`resources[].options.queryParamsOptions`

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

          // `resources[].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`resources[].options.compressionOptions`

        },
        "redirectOptions": {

          // `resources[].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`resources[].options.redirectOptions`

        },
        "hostOptions": {

          // `resources[].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`resources[].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"
          }
        }
      }
    }
  ],
  "nextPageToken": "string"
}
Field Description
resources[] object

List of the resources

resources[].
id
string

ID of the resource.

resources[].
folderId
string

Folder id.

resources[].
cname
string

CDN endpoint CNAME, must be unique among resources.

resources[].
createdAt
string (date-time)

Creation timestamp.

String in RFC3339 text format. The range of possible values is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z, i.e. from 0 to 9 digits for fractions of a second.

To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits).

resources[].
updatedAt
string (date-time)

Update timestamp.

String in RFC3339 text format. The range of possible values is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z, i.e. from 0 to 9 digits for fractions of a second.

To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits).

resources[].
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.

resources[].
options
object

Resource settings and options to tune CDN edge behavior.

A major set of various resource options.

resources[].
options.
disableCache
object

Set up a cache status.

Set up bool values.

resources[].
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.

resources[].
options.
disableCache.
value
boolean (boolean)

Value of the option.

resources[].
options.
edgeCacheSettings
object

Set up ResourceOptionsEdgeCacheSettings.

A set of the edge cache parameters.

resources[].
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.

resources[].
options.
edgeCacheSettings.
value
object
Value of the option.
resources[].options.edgeCacheSettings includes only one of the fields value, defaultValue
resources[].
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.

resources[].
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.

resources[].
options.
edgeCacheSettings.
defaultValue
string (int64)
resources[].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.

resources[].
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.

resources[].
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.

resources[].
options.
browserCacheSettings.
value
string (int64)

Value of the option.

resources[].
options.
cacheHttpHeaders
object

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

A set of the string list parameters.

resources[].
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.

resources[].
options.
cacheHttpHeaders.
value[]
string

Value of the option.

resources[].
options.
queryParamsOptions
object

Set up ResourceOptionsQueryParamsOptions.

A set of the query parameters.

resources[].
options.
queryParamsOptions.
ignoreQueryString
object
Using ResourceOptionsBoolOption. Choose the Forward Host header option if is important to send in the request to the Origin the same Host header as was sent in the request to CDN server.
resources[].options.queryParamsOptions includes only one of the fields ignoreQueryString, queryParamsWhitelist, queryParamsBlacklist
resources[].
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.

resources[].
options.
queryParamsOptions.
ignoreQueryString.
value
boolean (boolean)

Value of the option.

resources[].
options.
queryParamsOptions.
queryParamsWhitelist
object
The option allows to compress content with brotli on the CDN's end. Compression is performed on the Origin Shielding. If a pre-cache server doesn't active for a resource, compression does not occur even if the option is enabled. Specify the content-type for each type of content you wish to have compressed. CDN servers will request only uncompressed content from the origin.
resources[].options.queryParamsOptions includes only one of the fields ignoreQueryString, queryParamsWhitelist, queryParamsBlacklist
resources[].
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.

resources[].
options.
queryParamsOptions.
queryParamsWhitelist.
value[]
string

Value of the option.

resources[].
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.
resources[].options.queryParamsOptions includes only one of the fields ignoreQueryString, queryParamsWhitelist, queryParamsBlacklist
resources[].
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.

resources[].
options.
queryParamsOptions.
queryParamsBlacklist.
value[]
string

Value of the option.

resources[].
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.

resources[].
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.

resources[].
options.
slice.
value
boolean (boolean)

Value of the option.

resources[].
options.
compressionOptions
object

Set up compression variant.

A set of the compression variant parameters.

resources[].
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.
resources[].options.compressionOptions includes only one of the fields fetchCompressed, gzipOn, brotliCompression
resources[].
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.

resources[].
options.
compressionOptions.
fetchCompressed.
value
boolean (boolean)

Value of the option.

resources[].
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.
resources[].options.compressionOptions includes only one of the fields fetchCompressed, gzipOn, brotliCompression
resources[].
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.

resources[].
options.
compressionOptions.
gzipOn.
value
boolean (boolean)

Value of the option.

resources[].
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.
resources[].options.compressionOptions includes only one of the fields fetchCompressed, gzipOn, brotliCompression
resources[].
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.

resources[].
options.
compressionOptions.
brotliCompression.
value[]
string

Value of the option.

resources[].
options.
redirectOptions
object

Set up redirects.

A set of the redirect parameters.

resources[].
options.
redirectOptions.
redirectHttpToHttps
object
Using ResourceOptionsBoolOption. GZip compression at CDN servers reduces file size by 70% and can be as high as 90%.
resources[].options.redirectOptions includes only one of the fields redirectHttpToHttps, redirectHttpsToHttp
resources[].
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.

resources[].
options.
redirectOptions.
redirectHttpToHttps.
value
boolean (boolean)

Value of the option.

resources[].
options.
redirectOptions.
redirectHttpsToHttp
object
Using ResourceOptionsBoolOption. Set up a redirect from HTTPS to HTTP.
resources[].options.redirectOptions includes only one of the fields redirectHttpToHttps, redirectHttpsToHttp
resources[].
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.

resources[].
options.
redirectOptions.
redirectHttpsToHttp.
value
boolean (boolean)

Value of the option.

resources[].
options.
hostOptions
object

Set up host parameters.

A set of the host parameters.

resources[].
options.
hostOptions.
host
object
Custom value for the Host header. Your server must be able to process requests with the chosen header. Default value (if enabled is false) is Resource.cname.
resources[].options.hostOptions includes only one of the fields host, forwardHostHeader
resources[].
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.

resources[].
options.
hostOptions.
host.
value
string

Value of the option.

resources[].
options.
hostOptions.
forwardHostHeader
object
Using ResourceOptionsBoolOption. Set up a redirect from HTTP to HTTPS.
resources[].options.hostOptions includes only one of the fields host, forwardHostHeader
resources[].
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.

resources[].
options.
hostOptions.
forwardHostHeader.
value
boolean (boolean)

Value of the option.

resources[].
options.
staticHeaders
object

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

A set of the strings map parameters.

resources[].
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.

resources[].
options.
staticHeaders.
value
object

Value of the option.

resources[].
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.

resources[].
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.

resources[].
options.
cors.
value[]
string

Value of the option.

resources[].
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.

resources[].
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.

resources[].
options.
stale.
value[]
string

Value of the option.

resources[].
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.

resources[].
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.

resources[].
options.
allowedHttpMethods.
value[]
string

Value of the option.

resources[].
options.
proxyCacheMethodsSet
object

Allows caching for GET, HEAD and POST requests.

Set up bool values.

resources[].
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.

resources[].
options.
proxyCacheMethodsSet.
value
boolean (boolean)

Value of the option.

resources[].
options.
disableProxyForceRanges
object

Disabling proxy force ranges.

Set up bool values.

resources[].
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.

resources[].
options.
disableProxyForceRanges.
value
boolean (boolean)

Value of the option.

resources[].
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.

resources[].
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.

resources[].
options.
staticRequestHeaders.
value
object

Value of the option.

resources[].
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.

resources[].
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.

resources[].
options.
customServerName.
value
string

Value of the option.

resources[].
options.
ignoreCookie
object

Using ResourceOptionsBoolOption for ignoring cookie.

Set up bool values.

resources[].
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.

resources[].
options.
ignoreCookie.
value
boolean (boolean)

Value of the option.

resources[].
options.
rewrite
object

Changing or redirecting query paths.

An option for changing or redirecting query paths.

resources[].
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.

resources[].
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.

resources[].
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.
resources[].
secondaryHostnames[]
string

List of secondary hostname strings.

resources[].
originGroupId
string (int64)

ID of the origin group.

resources[].
originGroupName
string

Name of the origin group.

resources[].
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).
resources[].
sslCertificate
object

SSL certificate options.

A SSL certificate parameters.

resources[].
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
resources[].
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.
resources[].
sslCertificate.
data
object

Certificate data.

A certificate data parameters.

resources[].
sslCertificate.
data.
cm
object
Custom (add your SSL certificate by uploading the certificate in PEM format and your private key).
resources[].
sslCertificate.
data.
cm.
id
string

ID of the custom certificate.

nextPageToken string

nextPageToken token allows you to get the next page of results for list requests. If the number of results is larger than pageSize, use the nextPageToken as the value for the pageToken query parameter in the next list request. Each subsequent list request will have its own nextPageToken to continue paging through the results.

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

Language / Region
Проект Яндекса
© 2023 ООО «Яндекс.Облако»
В этой статье:
  • HTTP request
  • Query parameters
  • Response