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 @@ -56,7 +56,7 @@ public override void ExecuteCmdlet()
ListContainerResponse listContainerResponse = AzureBackupClient.Container.ListAsync(queryFilterString,
GetCustomRequestHeaders(), CmdletCancellationToken).Result;

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

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

Expand All @@ -68,15 +68,16 @@ public override void ExecuteCmdlet()
{
return containerInfo.ParentContainerName != ContainerResourceGroupName;
});
WriteDebug(string.Format("# of containers after resource group filter = {0}", containerInfos.Count));
}

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

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

// When container resource name and container resource group name are specified, this parameter set
// identifies a container uniquely. Thus, we return just one container instead of a list.
if (!string.IsNullOrEmpty(ContainerResourceName) & !string.IsNullOrEmpty(ContainerResourceGroupName))
{
if (containers.Any())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public override void ExecuteCmdlet()
string resourceType = "resourceType";
string displayName = subscriptionId + "_" + ResourceGroupName + "_" + ResourceName;

WriteVerbose(string.Format(CultureInfo.InvariantCulture,
"Executing cmdlet with SubscriptionId = {0}, ResourceGroupName = {1}, ResourceName = {2}, TargetLocation = {3}",
subscriptionId, ResourceGroupName, ResourceName, TargetLocation));
WriteDebug(string.Format(CultureInfo.InvariantCulture,
"Executing cmdlet with SubscriptionId = {0}, ResourceGroupName = {1}, ResourceName = {2}, TargetLocation = {3}",
subscriptionId, ResourceGroupName, ResourceName, TargetLocation));

X509Certificate2 cert = CertUtils.CreateSelfSignedCert(CertUtils.DefaultIssuer,
CertUtils.GenerateCertFriendlyName(subscriptionId, ResourceName),
Expand All @@ -69,9 +69,9 @@ public override void ExecuteCmdlet()
try
{
// Upload cert into ID Mgmt
WriteVerbose(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Going to upload the certificate"));
WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Going to upload the certificate"));
acsNamespace = UploadCert(cert, subscriptionId, ResourceName, resourceType, ResourceGroupName);
WriteVerbose(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Successfully uploaded the certificate"));
WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Successfully uploaded the certificate"));
}
catch (Exception exception)
{
Expand All @@ -90,7 +90,7 @@ public override void ExecuteCmdlet()
directoryPath = TargetLocation;
}
string filePath = Path.Combine(directoryPath, fileName);
WriteVerbose(string.Format("Saving Vault Credentials to file : {0}", filePath));
WriteDebug(string.Format("Saving Vault Credentials to file : {0}", filePath));

File.WriteAllBytes(filePath, Encoding.UTF8.GetBytes(vaultCredsFileContent));

Expand Down Expand Up @@ -187,7 +187,7 @@ private string GenerateVaultCredsForBackup(X509Certificate2 cert, string subscri
DataContractSerializer serializer = new DataContractSerializer(typeof(BackupVaultCreds));
serializer.WriteObject(writer, backupVaultCreds);

WriteVerbose(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Backup Vault - Successfully serialized the file content"));
WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Backup Vault - Successfully serialized the file content"));
}

return Encoding.UTF8.GetString(output.ToArray());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override void ExecuteCmdlet()
throw new ArgumentException("Please provide a vaild storage type.");
}

WriteVerbose("Updating the storage type.");
WriteDebug("Updating the storage type.");

UpdateVaultStorageTypeRequest updateVaultStorageTypeRequest = new UpdateVaultStorageTypeRequest()
{
Expand All @@ -52,7 +52,7 @@ public override void ExecuteCmdlet()

AzureBackupClient.Vault.UpdateStorageTypeAsync(updateVaultStorageTypeRequest, GetCustomRequestHeaders(), CmdletCancellationToken).Wait();

WriteVerbose("Update successful.");
WriteDebug("Update successful.");
});
}
}
Expand Down