| 117 | } |
| 118 | |
| 119 | func (m *imlPluginClusterModule) Get(ctx context.Context, clusterId string, name string) (config *dto.PluginOutput, render plugin_model.Render, er error) { |
| 120 | if clusterId == "" { |
| 121 | return nil, nil, fmt.Errorf("partition is require") |
| 122 | } |
| 123 | cf, define, err := m.service.GetConfig(ctx, clusterId, name) |
| 124 | if err != nil { |
| 125 | return nil, nil, err |
| 126 | } |
| 127 | if define.Kind != plugin_model.OpenKind { |
| 128 | return nil, nil, fmt.Errorf("plugin %s [extend:%s] not support for setting ", name, define.Extend) |
| 129 | } |
| 130 | out := &dto.PluginOutput{ |
| 131 | //Cluster: auto.UUID(cf.Cluster), |
| 132 | Name: cf.Plugin, |
| 133 | Cname: define.Cname, |
| 134 | Extend: define.Extend, |
| 135 | Desc: define.Desc, |
| 136 | Status: cf.Status, |
| 137 | Config: cf.Config, |
| 138 | } |
| 139 | if cf.Operator != "" { |
| 140 | out.Operator = auto.UUIDP(cf.Operator) |
| 141 | } |
| 142 | if cf.Create != nil { |
| 143 | out.Create = (*auto.TimeLabel)(cf.Create) |
| 144 | } |
| 145 | if cf.Update != nil { |
| 146 | out.Update = (*auto.TimeLabel)(cf.Update) |
| 147 | } |
| 148 | return out, define.Render, nil |
| 149 | |
| 150 | } |
| 151 | |
| 152 | func (m *imlPluginClusterModule) Set(ctx context.Context, clusterId string, name string, config *dto.PluginSetting) error { |
| 153 | |