Get Cache Reserve setting
client.Cache.CacheReserve.Get(ctx, query) (*CacheReserveGetResponse, error)
GET/zones/{zone_id}/cache/cache_reserve
Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the developer docs for more information.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get Cache Reserve setting
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/cache"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
cacheReserve, err := client.Cache.CacheReserve.Get(context.TODO(), cache.CacheReserveGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", cacheReserve.ID)
}
{
"errors": [],
"messages": [],
"result": {
"editable": true,
"id": "cache_reserve",
"value": "off"
},
"success": true
}{
"errors": [
{
"code": 12345,
"message": "Some error message"
}
],
"messages": [],
"result": null,
"success": false
}Returns Examples
{
"errors": [],
"messages": [],
"result": {
"editable": true,
"id": "cache_reserve",
"value": "off"
},
"success": true
}{
"errors": [
{
"code": 12345,
"message": "Some error message"
}
],
"messages": [],
"result": null,
"success": false
}