Пример #1
0
        /// <summary> Get registry artifact properties by tag or digest. </summary>
        /// <param name="tagOrDigest"> Either a tag or the digest identifying this registry artifact. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        public virtual Response <RegistryArtifactProperties> GetRegistryArtifactProperties(string tagOrDigest, CancellationToken cancellationToken = default)
        {
            using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ContainerRepositoryClient)}.{nameof(GetRegistryArtifactProperties)}");
            scope.Start();

            try
            {
                string digest = IsDigest(tagOrDigest) ? tagOrDigest : _restClient.GetTagProperties(_repository, tagOrDigest, cancellationToken).Value.Digest;

                return(_restClient.GetRegistryArtifactProperties(_repository, digest, cancellationToken));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
 /// <summary> Get tag attributes by tag. </summary>
 /// <param name="tag"> Tag name. </param>
 /// <param name="cancellationToken"> The cancellation token to use. </param>
 public virtual Response <TagProperties> GetTagProperties(string tag, CancellationToken cancellationToken = default)
 {
     using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ContainerRepositoryClient)}.{nameof(GetTagProperties)}");
     scope.Start();
     try
     {
         return(_restClient.GetTagProperties(_repository, tag, cancellationToken));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }