Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public override void ExecuteCmdlet()
ListContainerResponse listContainerResponse = AzureBackupClient.Container.ListAsync(queryFilterString,
GetCustomRequestHeaders(), CmdletCancellationToken).Result;

WriteVerbose(string.Format("# of fetched containers = {0}", listContainerResponse.Objects.Count));

List<ContainerInfo> containerInfos = listContainerResponse.Objects.ToList();

// When resource group name is specified, remove all containers whose resource group name
Expand All @@ -69,10 +71,24 @@ public override void ExecuteCmdlet()
});
}

WriteObject(containerInfos.ConvertAll(containerInfo =>
WriteVerbose(string.Format("# of containers after resource group filter = {0}", listContainerResponse.Objects.Count));

List<AzureBackupContainer> containers = containerInfos.ConvertAll(containerInfo =>
{
return new AzureBackupContainer(containerInfo, ResourceGroupName, ResourceName, Location);
});

if (!string.IsNullOrEmpty(ResourceName) & !string.IsNullOrEmpty(ResourceGroupName))
{
return new AzureBackupContainer(containerInfo, ResourceGroupName, ResourceName, Location);
}));
if (containers.Any())
{
WriteObject(containers.First());
}
}
else
{
WriteObject(containers);
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets
{
public enum AzureBackupContainerStatus
{
All,
Registered,
Registering,
NotRegistered
NotRegistered,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets
{
public enum AzureBackupContainerType
{
AzureVirtualMachine
All,
AzureVirtualMachine,
}
}