All URIs are relative to https://napi.arvancloud.ir/cdn/4.0
Method | HTTP request | Description |
---|---|---|
RedirectShow | Get /domains/{domain}/settings/www-redirect | Get redirect settings |
RedirectUpdate | Put /domains/{domain}/settings/www-redirect | Update redirect settings |
RedirectData RedirectShow(ctx, domain).Execute()
Get redirect settings
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RedirectApi.RedirectShow(context.Background(), domain).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RedirectApi.RedirectShow``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RedirectShow`: RedirectData
fmt.Fprintf(os.Stdout, "Response from `RedirectApi.RedirectShow`: %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 apiRedirectShowRequest 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 RedirectUpdate(ctx, domain).Redirect(redirect).Execute()
Update redirect settings
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
redirect := *openapiclient.NewRedirect() // Redirect | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RedirectApi.RedirectUpdate(context.Background(), domain).Redirect(redirect).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RedirectApi.RedirectUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RedirectUpdate`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `RedirectApi.RedirectUpdate`: %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 apiRedirectUpdateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
redirect | Redirect | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]