mirror of
https://github.com/certimate-go/certimate.git
synced 2026-09-24 23:10:13 +08:00
feat(provider): new deployment provider: ucloud uewaf
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package uewaf
|
||||
|
||||
import (
|
||||
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
|
||||
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
|
||||
)
|
||||
|
||||
type AddWafDomainCertificateInfoRequest struct {
|
||||
request.CommonBase
|
||||
|
||||
Domain *string `required:"true"`
|
||||
CertificateName *string `required:"true"`
|
||||
SslPublicKey *string `required:"true"`
|
||||
SslPrivateKey *string `required:"false"`
|
||||
SslMD *string `required:"false"`
|
||||
SslKeyLess *string `required:"false"`
|
||||
}
|
||||
|
||||
type AddWafDomainCertificateInfoResponse struct {
|
||||
response.CommonBase
|
||||
|
||||
Id int
|
||||
}
|
||||
|
||||
func (c *UEWAFClient) NewAddWafDomainCertificateInfoRequest() *AddWafDomainCertificateInfoRequest {
|
||||
req := &AddWafDomainCertificateInfoRequest{}
|
||||
|
||||
c.Client.SetupRequest(req)
|
||||
|
||||
req.SetRetryable(true)
|
||||
return req
|
||||
}
|
||||
|
||||
func (c *UEWAFClient) AddWafDomainCertificateInfo(req *AddWafDomainCertificateInfoRequest) (*AddWafDomainCertificateInfoResponse, error) {
|
||||
var err error
|
||||
var res AddWafDomainCertificateInfoResponse
|
||||
|
||||
reqCopier := *req
|
||||
|
||||
err = c.Client.InvokeAction("AddWafDomainCertificateInfo", &reqCopier, &res)
|
||||
if err != nil {
|
||||
return &res, err
|
||||
}
|
||||
|
||||
return &res, nil
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package uewaf
|
||||
|
||||
import (
|
||||
"github.com/ucloud/ucloud-sdk-go/ucloud"
|
||||
"github.com/ucloud/ucloud-sdk-go/ucloud/auth"
|
||||
)
|
||||
|
||||
type UEWAFClient struct {
|
||||
*ucloud.Client
|
||||
}
|
||||
|
||||
func NewClient(config *ucloud.Config, credential *auth.Credential) *UEWAFClient {
|
||||
meta := ucloud.ClientMeta{Product: "UEWAF"}
|
||||
client := ucloud.NewClientWithMeta(config, credential, meta)
|
||||
return &UEWAFClient{
|
||||
client,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user