Ejemplo n.º 1
0
        internal DescribeRepositoriesResponse DescribeRepositories(DescribeRepositoriesRequest request)
        {
            var marshaller   = new DescribeRepositoriesRequestMarshaller();
            var unmarshaller = DescribeRepositoriesResponseUnmarshaller.Instance;

            return(Invoke <DescribeRepositoriesRequest, DescribeRepositoriesResponse>(request, marshaller, unmarshaller));
        }
Ejemplo n.º 2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonECRPublicConfig config = new AmazonECRPublicConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonECRPublicClient client = new AmazonECRPublicClient(creds, config);

            DescribeRepositoriesResponse resp = new DescribeRepositoriesResponse();

            do
            {
                DescribeRepositoriesRequest req = new DescribeRepositoriesRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.DescribeRepositories(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Repositories)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeRepositories operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeRepositories operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeRepositories">REST API Reference for DescribeRepositories Operation</seealso>
        public Task <DescribeRepositoriesResponse> DescribeRepositoriesAsync(DescribeRepositoriesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DescribeRepositoriesRequestMarshaller();
            var unmarshaller = DescribeRepositoriesResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeRepositoriesRequest, DescribeRepositoriesResponse>(request, marshaller,
                                                                                           unmarshaller, cancellationToken));
        }
        public async Task <List <Repository> > GetECRRepositories(List <string> repositoryNames)
        {
            var ecrClient = _awsClientFactory.GetAWSClient <IAmazonECR>();

            var request = new DescribeRepositoriesRequest
            {
                RepositoryNames = repositoryNames
            };

            try
            {
                return(await ecrClient.Paginators
                       .DescribeRepositories(request)
                       .Repositories
                       .ToListAsync());
            }
            catch (RepositoryNotFoundException)
            {
                return(new List <Repository>());
            }
        }
        public async Task<List<Repository>> GetECRRepositories(OrchestratorSession session, List<string> repositoryNames)
        {
            var ecrClient = _awsClientFactory.GetAWSClient<IAmazonECR>(session.AWSCredentials, session.AWSRegion);

            var request = new DescribeRepositoriesRequest
            {
                RepositoryNames = repositoryNames
            };

            try
            {
                return await ecrClient.Paginators
                    .DescribeRepositories(request)
                    .Repositories
                    .ToListAsync();
            }
            catch (RepositoryNotFoundException)
            {
                return new List<Repository>();
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 ///  描述用户指定 registry 下的 repository.
 ///
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public async Task <DescribeRepositoriesResponse> DescribeRepositories(DescribeRepositoriesRequest request)
 {
     return(await new DescribeRepositoriesExecutor().Client(this).Execute <DescribeRepositoriesResponse, DescribeRepositoriesResult, DescribeRepositoriesRequest>(request).ConfigureAwait(false));
 }
Ejemplo n.º 7
0
 /// <summary>
 ///  描述用户指定 registry 下的 repository.
 ///
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public DescribeRepositoriesResponse DescribeRepositories(DescribeRepositoriesRequest request)
 {
     return(new DescribeRepositoriesExecutor().Client(this).Execute <DescribeRepositoriesResponse, DescribeRepositoriesResult, DescribeRepositoriesRequest>(request));
 }