(clusterName, serviceName, taskDefARN string, desiredCount uint16)
| 212 | } |
| 213 | |
| 214 | func (c *Client) UpdateService(clusterName, serviceName, taskDefARN string, desiredCount uint16) (*_ecs.Service, error) { |
| 215 | if clusterName == "" { |
| 216 | return nil, errors.New("clusterName is empty") |
| 217 | } |
| 218 | if serviceName == "" { |
| 219 | return nil, errors.New("serviceName is empty") |
| 220 | } |
| 221 | if taskDefARN == "" { |
| 222 | return nil, errors.New("taskDefARN is empty") |
| 223 | } |
| 224 | |
| 225 | params := &_ecs.UpdateServiceInput{ |
| 226 | Service: _aws.String(serviceName), |
| 227 | Cluster: _aws.String(clusterName), |
| 228 | DesiredCount: _aws.Int64(int64(desiredCount)), |
| 229 | TaskDefinition: _aws.String(taskDefARN), |
| 230 | DeploymentConfiguration: &_ecs.DeploymentConfiguration{ |
| 231 | MaximumPercent: _aws.Int64(200), |
| 232 | MinimumHealthyPercent: _aws.Int64(50), |
| 233 | }, |
| 234 | } |
| 235 | |
| 236 | res, err := c.svc.UpdateService(params) |
| 237 | if err != nil { |
| 238 | return nil, err |
| 239 | } |
| 240 | |
| 241 | return res.Service, nil |
| 242 | } |
| 243 | |
| 244 | func (c *Client) DeleteService(clusterName, serviceName string) error { |
| 245 | params := &_ecs.DeleteServiceInput{ |
no outgoing calls
no test coverage detected