public void DeleteSnapshot() { Identity identity = new Identity() { AuthEndpoint = "http://192.168.1.149:5000/v2.0", Password = "******", TenantName = "admin", Username = "******", }; InstanceManager instanceManager = new InstanceManager(identity); var firstInstaceId = "a9a8ba2c-fc26-4ecc-8419-ca9b7cf326a2"; var snapshotName = instanceManager.CreateSnapshot(firstInstaceId, (x) => { return true; }); ImageManager imageManager = new ImageManager(identity); OpenstackImage image = imageManager.GetImage(new OpenstackImage() { Name = snapshotName }); Assert.AreNotSame(image, null); imageManager.Delete(image.Id); image = imageManager.GetImage(new OpenstackImage() { Name = snapshotName }); Assert.AreEqual(image, null); }
public void DownloadSnapshot() { Identity identity = new Identity() { AuthEndpoint = "http://192.168.1.118:5000/v2.0", Password = "******", TenantName = "admin", Username = "******", }; InstanceManager instanceManager = new InstanceManager(identity); var firstInstaceId = "f71e50ab-cf33-4491-b6f4-8887b29b2c22"; var snapshotName = instanceManager.CreateSnapshot(firstInstaceId, (x) => { return true; }); ImageManager imageManager = new ImageManager(identity); OpenstackImage image = imageManager.GetImage(new OpenstackImage() { Name = snapshotName }); Assert.AreNotSame(image, null); image = imageManager.GetImage(image.Id); imageManager.DownloadImage(image.Id, @"E:\\AtlasVHDS\\" + image.Name + "." + image.DiskFormat); imageManager.Delete(image.Id); image = imageManager.GetImage(new OpenstackImage() { Name = snapshotName }); Assert.AreEqual(image, null); }