All URIs are relative to https://napi.arvancloud.ir/cdn/4.0
| Method | HTTP request | Description |
|---|---|---|
| CachingDeprecatedPurge | Delete /domains/{domain}/caching | Purge CDN Cache |
| CachingIndex | Get /domains/{domain}/caching | Get caching settings |
| CachingPurge | Post /domains/{domain}/caching/purge | Purge CDN Cache |
| CachingUpdate | Patch /domains/{domain}/caching | Update caching settings |
| PurgeTagsDestroy | Delete /domains/{domain}/purge-tags | Delete a Domain's Purge tag |
| PurgeTagsIndex | Get /domains/{domain}/purge-tags | Get domain's Purge tags |
MessageResponse CachingDeprecatedPurge(ctx, domain).Purge(purge).PurgeUrls(purgeUrls).PurgeTags(purgeTags).Execute()
Purge CDN Cache
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
purge := "purge_example" // string |
purgeUrls := []string{"Inner_example"} // []string | URLs to be purged from cache. Required if purge value is set to individual. (optional)
purgeTags := []string{"Inner_example"} // []string | Tags to be purged from cache. Required if purge value is set to tags. Each tag must be 32 characters or less. Only ASCII characters are acceptable. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CachingApi.CachingDeprecatedPurge(context.Background(), domain).Purge(purge).PurgeUrls(purgeUrls).PurgeTags(purgeTags).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CachingApi.CachingDeprecatedPurge``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CachingDeprecatedPurge`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `CachingApi.CachingDeprecatedPurge`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiCachingDeprecatedPurgeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
purge | string | | purgeUrls | []string | URLs to be purged from cache. Required if purge value is set to individual. | purgeTags | []string | Tags to be purged from cache. Required if purge value is set to tags. Each tag must be 32 characters or less. Only ASCII characters are acceptable. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CacheSettingsData CachingIndex(ctx, domain).Execute()
Get caching settings
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CachingApi.CachingIndex(context.Background(), domain).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CachingApi.CachingIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CachingIndex`: CacheSettingsData
fmt.Fprintf(os.Stdout, "Response from `CachingApi.CachingIndex`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiCachingIndexRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse CachingPurge(ctx, domain).CachingPurge(cachingPurge).Execute()
Purge CDN Cache
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
cachingPurge := *openapiclient.NewCachingPurge("Purge_example") // CachingPurge | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CachingApi.CachingPurge(context.Background(), domain).CachingPurge(cachingPurge).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CachingApi.CachingPurge``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CachingPurge`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `CachingApi.CachingPurge`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiCachingPurgeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
cachingPurge | CachingPurge | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse CachingUpdate(ctx, domain).CacheSettings(cacheSettings).Execute()
Update caching settings
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
cacheSettings := *openapiclient.NewCacheSettings() // CacheSettings | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CachingApi.CachingUpdate(context.Background(), domain).CacheSettings(cacheSettings).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CachingApi.CachingUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CachingUpdate`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `CachingApi.CachingUpdate`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiCachingUpdateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
cacheSettings | CacheSettings | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse PurgeTagsDestroy(ctx, domain).Tag(tag).Execute()
Delete a Domain's Purge tag
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
tag := "tag_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CachingApi.PurgeTagsDestroy(context.Background(), domain).Tag(tag).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CachingApi.PurgeTagsDestroy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PurgeTagsDestroy`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `CachingApi.PurgeTagsDestroy`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiPurgeTagsDestroyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
tag | string | |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PurgeTagsIndex200Response PurgeTagsIndex(ctx, domain).Execute()
Get domain's Purge tags
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CachingApi.PurgeTagsIndex(context.Background(), domain).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CachingApi.PurgeTagsIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PurgeTagsIndex`: PurgeTagsIndex200Response
fmt.Fprintf(os.Stdout, "Response from `CachingApi.PurgeTagsIndex`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiPurgeTagsIndexRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]