private Amazon.ECR.Model.UploadLayerPartResponse CallAWSServiceOperation(IAmazonECR client, Amazon.ECR.Model.UploadLayerPartRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon EC2 Container Registry", "UploadLayerPart"); try { #if DESKTOP return(client.UploadLayerPart(request)); #elif CORECLR return(client.UploadLayerPartAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
internal ListImagesPaginator(IAmazonECR client, ListImagesRequest request) { this._client = client; this._request = request; }
internal DescribeRepositoriesPaginator(IAmazonECR client, DescribeRepositoriesRequest request) { this._client = client; this._request = request; }
internal DescribePullThroughCacheRulesPaginator(IAmazonECR client, DescribePullThroughCacheRulesRequest request) { this._client = client; this._request = request; }
public ImagesService(IAmazonECR containerRegistryClient) { _containerRegistryClient = containerRegistryClient; }
internal GetLifecyclePolicyPreviewPaginator(IAmazonECR client, GetLifecyclePolicyPreviewRequest request) { this._client = client; this._request = request; }
internal ECRPaginatorFactory(IAmazonECR client) { this.client = client; }
internal DescribeImageScanFindingsPaginator(IAmazonECR client, DescribeImageScanFindingsRequest request) { this._client = client; this._request = request; }
public static async Task <string> ExpandImageTagIfNecessary(IToolLogger logger, IAmazonECR ecrClient, string dockerImageTag) { try { if (dockerImageTag.Contains(".amazonaws.")) { return(dockerImageTag); } string repositoryName = dockerImageTag; if (repositoryName.Contains(":")) { repositoryName = repositoryName.Substring(0, repositoryName.IndexOf(':')); } DescribeRepositoriesResponse describeResponse = null; try { describeResponse = await ecrClient.DescribeRepositoriesAsync(new DescribeRepositoriesRequest { RepositoryNames = new List <string> { repositoryName } }); } catch (Exception e) { if (!(e is RepositoryNotFoundException)) { throw; } } // Not found in ECR, assume pulling Docker Hub if (describeResponse == null) { return(dockerImageTag); } var fullPath = describeResponse.Repositories[0].RepositoryUri + dockerImageTag.Substring(dockerImageTag.IndexOf(':')); logger?.WriteLine($"Determined full image name to be {fullPath}"); return(fullPath); } catch (DockerToolsException) { throw; } catch (Exception e) { throw new DockerToolsException($"Error determining full repository path for the image {dockerImageTag}: {e.Message}", DockerToolsException.ECSErrorCode.FailedToExpandImageTag); } }
public GetRepositoryByNameQueryHandler( IAmazonECR amazonEcr) { this.amazonEcr = amazonEcr; }
protected override void ProcessRecord() { base.ProcessRecord(); Client = CreateClient(_CurrentCredentials, _RegionEndpoint); }