Ejemplo n.º 1
0
        private async Task <GalleryImageCollection> GetGalleryImageCollectionAsync()
        {
            _resourceGroup = await CreateResourceGroupAsync();

            var galleryName = Recording.GenerateAssetName("testGallery_");
            var input       = ResourceDataHelper.GetBasicGalleryData(DefaultLocation);
            var lro         = await _resourceGroup.GetGalleries().CreateOrUpdateAsync(WaitUntil.Completed, galleryName, input);

            _gallery = lro.Value;
            return(_gallery.GetGalleryImages());
        }
Ejemplo n.º 2
0
        private async Task <GalleryImageResource> CreateGalleryImageAsync(string galleryImageName)
        {
            var galleryName = Recording.GenerateAssetName("testGallery_");

            _gallery = await CreateGalleryAsync(galleryName);

            var identifier = ResourceDataHelper.GetGalleryImageIdentifier(
                Recording.GenerateAssetName("publisher"),
                Recording.GenerateAssetName("offer"),
                Recording.GenerateAssetName("sku"));
            var imageInput = ResourceDataHelper.GetBasicGalleryImageData(DefaultLocation, OperatingSystemTypes.Linux, identifier);
            var lro        = await _gallery.GetGalleryImages().CreateOrUpdateAsync(WaitUntil.Completed, galleryImageName, imageInput);

            return(lro.Value);
        }