add(checking schema to set configuration and unsafe flag)

This commit is contained in:
DeniskaRediska committed 2019-07-26 15:31:33 +03:00
1 parent 3543ded23e
commit c8d028fcd4
14 files changed
+156 -45

No files matched your search

+13
View File
@@ -11,6 +11,10 @@ type getModuleByUuidAndNameRequest struct {
Uuid string
}
type getSchemaByModuleIdRequest struct {
ModuleId int32
}
type Config struct {
Id int64
Name string
@@ -42,3 +46,12 @@ type ModuleInfo struct {
ConfigSchema *schema.Schema `json:",omitempty"`
Status []Connection `json:",omitempty"`
}
type ConfigSchema struct {
Id int32
Version string
ModuleId int32
Schema schema.Schema
CreatedAt time.Time
UpdatedAt time.Time
}
+1
View File
@@ -4,4 +4,5 @@ const (
getAvailableConfigs = "/api/config/module/get_modules_info"
getConfigByModuleName = "/api/config/config/get_config_by_instance_uuid_and_module_name"
createUpdateConfig = "/api/config/config/create_update_config"
getSchemaByModuleId = "/api/config/schema/get_by_module_id"
)
+9
View File
@@ -54,3 +54,12 @@ func (c *configClient) CreateUpdateConfig(request Config) (*Config, error) {
}
return response, nil
}
func (c *configClient) GetSchemaByModuleId(moduleId int32) (*ConfigSchema, error) {
request := &getSchemaByModuleIdRequest{ModuleId: moduleId}
response := new(ConfigSchema)
if err := c.client.Invoke("POST", c.gateHost+getSchemaByModuleId, c.headers, &request, response); err != nil {
return nil, err
}
return response, nil
}