コード例 #1
0
        public override void ExecuteCmdlet()
        {
            if (ParameterSetName == ParentObjectParameterSet)
            {
                ResourceGroupName = VolumeObject.ResourceGroupName;
                Location          = VolumeObject.Location;
                var NameParts = VolumeObject.Name.Split('/');
                AccountName  = NameParts[0];
                PoolName     = NameParts[1];
                VolumeName   = NameParts[2];
                FileSystemId = VolumeObject.FileSystemId;
            }

            var snapshotBody = new Management.NetApp.Models.Snapshot()
            {
                Location     = Location,
                FileSystemId = FileSystemId
            };

            if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName)))
            {
                var anfSnapshot = AzureNetAppFilesManagementClient.Snapshots.Create(snapshotBody, ResourceGroupName, AccountName, PoolName, VolumeName, Name);
                WriteObject(anfSnapshot);
            }
        }
コード例 #2
0
 public static PSNetAppFilesSnapshot ToPsNetAppFilesSnapshot(this Management.NetApp.Models.Snapshot snapshot)
 {
     return(new PSNetAppFilesSnapshot
     {
         ResourceGroupName = new ResourceIdentifier(snapshot.Id).ResourceGroupName,
         Location = snapshot.Location,
         Id = snapshot.Id,
         Name = snapshot.Name,
         Type = snapshot.Type,
         SnapshotId = snapshot.SnapshotId,
         Created = snapshot.Created,
         ProvisioningState = snapshot.ProvisioningState,
     });
 }