Exemplo n.º 1
0
        /// <summary>
        /// Queries by Name.
        /// </summary>
        private void GetByName()
        {
            ProtectionProfileResponse profileResponse =
                RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile(this.Name);

            this.WriteProfile(profileResponse.ProtectionProfile);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Queries all / by default.
        /// </summary>
        private void GetAll()
        {
            ProtectionProfileListResponse profileListResponse =
                RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile();

            this.WriteProfiles(profileListResponse.ProtectionProfiles);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Queries by Friendly name.
        /// </summary>
        private void GetByFriendlyName()
        {
            ProtectionProfileListResponse profileListResponse =
                RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile();

            foreach (ProtectionProfile profile in profileListResponse.ProtectionProfiles)
            {
                if (0 == string.Compare(this.FriendlyName, profile.CustomData.FriendlyName, true))
                {
                    this.WriteProfile(profile);
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Queries by Friendly name.
        /// </summary>
        private void GetByFriendlyName()
        {
            ProtectionProfileListResponse profileListResponse =
                RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile();
            bool found = false;

            foreach (ProtectionProfile profile in profileListResponse.ProtectionProfiles)
            {
                if (0 == string.Compare(this.FriendlyName, profile.CustomData.FriendlyName, true))
                {
                    this.WriteProfile(profile);
                    found = true;
                }
            }

            if (!found)
            {
                throw new InvalidOperationException(
                          string.Format(
                              Properties.Resources.ProtectionProfileNotFound,
                              this.FriendlyName,
                              PSRecoveryServicesClient.asrVaultCreds.ResourceName));
            }
        }