(apiName string, apiID string)
| 415 | } |
| 416 | |
| 417 | func GetAPIByID(apiName string, apiID string) ([]schema.APIResponse, error) { |
| 418 | // check if the API is currently running, so that additional information can be returned |
| 419 | deployedResource, err := GetDeployedResourceByName(apiName) |
| 420 | if err == nil && deployedResource != nil && deployedResource.ID() == apiID { |
| 421 | return GetAPI(apiName) |
| 422 | } |
| 423 | |
| 424 | // search for the API spec with the old ID |
| 425 | apiSpec, err := operator.DownloadAPISpec(apiName, apiID) |
| 426 | if err != nil { |
| 427 | if aws.IsGenericNotFoundErr(err) { |
| 428 | return nil, ErrorAPIIDNotFound(apiName, apiID) |
| 429 | } |
| 430 | return nil, err |
| 431 | } |
| 432 | |
| 433 | return []schema.APIResponse{ |
| 434 | { |
| 435 | Spec: apiSpec, |
| 436 | }, |
| 437 | }, nil |
| 438 | } |
| 439 | |
| 440 | func getPastAPIDeploys(apiName string) ([]schema.APIVersion, error) { |
| 441 | var apiVersions []schema.APIVersion |
no test coverage detected