Skip to content

Replace CDN cache rule.

PUT
/api/config/namespaces/{metadata.namespace}/cdn_cache_rules/{metadata.name}
curl --request PUT \
--url https://example-corp.console.ves.volterra.io/api/v1/api/production/us-east-1/namespaces/default/api/config/namespaces/example/cdn_cache_rules/example \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "metadata": { "annotations": {}, "description": "example", "disable": true, "labels": {}, "name": "example", "namespace": "example" }, "spec": { "cache_rules": { "cache_bypass": {}, "eligible_for_cache": { "scheme_proxy_host_request_uri": { "cache_override": true, "cache_ttl": "example", "ignore_response_cookie": true }, "scheme_proxy_host_uri": { "cache_override": true, "cache_ttl": "example", "ignore_response_cookie": true } }, "rule_expression_list": [ { "cache_rule_expression": [ { "cache_headers": [ { "name": "PROXY_HOST", "operator": { "Contains": "example", "DoesNotContain": "example", "DoesNotEndWith": "example", "DoesNotEqual": "example", "DoesNotStartWith": "example", "Endswith": "example", "Equals": "example", "MatchRegex": "example", "Startswith": "example" } } ], "cookie_matcher": [ { "name": "example", "operator": { "Contains": "example", "DoesNotContain": "example", "DoesNotEndWith": "example", "DoesNotEqual": "example", "DoesNotStartWith": "example", "Endswith": "example", "Equals": "example", "MatchRegex": "example", "Startswith": "example" } } ], "path_match": { "operator": { "Contains": "example", "DoesNotContain": "example", "DoesNotEndWith": "example", "DoesNotEqual": "example", "DoesNotStartWith": "example", "Endswith": "example", "Equals": "example", "MatchRegex": "example", "Startswith": "example" } }, "query_parameters": [ { "key": "example", "operator": { "Contains": "example", "DoesNotContain": "example", "DoesNotEndWith": "example", "DoesNotEqual": "example", "DoesNotStartWith": "example", "Endswith": "example", "Equals": "example", "MatchRegex": "example", "Startswith": "example" } } ] } ], "expression_name": "example" } ], "rule_name": "example" } } }'

Shape of the CDN loadbalancer specification.

Examples of this operation.

metadata.namespace
required
string

Namespace This defines the workspace within which each the configuration object is to be created. Must be a DNS_LABEL format. For a namespace object itself, namespace value will be ""

metadata.name
required
string

Name The configuration object to be replaced will be looked up by name.

Media typeapplication/json
ReplaceRequest is used to replace contents of a cdn_cache_rule

This is the input message of the ‘Replace’ RPC.

object
metadata
object
annotations
annotations

Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.

object
description
description

Human readable description for the object.

string
>= 21 characters <= 1200 characters
disable
disable

A value of true will administratively disable the object.

boolean format: boolean
labels
labels

Map of string keys and values that can be used to organize and categorize (scope and select) objects as chosen by the user. Values specified here will be used by selector expression.

object
name
name

This is the name of configuration object. It has to be unique within the namespace. It can only be specified during create API and cannot be changed during replace API. The value of name has to follow DNS-1035 format. Required: YES.

string
>= 6 characters <= 1024 characters
namespace
namespace

This defines the workspace within which each the configuration object is to be created. Must be a DNS_LABEL format. For a namespace object itself, namespace value will be ""

string
>= 6 characters <= 1024 characters
spec
object
cache_rules
object
cache_bypass
object
eligible_for_cache
object
scheme_proxy_host_request_uri
object
cache_override
Cache Override

Honour Cache Override.

boolean format: boolean
cache_ttl
Cache TTL Key

Cache TTL value is used to cache the resource/content for the specified amount of time Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days Required: YES.

string
<= 1024 characters
ignore_response_cookie
Set Cookie

By default, response will not be cached if set-cookie header is present. This option will override the behavior and cache response even with set-cookie header present.

boolean format: boolean
scheme_proxy_host_uri
object
cache_override
Cache Override

Honour Cache Override.

boolean format: boolean
cache_ttl
Cache TTL Key

Cache TTL value is used to cache the resource/content for the specified amount of time Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days Required: YES.

string
<= 1024 characters
ignore_response_cookie
Set Cookie

By default, response will not be cached if set-cookie header is present. This option will override the behavior and cache response even with set-cookie header present.

boolean format: boolean
rule_expression_list
Expression List

Expressions are evaluated in the order in which they are specified. The evaluation stops when the first rule match occurs..

Required: YES.

Array<object>
>= 1 items <= 8 items
Cache Rule Expression List

CDN Cache Rule Expressions.

object
cache_rule_expression
Terms

The Cache Rule Expression Terms that are ANDed

Required: YES.

Array<object>
>= 1 items <= 8 items
CDNCacheRuleExpression

Select one of the field OPTIONS.

object
cache_headers
Cache Headers

Configure cache rule headers to match the criteria.

Array<object>
<= 8 items
CacheHeaderMatcherType

Header match is done using the name of the header and its value. The value match is done using one of the following regex match on value exact match of value presence of header

Header Match can also be inverse of above, which be used to check missing header or non-matching value.

object
name
string
default: PROXY_HOST
Allowed values: PROXY_HOST REFERER SCHEME USER_AGENT
operator
object
Contains
Contains

Exclusive with [DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must contain.

string
<= 1024 characters
DoesNotContain
Does Not Contain

Exclusive with [Contains DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not contain.

string
<= 1024 characters
DoesNotEndWith
Does Not End With

Exclusive with [Contains DoesNotContain DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not end with.

string
<= 1024 characters
DoesNotEqual
Does Not Equal

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not equal.

string
<= 1024 characters
DoesNotStartWith
Does Not Start With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual Endswith Equals MatchRegex Startswith] Field must not start with.

string
<= 1024 characters
Endswith
Ends With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Equals MatchRegex Startswith] Field must end with.

string
<= 1024 characters
Equals
Equals

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith MatchRegex Startswith] Field must exactly match.

string
<= 1024 characters
MatchRegex
Matches Regex

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals Startswith] Field matches PCRE 1 compliant regular expression.

string
>= 1 characters <= 256 characters
Startswith
Starts With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex] Field must start with.

string
<= 1024 characters
cookie_matcher
cookie matchers

A list of predicates for all cookies that need to be matched. The criteria for matching each cookie is described in individual instances of CookieMatcherType. The actual cookie values are extracted from the request API as a list of strings for each cookie name. Note that all specified cookie matcher predicates must evaluate to true.

Array<object>
<= 8 items
CacheCookieMatcherType

A cookie matcher specifies the name of a single cookie and the criteria to match it. The input has a list of values for each cookie in the request. A cookie matcher can check for one of the following:

  • Presence or absence of the cookie
  • At least one of the values for the cookie in the request satisfies the MatcherType item.
object
name
name

A case-sensitive cookie name. Required: YES.

string
>= 6 characters <= 256 characters
operator
object
Contains
Contains

Exclusive with [DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must contain.

string
<= 1024 characters
DoesNotContain
Does Not Contain

Exclusive with [Contains DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not contain.

string
<= 1024 characters
DoesNotEndWith
Does Not End With

Exclusive with [Contains DoesNotContain DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not end with.

string
<= 1024 characters
DoesNotEqual
Does Not Equal

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not equal.

string
<= 1024 characters
DoesNotStartWith
Does Not Start With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual Endswith Equals MatchRegex Startswith] Field must not start with.

string
<= 1024 characters
Endswith
Ends With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Equals MatchRegex Startswith] Field must end with.

string
<= 1024 characters
Equals
Equals

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith MatchRegex Startswith] Field must exactly match.

string
<= 1024 characters
MatchRegex
Matches Regex

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals Startswith] Field matches PCRE 1 compliant regular expression.

string
>= 1 characters <= 256 characters
Startswith
Starts With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex] Field must start with.

string
<= 1024 characters
path_match
object
operator
object
Contains
Contains

Exclusive with [DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must contain.

string
<= 1024 characters
DoesNotContain
Does Not Contain

Exclusive with [Contains DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not contain.

string
<= 1024 characters
DoesNotEndWith
Does Not End With

Exclusive with [Contains DoesNotContain DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not end with.

string
<= 1024 characters
DoesNotEqual
Does Not Equal

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not equal.

string
<= 1024 characters
DoesNotStartWith
Does Not Start With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual Endswith Equals MatchRegex Startswith] Field must not start with.

string
<= 1024 characters
Endswith
Ends With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Equals MatchRegex Startswith] Field must end with.

string
<= 1024 characters
Equals
Equals

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith MatchRegex Startswith] Field must exactly match.

string
<= 1024 characters
MatchRegex
Matches Regex

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals Startswith] Field matches PCRE 1 compliant regular expression.

string
>= 1 characters <= 256 characters
Startswith
Starts With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex] Field must start with.

string
<= 1024 characters
query_parameters
query_params

List of (key, value) query parameters.

Array<object>
<= 8 items
CacheQueryParameterMatcherType

Query parameter match can be either regex match on value or exact match of value for given key An example for HTTP request with query parameter https://gitlab.com/dashboard/issues?assignee_username=xxyyxx.

object
key
key

Query parameter key In the above example, assignee_username is the key Required: YES.

string
>= 1 characters <= 256 characters
operator
object
Contains
Contains

Exclusive with [DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must contain.

string
<= 1024 characters
DoesNotContain
Does Not Contain

Exclusive with [Contains DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not contain.

string
<= 1024 characters
DoesNotEndWith
Does Not End With

Exclusive with [Contains DoesNotContain DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not end with.

string
<= 1024 characters
DoesNotEqual
Does Not Equal

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotStartWith Endswith Equals MatchRegex Startswith] Field must not equal.

string
<= 1024 characters
DoesNotStartWith
Does Not Start With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual Endswith Equals MatchRegex Startswith] Field must not start with.

string
<= 1024 characters
Endswith
Ends With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Equals MatchRegex Startswith] Field must end with.

string
<= 1024 characters
Equals
Equals

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith MatchRegex Startswith] Field must exactly match.

string
<= 1024 characters
MatchRegex
Matches Regex

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals Startswith] Field matches PCRE 1 compliant regular expression.

string
>= 1 characters <= 256 characters
Startswith
Starts With

Exclusive with [Contains DoesNotContain DoesNotEndWith DoesNotEqual DoesNotStartWith Endswith Equals MatchRegex] Field must start with.

string
<= 1024 characters
expression_name
Expression Name

Name of the Expressions items that are ANDed Required: YES.

string
<= 128 characters
rule_name
Rule Name

Name of the Cache Rule Required: YES.

string
<= 128 characters

A successful response.

Media typeapplication/json
object
Examplegenerated
{}

Returned when operation is not authorized.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when there is no permission to access resource.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when resource is not found.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when operation on resource is conflicting with current value.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when operation has been rejected as it is happening too frequently.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when server encountered an error in processing API.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when service is unavailable temporarily.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when server timed out processing request.

Media typeapplication/json
string format: string
Examplegenerated
example