Managing resource labels
CDN resource labels are key-value pairs used for logical CDN resource labeling.
Adding or updating labels
- In the management console
, select the folder the resource is in. - Go to Cloud CDN.
- In the CDN resource row, click
and select Edit. - Under Content, find the Labels field.
- Click Add label.
- Enter a label in
key: valueformat. To update an existing label, enter its key and a new value. - Press Enter.
- Click Save.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
View the description of the CLI command to update the CDN resource settings:
yc cdn resource update --help -
Get a list of CDN resources in the default folder:
yc cdn resource listResult:
+----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ | ID | CNAME | CREATED AT | UPDATED AT | ACTIVE | OPTIONS | +----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ | bc8jhcx5o47p******** | ****.ru | seconds:1734615244 | seconds:1734615244 | false | edge_cache_settings:{enabled:true | | | | nanos:439618000 | nanos:439638000 | | default_value:345600} | | | | | | | query_params_options:{ignore_query_string:{enabled:true | | | | | | | value:true}} stale:{enabled:true value:"error" | | | | | | | value:"updating"} | +----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ -
Add labels by specifying the name of the CDN resource:
yc cdn resource update <CDN_resource_ID> \ --add-labels <label_1_key>=<label_1_value>,<label_2_key>=<label_2_value>,...,<label_n_key>=<label_n_value>Where
--add-labelsis a parameter to list CDN resource labels inkey=valueformat.Result:
id: bc8jhcx5o47p******** folder_id: b1g681qpemb4******** cname: ****.ru ... labels: key2: value2 key3: value3 key4: value4
Viewing labels
- In the management console
, select the folder the resource is in. - Go to Cloud CDN.
- Navigate to the CDN resource.
- Under Content, find the Labels field.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
View the description of the CLI command to update the CDN resource settings:
yc cdn resource update --help -
Get a list of CDN resources in the default folder:
yc cdn resource listResult:
+----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ | ID | CNAME | CREATED AT | UPDATED AT | ACTIVE | OPTIONS | +----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ | bc8jhcx5o47p******** | ****.ru | seconds:1734615244 | seconds:1734615244 | false | edge_cache_settings:{enabled:true | | | | nanos:439618000 | nanos:439638000 | | default_value:345600} | | | | | | | query_params_options:{ignore_query_string:{enabled:true | | | | | | | value:true}} stale:{enabled:true value:"error" | | | | | | | value:"updating"} | +----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ -
Get information about the labels by specifying the name of the CDN resource:
yc cdn resource get <CDN_resource_ID>Result:
id: bc8jhcx5o47p******** folder_id: b1g681qpemb4******** cname: ****.ru ... labels: key2: value2 key3: value3 key4: value4
Deleting labels
- In the management console
, select the folder the resource is in. - Go to Cloud CDN.
- In the CDN resource row, click
and select Edit. - Under Content, find the Labels field.
- Click
next to the label. - Click Save.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
View the description of the CLI command to update the CDN resource settings:
yc cdn resource update --help -
Get a list of CDN resources in the default folder:
yc cdn resource listResult:
+----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ | ID | CNAME | CREATED AT | UPDATED AT | ACTIVE | OPTIONS | +----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ | bc8jhcx5o47p******** | ****.ru | seconds:1734615244 | seconds:1734615244 | false | edge_cache_settings:{enabled:true | | | | nanos:439618000 | nanos:439638000 | | default_value:345600} | | | | | | | query_params_options:{ignore_query_string:{enabled:true | | | | | | | value:true}} stale:{enabled:true value:"error" | | | | | | | value:"updating"} | +----------------------+---------+--------------------------------+--------------------------------+--------+---------------------------------------------------------+ -
Delete labels by specifying the name of the CDN resource:
yc cdn resource update <CDN_resource_ID> \ --remove-labels <label_1_key>,<label_2_key>,...,<label_n_key>Where
--remove-labelsis a parameter to list the keys of the CDN resource labels.Result:
id: bc8jhcx5o47p******** folder_id: b1g681qpemb4******** cname: ****.ru ... labels: key2: value2 key3: value3 key4: value4To delete all labels, use the
--remove-all-labelsflag:yc cdn resource update <CDN_resource_ID> \ --remove-all-labels