Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/StorageSync/StorageSync.Test/StorageSync.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.StorageSync" Version="6.0.0" />
<PackageReference Include="Microsoft.Azure.Management.StorageSync" Version="8.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="24.0.0" />
<PackageReference Include="System.Management" Version="4.5.0" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/StorageSync/StorageSync/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Added Low Disk Mode property to Cloud Tiering Status inside the Server Endpoint object.

## Version 1.7.0
* Migrated Azure AD features in Az.StorageSync to MSGraph APIs. The cmdlets will call MSGraph API according to input parameters: New-AzStorageSyncCloudEndpoint
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
{
using Microsoft.Azure.Commands.StorageSync.Models;
using System;
using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;

/// <summary>
/// Class CloudTieringDatePolicyStatusConverter.
/// Implements the <see cref="Converters.ConverterBase{PSCloudTieringDatePolicyStatus, CloudTieringDatePolicyStatus}" />
/// </summary>
/// <seealso cref="Converters.ConverterBase{PSCloudTieringDatePolicyStatus, CloudTieringDatePolicyStatus}" />
public class CloudTieringDatePolicyStatusConverter : ConverterBase<PSCloudTieringDatePolicyStatus, StorageSyncModels.CloudTieringDatePolicyStatus>
{
/// <summary>
/// Transforms the specified source.
/// </summary>
/// <param name="source">The source.</param>
/// <returns>StorageSyncModels.CloudTieringDatePolicyStatus.</returns>
protected override StorageSyncModels.CloudTieringDatePolicyStatus Transform(PSCloudTieringDatePolicyStatus source)
{
// Cloud tiering status properties are readonly from the RP
throw new NotSupportedException();
}

/// <summary>
/// Transforms the specified source.
/// </summary>
/// <param name="source">The source.</param>
/// <returns>PSCloudTieringDatePolicyStatus.</returns>
protected override PSCloudTieringDatePolicyStatus Transform(StorageSyncModels.CloudTieringDatePolicyStatus source)
{
return new PSCloudTieringDatePolicyStatus()
{
LastUpdatedTimestamp = source.LastUpdatedTimestamp,
TieredFilesMostRecentAccessTimestamp = source.TieredFilesMostRecentAccessTimestamp
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
{
using Microsoft.Azure.Commands.StorageSync.Models;
using System;
using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;

/// <summary>
/// Class CloudTieringLowDiskModeConverter.
/// Implements the <see cref="Converters.ConverterBase{PSCloudTieringLowDiskMode, CloudTieringLowDiskMode}" />
/// </summary>
/// <seealso cref="Converters.ConverterBase{PSCloudTieringLowDiskMode, CloudTieringLowDiskMode}" />
public class CloudTieringLowDiskModeConverter : ConverterBase<PSCloudTieringLowDiskMode, StorageSyncModels.CloudTieringLowDiskMode>
{
/// <summary>
/// Transforms the specified source.
/// </summary>
/// <param name="source">The source.</param>
/// <returns>StorageSyncModels.CloudTieringLowDiskMode.</returns>
protected override StorageSyncModels.CloudTieringLowDiskMode Transform(PSCloudTieringLowDiskMode source)
{
// Cloud tiering status properties are readonly from the RP
throw new NotSupportedException();
}

/// <summary>
/// Transforms the specified source.
/// </summary>
/// <param name="source">The source.</param>
/// <returns>PSCloudTieringLowDiskMode.</returns>
protected override PSCloudTieringLowDiskMode Transform(StorageSyncModels.CloudTieringLowDiskMode source)
{
return new PSCloudTieringLowDiskMode()
{
LastUpdatedTimestamp = source.LastUpdatedTimestamp,
State = source.State
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ protected override PSServerEndpointCloudTieringStatus Transform(StorageSyncModel
PSCloudTieringCachePerformance cachePerformance = source.CachePerformance != null ? new CloudTieringCachePerformanceConverter().Convert(source.CachePerformance) : null;
PSCloudTieringFilesNotTiering filesNotTiering = source.FilesNotTiering != null ? new CloudTieringFilesNotTieringConverter().Convert(source.FilesNotTiering) : null;
PSCloudTieringVolumeFreeSpacePolicyStatus volumeFreeSpacePolicyStatus = source.VolumeFreeSpacePolicyStatus != null ? new CloudTieringVolumeFreeSpacePolicyStatusConverter().Convert(source.VolumeFreeSpacePolicyStatus) : null;
PSCloudTieringDatePolicyStatus datePolicyStatus = source.DatePolicyStatus != null ? new CloudTieringDatePolicyStatusConverter().Convert(source.DatePolicyStatus) : null;
PSCloudTieringLowDiskMode lowDiskMode = source.LowDiskMode != null ? new CloudTieringLowDiskModeConverter().Convert(source.LowDiskMode) : null;

return new PSServerEndpointCloudTieringStatus()
{
Expand All @@ -58,7 +60,9 @@ protected override PSServerEndpointCloudTieringStatus Transform(StorageSyncModel
SpaceSavings = spaceSavings,
CachePerformance = cachePerformance,
FilesNotTiering = filesNotTiering,
VolumeFreeSpacePolicyStatus = volumeFreeSpacePolicyStatus
VolumeFreeSpacePolicyStatus = volumeFreeSpacePolicyStatus,
DatePolicyStatus = datePolicyStatus,
LowDiskMode = lowDiskMode
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class PSCloudTieringCachePerformance
/// <summary>
/// Gets or sets the last updated timestamp.
/// </summary>
/// <value>The name of the sync group.</value>
/// <value>The last updated timestamp.</value>
public DateTime? LastUpdatedTimestamp { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.StorageSync.Models
{
using System;

/// <summary>
/// Class PSCloudTieringDatePolicyStatus.
/// </summary>
public class PSCloudTieringDatePolicyStatus
{
/// <summary>
/// Gets or sets the last updated timestamp.
/// </summary>
/// <value>The last updated timestamp.</value>
public DateTime? LastUpdatedTimestamp { get; set; }

/// <summary>
/// Gets or sets the most recent time of tiered files.
/// </summary>
/// <value>The most recent access time of tiered files.</value>
public DateTime? TieredFilesMostRecentAccessTimestamp { get; set; }
}
}
36 changes: 36 additions & 0 deletions src/StorageSync/StorageSync/Models/PSCloudTieringLowDiskMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.StorageSync.Models
{
using System;

/// <summary>
/// Class PSCloudTieringLowDiskMode.
/// </summary>
public class PSCloudTieringLowDiskMode
{
/// <summary>
/// Gets or sets the last updated timestamp.
/// </summary>
/// <value>The last updated timestamp.</value>
public DateTime? LastUpdatedTimestamp { get; set; }

/// <summary>
/// Indicator that specifies the state of low disk mode
/// </summary>
/// <value>The low disk mode state.</value>
public string State { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,17 @@ public class PSServerEndpointCloudTieringStatus
/// </summary>
/// <value>The volume free space policy status.</value>
public PSCloudTieringVolumeFreeSpacePolicyStatus VolumeFreeSpacePolicyStatus { get; set; }

/// <summary>
/// Gets or sets the date policy status.
/// </summary>
/// <value>The date policy status.</value>
public PSCloudTieringDatePolicyStatus DatePolicyStatus { get; set; }

/// <summary>
/// Gets or sets the low disk mode state.
/// </summary>
/// <value>The low disk mode state.</value>
public PSCloudTieringLowDiskMode LowDiskMode { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/StorageSync/StorageSync/StorageSync.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.StorageSync" Version="6.0.0" />
<PackageReference Include="Microsoft.Azure.Management.StorageSync" Version="8.0.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" />
<PackageReference Include="System.Management" Version="4.5.0" />
</ItemGroup>
Expand Down