private IPage <ResourceModel> ListResourceModel(string nextPageLink)
 {
     return(UsersOperationsExtensions.ListByDataBoxEdgeDeviceNext(
                this.DataBoxEdgeManagementClient.Users,
                nextPageLink
                ));
 }
 private IPage <ResourceModel> ListResourceModel()
 {
     return(UsersOperationsExtensions.ListByDataBoxEdgeDevice(
                this.DataBoxEdgeManagementClient.Users,
                this.DeviceName,
                this.ResourceGroupName));
 }
 private ResourceModel GetResourceModel()
 {
     return(UsersOperationsExtensions.Get(
                this.DataBoxEdgeManagementClient.Users,
                this.DeviceName,
                this.Name,
                this.ResourceGroupName));
 }
Exemplo n.º 4
0
 private bool Remove()
 {
     UsersOperationsExtensions.Delete(
         this.DataBoxEdgeManagementClient.Users,
         this.DeviceName,
         this.Name,
         this.ResourceGroupName);
     return(true);
 }
        private string GetUserId(string username)
        {
            var user = UsersOperationsExtensions.Get(
                this.DataBoxEdgeManagementClient.Users,
                this.DeviceName,
                username,
                this.ResourceGroupName
                );

            return(user.Id);
        }
        private PSResourceModel SetResourceModel()
        {
            var encryptedSecret =
                DataBoxEdgeManagementClient.Devices.GetAsymmetricEncryptedSecret(
                    this.DeviceName,
                    this.ResourceGroupName,
                    this.Password.ConvertToString(),
                    this.GetKeyForEncryption()
                    );

            return(new PSResourceModel(
                       UsersOperationsExtensions.CreateOrUpdate(
                           this.DataBoxEdgeManagementClient.Users,
                           this.DeviceName,
                           this.Name,
                           this.ResourceGroupName,
                           encryptedSecret
                           )));
        }
        private PSResourceModel CreateResourceModel()
        {
            var password = this.Password.ConvertToString();

            PasswordUtility.ValidateUserPasswordPattern(nameof(this.Password), password);
            var encryptedSecret =
                DataBoxEdgeManagementClient.Devices.GetAsymmetricEncryptedSecret(
                    this.DeviceName,
                    this.ResourceGroupName,
                    password,
                    this.GetKeyForEncryption()
                    );

            return(new PSResourceModel(
                       UsersOperationsExtensions.CreateOrUpdate(
                           this.DataBoxEdgeManagementClient.Users,
                           this.DeviceName,
                           this.Name,
                           this.ResourceGroupName,
                           encryptedSecret
                           )));
        }