public virtual Response <ManagedInstanceDatabaseVulnerabilityAssessmentRuleBaselineResource> Get(string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId));

            using var scope = _managedInstanceDatabaseVulnerabilityAssessmentRuleBaselineManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDiagnostics.CreateScope("ManagedInstanceDatabaseVulnerabilityAssessmentRuleBaselineCollection.Get");
            scope.Start();
            try
            {
                var response = _managedInstanceDatabaseVulnerabilityAssessmentRuleBaselineManagedDatabaseVulnerabilityAssessmentRuleBaselinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, ruleId, baselineName, cancellationToken);
                if (response.Value == null)
                {
                    throw new RequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new ManagedInstanceDatabaseVulnerabilityAssessmentRuleBaselineResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
示例#2
0
 public virtual Response <ManagedInstanceDatabaseVulnerabilityAssessmentRuleBaseline> Get(CancellationToken cancellationToken = default)
 {
     using var scope = _managedInstanceDatabaseVulnerabilityAssessmentRuleBaselineManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDiagnostics.CreateScope("ManagedInstanceDatabaseVulnerabilityAssessmentRuleBaseline.Get");
     scope.Start();
     try
     {
         var response = _managedInstanceDatabaseVulnerabilityAssessmentRuleBaselineManagedDatabaseVulnerabilityAssessmentRuleBaselinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name.ToVulnerabilityAssessmentPolicyBaselineName(), cancellationToken);
         if (response.Value == null)
         {
             throw _managedInstanceDatabaseVulnerabilityAssessmentRuleBaselineManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDiagnostics.CreateRequestFailedException(response.GetRawResponse());
         }
         return(Response.FromValue(new ManagedInstanceDatabaseVulnerabilityAssessmentRuleBaseline(Client, response.Value), response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }