feat: new deployment provider: ctcccloud ao
This commit is contained in:
54
internal/pkg/sdk3rd/ctyun/ao/api_get_domain_config.go
Normal file
54
internal/pkg/sdk3rd/ctyun/ao/api_get_domain_config.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package ao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type GetDomainConfigRequest struct {
|
||||
Domain *string `json:"domain,omitempty"`
|
||||
ProductCode *string `json:"product_code,omitempty"`
|
||||
}
|
||||
|
||||
type GetDomainConfigResponse struct {
|
||||
baseResult
|
||||
|
||||
ReturnObj *struct {
|
||||
Domain string `json:"domain"`
|
||||
ProductCode string `json:"product_code"`
|
||||
Status int32 `json:"status"`
|
||||
AreaScope int32 `json:"area_scope"`
|
||||
Cname string `json:"cname"`
|
||||
Origin []*DomainOriginConfig `json:"origin,omitempty"`
|
||||
HttpsStatus string `json:"https_status"`
|
||||
HttpsBasic *DomainHttpsBasicConfig `json:"https_basic,omitempty"`
|
||||
CertName string `json:"cert_name"`
|
||||
} `json:"returnObj,omitempty"`
|
||||
}
|
||||
|
||||
func (c *Client) GetDomainConfig(req *GetDomainConfigRequest) (*GetDomainConfigResponse, error) {
|
||||
return c.GetDomainConfigWithContext(context.Background(), req)
|
||||
}
|
||||
|
||||
func (c *Client) GetDomainConfigWithContext(ctx context.Context, req *GetDomainConfigRequest) (*GetDomainConfigResponse, error) {
|
||||
httpreq, err := c.newRequest(http.MethodGet, "/ctapi/v1/accessone/domain/config")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
if req.Domain != nil {
|
||||
httpreq.SetQueryParam("domain", *req.Domain)
|
||||
}
|
||||
if req.ProductCode != nil {
|
||||
httpreq.SetQueryParam("product_code", *req.ProductCode)
|
||||
}
|
||||
|
||||
httpreq.SetContext(ctx)
|
||||
}
|
||||
|
||||
result := &GetDomainConfigResponse{}
|
||||
if _, err := c.doRequestWithResult(httpreq, result); err != nil {
|
||||
return result, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
Reference in New Issue
Block a user