(clusterName, serviceName string)
| 140 | } |
| 141 | |
| 142 | func (c *Client) RetrieveService(clusterName, serviceName string) (*_ecs.Service, error) { |
| 143 | if clusterName == "" { |
| 144 | return nil, errors.New("clusterName is empty") |
| 145 | } |
| 146 | if serviceName == "" { |
| 147 | return nil, errors.New("serviceName is empty") |
| 148 | } |
| 149 | |
| 150 | params := &_ecs.DescribeServicesInput{ |
| 151 | Cluster: _aws.String(clusterName), |
| 152 | Services: _aws.StringSlice([]string{serviceName}), |
| 153 | } |
| 154 | |
| 155 | res, err := c.svc.DescribeServices(params) |
| 156 | if err != nil { |
| 157 | return nil, err |
| 158 | } |
| 159 | |
| 160 | if len(res.Services) == 0 { |
| 161 | return nil, nil |
| 162 | } else if len(res.Services) == 1 { |
| 163 | return res.Services[0], nil |
| 164 | } |
| 165 | |
| 166 | return nil, fmt.Errorf("Invalid result: %v", res.Services) |
| 167 | } |
| 168 | |
| 169 | func (c *Client) CreateService(clusterName, serviceName, taskDefARN string, desiredCount uint16, loadBalancers []*LoadBalancer, serviceRole string) (*_ecs.Service, error) { |
| 170 | if clusterName == "" { |
no outgoing calls
no test coverage detected