public virtual Response <ValidateProbeOutput> ValidateProbe(ValidateProbeContent content, CancellationToken cancellationToken = default)
 {
     using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateProbe");
     scope.Start();
     try
     {
         var response = DefaultRestClient.ValidateProbe(Id.SubscriptionId, content, cancellationToken);
         return(response);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Exemplo n.º 2
0
        public async Task Validate()
        {
            SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync();

            Uri probeURL = new Uri("https://azurecdn-files.azureedge.net/dsa-test/probe-v.txt");
            ValidateProbeContent validateProbeInput2 = new ValidateProbeContent(probeURL);
            ValidateProbeResult  validateProbeResult = await subscription.ValidateProbeAsync(validateProbeInput2);

            Assert.True(validateProbeResult.IsValid);
            probeURL = new Uri("https://www.notexist.com/notexist/notexist.txt");
            ValidateProbeContent validateProbeInput3 = new ValidateProbeContent(probeURL);

            validateProbeResult = await subscription.ValidateProbeAsync(validateProbeInput3);

            Assert.False(validateProbeResult.IsValid);
        }
Exemplo n.º 3
0
        public static Response <ValidateProbeResult> ValidateProbe(this SubscriptionResource subscriptionResource, ValidateProbeContent content, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(content, nameof(content));

            return(GetExtensionClient(subscriptionResource).ValidateProbe(content, cancellationToken));
        }
Exemplo n.º 4
0
        public static async Task <Response <ValidateProbeResult> > ValidateProbeAsync(this SubscriptionResource subscriptionResource, ValidateProbeContent content, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(content, nameof(content));

            return(await GetExtensionClient(subscriptionResource).ValidateProbeAsync(content, cancellationToken).ConfigureAwait(false));
        }
Exemplo n.º 5
0
        public virtual async Task <Response <ValidateProbeResult> > ValidateProbeAsync(ValidateProbeContent content, CancellationToken cancellationToken = default)
        {
            using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateProbe");
            scope.Start();
            try
            {
                var response = await DefaultRestClient.ValidateProbeAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false);

                return(response);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }