diff --git a/services/capk/client.go b/services/capk/client.go index 73c1989..7671ba7 100644 --- a/services/capk/client.go +++ b/services/capk/client.go @@ -28,3 +28,15 @@ func (c *Client) TaskCreate(req *TaskCreateRequest) (resp *TaskCreateResponse, e err = c.DoAction(req, resp) return } + +func (c *Client) ConfigModify(req *ConfigModifyRequest) (resp *ConfigModifyResponse, err error) { + resp = CreateConfigModifyResponse() + err = c.DoAction(req, resp) + return +} + +func (c *Client) ConfigGet(req *ConfigGetRequest) (resp *ConfigGetResponse, err error) { + resp = CreateConfigGetResponse() + err = c.DoAction(req, resp) + return +} diff --git a/services/capk/client_test.go b/services/capk/client_test.go index dc9dddd..a7bdb3c 100644 --- a/services/capk/client_test.go +++ b/services/capk/client_test.go @@ -16,3 +16,24 @@ func TestTask_Create(t *testing.T) { resp, err := client.TaskCreate(req) t.Logf("%v", resp.Data.TaskId) } + +func TestConfig_Modify(t *testing.T) { + client, err := NewClient() + if err != nil { + t.Fatal(err) + } + req := CreateConfigModifyRequest() + req.Content = []byte(``) + resp, err := client.ConfigModify(req) + t.Log(resp.Code, resp.Msg) +} + +func TestConfig_Get(t *testing.T) { + client, err := NewClient() + if err != nil { + t.Fatal(err) + } + req := CreateConfigGetRequest() + resp, err := client.ConfigGet(req) + t.Log(resp.Code, resp.Data) +} diff --git a/services/capk/config_get.go b/services/capk/config_get.go new file mode 100644 index 0000000..21469a6 --- /dev/null +++ b/services/capk/config_get.go @@ -0,0 +1,34 @@ +package capk + +import ( + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +type ConfigGetRequest struct { + *requests.JsonRequest +} + +type ConfigGetResponse struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data string `json:"data"` +} + +func CreateConfigGetRequest() *ConfigGetRequest { + req := &ConfigGetRequest{ + JsonRequest: &requests.JsonRequest{}, + } + + req.InitWithApiInfo(HOST, VERSION, "/pack/config/get") + req.Method = requests.GET + + return req +} + +func CreateConfigGetResponse() *ConfigGetResponse { + return &ConfigGetResponse{ + BaseResponse: &responses.BaseResponse{}, + } +} diff --git a/services/capk/config_modify.go b/services/capk/config_modify.go new file mode 100644 index 0000000..e740e88 --- /dev/null +++ b/services/capk/config_modify.go @@ -0,0 +1,33 @@ +package capk + +import ( + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +type ConfigModifyRequest struct { + *requests.StreamRequest +} + +type ConfigModifyResponse struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data string `json:"data"` +} + +func CreateConfigModifyRequest() (req *ConfigModifyRequest) { + req = &ConfigModifyRequest{ + StreamRequest: &requests.StreamRequest{}, + } + + req.InitWithApiInfo(HOST, VERSION, "/pack/config/set") + req.Method = requests.POST + return +} + +func CreateConfigModifyResponse() (resp *ConfigModifyResponse) { + return &ConfigModifyResponse{ + BaseResponse: &responses.BaseResponse{}, + } +}