Beispiel #1
0
        public virtual async Task <Response <ScriptLog> > GetAsync(int?tail = null, CancellationToken cancellationToken = default)
        {
            using var scope = _scriptLogDeploymentScriptsClientDiagnostics.CreateScope("ScriptLog.Get");
            scope.Start();
            try
            {
                var response = await _scriptLogDeploymentScriptsRestClient.GetLogsDefaultAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, tail, cancellationToken).ConfigureAwait(false);

                if (response.Value == null)
                {
                    throw new RequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new ScriptLog(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }