(ctx context.Context, module string, id string)
| 103 | } |
| 104 | |
| 105 | func (i *imlDynamicModule) Offline(ctx context.Context, module string, id string) error { |
| 106 | _, has := driver.Get(module) |
| 107 | if !has { |
| 108 | return fmt.Errorf("模块【%s】不存在", module) |
| 109 | } |
| 110 | return i.transaction.Transaction(ctx, func(ctx context.Context) error { |
| 111 | id = strings.ToLower(fmt.Sprintf("%s_%s", id, module)) |
| 112 | clusters, err := i.clusterService.List(ctx) |
| 113 | if err != nil { |
| 114 | return err |
| 115 | } |
| 116 | clusterIds := utils.SliceToSlice(clusters, func(s *cluster.Cluster) string { |
| 117 | return s.Uuid |
| 118 | }) |
| 119 | for _, clusterId := range clusterIds { |
| 120 | err := i.dynamicClient(ctx, clusterId, module, func(dynamicClient gateway.IDynamicClient) error { |
| 121 | return dynamicClient.Offline(ctx, &gateway.DynamicRelease{ |
| 122 | BasicItem: &gateway.BasicItem{ |
| 123 | ID: id, |
| 124 | }, |
| 125 | }) |
| 126 | }) |
| 127 | if err != nil { |
| 128 | return err |
| 129 | } |
| 130 | |
| 131 | } |
| 132 | return nil |
| 133 | }) |
| 134 | } |
| 135 | |
| 136 | // |
| 137 | //func (i *imlDynamicModule) PartitionStatuses(ctx context.Context, module string, keyword string, page int, pageSize int) (map[string]map[string]string, error) { |
nothing calls this directly
no test coverage detected