diff options
Diffstat (limited to 'adapters/mso-adapter-utils')
-rw-r--r-- | adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java index 7a9fdfe70b..b614a92177 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java @@ -28,6 +28,7 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.woorea.openstack.base.client.OpenStackRequest; import com.woorea.openstack.glance.Glance; +import com.woorea.openstack.glance.model.Image; import com.woorea.openstack.glance.model.Images; @Component @@ -84,4 +85,17 @@ public class GlanceClientImpl extends MsoCommonUtils { } } + public Image queryImage(String cloudSiteId, String tenantId, String imageId) + throws MsoCloudSiteNotFound, GlanceClientException { + try { + Glance glanceClient = getGlanceClient(cloudSiteId, tenantId); + // list is set to false, otherwise an invalid URL is appended + OpenStackRequest<Image> request = glanceClient.images().show(imageId); + return executeAndRecordOpenstackRequest(request, false); + } catch (MsoException e) { + logger.error("Error building Glance Client", e); + throw new GlanceClientException("Error building Glance Client", e); + } + } + } |