private PSResourceModel CreateResourceModel() { var encryptedSecret = DataBoxEdgeManagementClient.Devices.GetAsymmetricEncryptedSecret( this.DeviceName, this.ResourceGroupName, this.StorageAccountAccessKey.ConvertToString(), GetKeyForEncryption() ); return(new PSResourceModel( StorageAccountCredentialsOperationsExtensions.CreateOrUpdate( this.DataBoxEdgeManagementClient.StorageAccountCredentials, this.DeviceName, this.Name, InitStorageAccountCredentialObject( name: this.Name, storageAccountName: this.Name, accountType: this.StorageAccountType, sslStatus: HelpMessageStorageAccountCredential.SslStatus, secret: encryptedSecret ), this.ResourceGroupName ))); }
private IPage <ResourceModel> ListResourceModel(string nextPageLink) { return(StorageAccountCredentialsOperationsExtensions.ListByDataBoxEdgeDeviceNext( this.DataBoxEdgeManagementClient.StorageAccountCredentials, nextPageLink )); }
private IPage <ResourceModel> ListResourceModel() { return(StorageAccountCredentialsOperationsExtensions.ListByDataBoxEdgeDevice( this.DataBoxEdgeManagementClient.StorageAccountCredentials, this.DeviceName, this.ResourceGroupName)); }
private ResourceModel GetResourceModel() { return(StorageAccountCredentialsOperationsExtensions.Get( this.DataBoxEdgeManagementClient.StorageAccountCredentials, this.DeviceName, this.Name, this.ResourceGroupName)); }
private bool Remove() { StorageAccountCredentialsOperationsExtensions.Delete( this.DataBoxEdgeManagementClient.StorageAccountCredentials, this.DeviceName, this.Name, this.ResourceGroupName); return(true); }
public override void ExecuteCmdlet() { var sac = StorageAccountCredentialsOperationsExtensions.Get( this.DataBoxEdgeManagementClient.StorageAccountCredentials, this.DeviceName, this.StorageAccountCredentialName, this.ResourceGroupName); _share = InitShareObject(); if (this.IsParameterBound(c => c.ClientAccessRight)) { _share.ClientAccessRights = new List <ClientAccessRight>(); foreach (var clientAccessRight in this.ClientAccessRight) { var accessRightPolicy = HashtableToDictionary <string, string>(clientAccessRight); _share.ClientAccessRights.Add( new ClientAccessRight( accessRightPolicy.GetOrNull("ClientId"), accessRightPolicy.GetOrNull("AccessRight") ) ); } } if (this.IsParameterBound(c => c.UserAccessRight)) { _share.UserAccessRights = new List <UserAccessRight>(); foreach (var userAccessRight in this.UserAccessRight) { var accessRightPolicy = HashtableToDictionary <string, string>(userAccessRight); _share.UserAccessRights.Add( new UserAccessRight( GetUserId(accessRightPolicy.GetOrNull("Username")), accessRightPolicy.GetOrNull("AccessRight") )); } } _share.AzureContainerInfo = new AzureContainerInfo(sac.Id, this.Name, this.DataFormat); if (this.ShouldProcess(this.Name, string.Format("Creating '{0}' in device '{1}' with name '{2}'.", HelpMessageShare.ObjectName, this.DeviceName, this.Name))) { DoesResourceExists(); var results = new List <PSResourceModel>() { CreateResourceModel() }; WriteObject(results, true); } }