Inheritance: Microsoft.WindowsAzure.Commands.ServiceManagement.Model.StorageServiceOperationContext
        protected PSStorageService(StorageServicePropertiesOperationContext account, AzureStorageContext context)
            : this(context)
        {
            this.AccountType = account.AccountType;
            this.AffinityGroup = account.AffinityGroup;
            this.GeoPrimaryLocation = account.GeoPrimaryLocation;
            this.GeoReplicationEnabled = account.GeoReplicationEnabled;
            this.GeoSecondaryLocation = account.GeoSecondaryLocation;
            this.Label = account.Label;
            this.Location = account.Location;
            this.OperationDescription = account.OperationDescription;
            this.OperationId = account.OperationId;
            this.OperationStatus = account.OperationStatus;
            this.StatusOfPrimary = account.StatusOfPrimary;
            this.StatusOfSecondary = account.StatusOfSecondary;
            this.StorageAccountName = account.StorageAccountName;
            this.StorageAccountDescription = account.StorageAccountDescription;
            this.StorageAccountStatus = account.StorageAccountStatus;
            var endpointList = new List<string>();
            foreach (var endpoint in account.Endpoints)
            {
                endpointList.Add(endpoint);
            }

            this.Endpoints = endpointList;
        }
        protected PSStorageService(StorageServicePropertiesOperationContext account, AzureStorageContext context)
            : this(context)
        {
            this.AccountType          = account.AccountType;
            this.AffinityGroup        = account.AffinityGroup;
            this.GeoPrimaryLocation   = account.GeoPrimaryLocation;
            this.GeoSecondaryLocation = account.GeoSecondaryLocation;
            this.Label                     = account.Label;
            this.Location                  = account.Location;
            this.OperationDescription      = account.OperationDescription;
            this.OperationId               = account.OperationId;
            this.OperationStatus           = account.OperationStatus;
            this.StatusOfPrimary           = account.StatusOfPrimary;
            this.StatusOfSecondary         = account.StatusOfSecondary;
            this.StorageAccountName        = account.StorageAccountName;
            this.StorageAccountDescription = account.StorageAccountDescription;
            this.StorageAccountStatus      = account.StorageAccountStatus;
            this.LastGeoFailoverTime       = account.LastGeoFailoverTime;
            var endpointList = new List <string>();
            foreach (var endpoint in account.Endpoints)
            {
                endpointList.Add(endpoint);
            }

            this.Endpoints = endpointList;
        }
Beispiel #3
0
        public static PSStorageService Create(StorageManagementClient client,
                                              StorageServicePropertiesOperationContext account)
        {
            var cloudStorageAccount = StorageUtilities.GenerateCloudStorageAccount(client, account.StorageAccountName);

            return(new PSStorageService(account, new AzureStorageContext(cloudStorageAccount)));
        }
 public static PSStorageService Create(StorageManagementClient client,
                                       StorageServicePropertiesOperationContext account)
 {
     return(new PSStorageService(account, new LazyAzureStorageContext((s) =>
     {
         return StorageUtilities.GenerateCloudStorageAccount(client, account.StorageAccountName);
     }, account.StorageAccountName) as AzureStorageContext));
 }
 public static PSStorageService Create(StorageManagementClient client,
     StorageServicePropertiesOperationContext account)
 {
     return new PSStorageService(account, new LazyAzureStorageContext((s) =>
     {
         return StorageUtilities.GenerateCloudStorageAccount(client, account.StorageAccountName);
     }, account.StorageAccountName) as AzureStorageContext); 
 }
        private bool StorageAccountVerify(StorageServicePropertiesOperationContext storageContext,
            string[] staticParameters, string label, string description, bool? geoReplicationEnabled, string accountType)
        {
            string name = staticParameters[0];
            string location = staticParameters[1];
            string affinity = staticParameters[2];

            Console.WriteLine("Name: {0}, Label: {1}, Description: {2}, AffinityGroup: {3}, Location: {4}, GeoReplicationEnabled: {5}, AccountType: {6}",
                storageContext.StorageAccountName,
                storageContext.Label,
                storageContext.StorageAccountDescription,
                storageContext.AffinityGroup,
                storageContext.Location,
                storageContext.GeoReplicationEnabled,
                storageContext.AccountType);

            try
            {
                Assert.AreEqual(name, storageContext.StorageAccountName, "Error: Storage Account Name is not equal!");
                Assert.AreEqual(label, storageContext.Label, "Error: Storage Account Label is not equal!");
                Assert.AreEqual(description, storageContext.StorageAccountDescription, "Error: Storage Account Description is not equal!");
                Assert.AreEqual(affinity, storageContext.AffinityGroup, "Error: Affinity Group is not equal!");
                Assert.AreEqual(location, storageContext.Location, "Error: Location is not equal!");
                Assert.AreEqual(geoReplicationEnabled, storageContext.GeoReplicationEnabled, "Error: GeoReplicationEnabled is not equal!");
                Assert.AreEqual(accountType, storageContext.AccountType, "Error: AccountType is not equal!");
                Console.WriteLine("All contexts are matched!!\n");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                return false;
            }
            return true;
        }
 public static PSStorageService Create(StorageManagementClient client,
     StorageServicePropertiesOperationContext account)
 {
     var cloudStorageAccount = StorageUtilities.GenerateCloudStorageAccount(client, account.StorageAccountName);
     return new PSStorageService(account, new AzureStorageContext(cloudStorageAccount));
 }