public virtual Response <IReadOnlyList <ScriptLogData> > GetLogs(CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("DeploymentScript.GetLogs");
     scope.Start();
     try
     {
         var response = _deploymentScriptsRestClient.GetLogs(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         return(Response.FromValue(response.Value.Value, response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
예제 #2
0
        public virtual Pageable <ScriptLog> GetLogs(CancellationToken cancellationToken = default)
        {
            Page <ScriptLog> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _scriptLogDeploymentScriptsClientDiagnostics.CreateScope("DeploymentScript.GetLogs");
                scope.Start();
                try
                {
                    var response = _scriptLogDeploymentScriptsRestClient.GetLogs(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ScriptLog(Client, value)), null, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, null));
        }