Skip to content

Latest commit

 

History

History
148 lines (96 loc) · 3.94 KB

RedirectApi.md

File metadata and controls

148 lines (96 loc) · 3.94 KB

\RedirectApi

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

RedirectShow

RedirectData RedirectShow(ctx, domain).Execute()

Get redirect settings

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiRedirectShowRequest struct via the builder pattern

Name Type Description Notes

Return type

RedirectData

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RedirectUpdate

MessageResponse RedirectUpdate(ctx, domain).Redirect(redirect).Execute()

Update redirect settings

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiRedirectUpdateRequest struct via the builder pattern

Name Type Description Notes

redirect | Redirect | |

Return type

MessageResponse

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]