mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Upgrade AWS SDK to the latest version
This commit is contained in:
+172
-178
@@ -1,6 +1,5 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package ecr provides a client for Amazon EC2 Container Registry.
|
||||
package ecr
|
||||
|
||||
import (
|
||||
@@ -15,19 +14,18 @@ const opBatchCheckLayerAvailability = "BatchCheckLayerAvailability"
|
||||
|
||||
// BatchCheckLayerAvailabilityRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the BatchCheckLayerAvailability operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See BatchCheckLayerAvailability for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the BatchCheckLayerAvailability method directly
|
||||
// instead.
|
||||
// See BatchCheckLayerAvailability for more information on using the BatchCheckLayerAvailability
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the BatchCheckLayerAvailabilityRequest method.
|
||||
// req, resp := client.BatchCheckLayerAvailabilityRequest(params)
|
||||
@@ -108,19 +106,18 @@ const opBatchDeleteImage = "BatchDeleteImage"
|
||||
|
||||
// BatchDeleteImageRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the BatchDeleteImage operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See BatchDeleteImage for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the BatchDeleteImage method directly
|
||||
// instead.
|
||||
// See BatchDeleteImage for more information on using the BatchDeleteImage
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the BatchDeleteImageRequest method.
|
||||
// req, resp := client.BatchDeleteImageRequest(params)
|
||||
@@ -204,19 +201,18 @@ const opBatchGetImage = "BatchGetImage"
|
||||
|
||||
// BatchGetImageRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the BatchGetImage operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See BatchGetImage for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the BatchGetImage method directly
|
||||
// instead.
|
||||
// See BatchGetImage for more information on using the BatchGetImage
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the BatchGetImageRequest method.
|
||||
// req, resp := client.BatchGetImageRequest(params)
|
||||
@@ -293,19 +289,18 @@ const opCompleteLayerUpload = "CompleteLayerUpload"
|
||||
|
||||
// CompleteLayerUploadRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the CompleteLayerUpload operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See CompleteLayerUpload for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the CompleteLayerUpload method directly
|
||||
// instead.
|
||||
// See CompleteLayerUpload for more information on using the CompleteLayerUpload
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the CompleteLayerUploadRequest method.
|
||||
// req, resp := client.CompleteLayerUploadRequest(params)
|
||||
@@ -404,19 +399,18 @@ const opCreateRepository = "CreateRepository"
|
||||
|
||||
// CreateRepositoryRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the CreateRepository operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See CreateRepository for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the CreateRepository method directly
|
||||
// instead.
|
||||
// See CreateRepository for more information on using the CreateRepository
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the CreateRepositoryRequest method.
|
||||
// req, resp := client.CreateRepositoryRequest(params)
|
||||
@@ -497,19 +491,18 @@ const opDeleteRepository = "DeleteRepository"
|
||||
|
||||
// DeleteRepositoryRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DeleteRepository operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DeleteRepository for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DeleteRepository method directly
|
||||
// instead.
|
||||
// See DeleteRepository for more information on using the DeleteRepository
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DeleteRepositoryRequest method.
|
||||
// req, resp := client.DeleteRepositoryRequest(params)
|
||||
@@ -590,19 +583,18 @@ const opDeleteRepositoryPolicy = "DeleteRepositoryPolicy"
|
||||
|
||||
// DeleteRepositoryPolicyRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DeleteRepositoryPolicy operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DeleteRepositoryPolicy for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DeleteRepositoryPolicy method directly
|
||||
// instead.
|
||||
// See DeleteRepositoryPolicy for more information on using the DeleteRepositoryPolicy
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DeleteRepositoryPolicyRequest method.
|
||||
// req, resp := client.DeleteRepositoryPolicyRequest(params)
|
||||
@@ -682,19 +674,18 @@ const opDescribeImages = "DescribeImages"
|
||||
|
||||
// DescribeImagesRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DescribeImages operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DescribeImages for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DescribeImages method directly
|
||||
// instead.
|
||||
// See DescribeImages for more information on using the DescribeImages
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DescribeImagesRequest method.
|
||||
// req, resp := client.DescribeImagesRequest(params)
|
||||
@@ -812,8 +803,12 @@ func (c *ECR) DescribeImagesPages(input *DescribeImagesInput, fn func(*DescribeI
|
||||
func (c *ECR) DescribeImagesPagesWithContext(ctx aws.Context, input *DescribeImagesInput, fn func(*DescribeImagesOutput, bool) bool, opts ...request.Option) error {
|
||||
p := request.Pagination{
|
||||
NewRequest: func() (*request.Request, error) {
|
||||
inCpy := *input
|
||||
req, _ := c.DescribeImagesRequest(&inCpy)
|
||||
var inCpy *DescribeImagesInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeImagesRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
@@ -831,19 +826,18 @@ const opDescribeRepositories = "DescribeRepositories"
|
||||
|
||||
// DescribeRepositoriesRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DescribeRepositories operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DescribeRepositories for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DescribeRepositories method directly
|
||||
// instead.
|
||||
// See DescribeRepositories for more information on using the DescribeRepositories
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DescribeRepositoriesRequest method.
|
||||
// req, resp := client.DescribeRepositoriesRequest(params)
|
||||
@@ -952,8 +946,12 @@ func (c *ECR) DescribeRepositoriesPages(input *DescribeRepositoriesInput, fn fun
|
||||
func (c *ECR) DescribeRepositoriesPagesWithContext(ctx aws.Context, input *DescribeRepositoriesInput, fn func(*DescribeRepositoriesOutput, bool) bool, opts ...request.Option) error {
|
||||
p := request.Pagination{
|
||||
NewRequest: func() (*request.Request, error) {
|
||||
inCpy := *input
|
||||
req, _ := c.DescribeRepositoriesRequest(&inCpy)
|
||||
var inCpy *DescribeRepositoriesInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeRepositoriesRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
@@ -971,19 +969,18 @@ const opGetAuthorizationToken = "GetAuthorizationToken"
|
||||
|
||||
// GetAuthorizationTokenRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the GetAuthorizationToken operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See GetAuthorizationToken for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the GetAuthorizationToken method directly
|
||||
// instead.
|
||||
// See GetAuthorizationToken for more information on using the GetAuthorizationToken
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the GetAuthorizationTokenRequest method.
|
||||
// req, resp := client.GetAuthorizationTokenRequest(params)
|
||||
@@ -1062,19 +1059,18 @@ const opGetDownloadUrlForLayer = "GetDownloadUrlForLayer"
|
||||
|
||||
// GetDownloadUrlForLayerRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the GetDownloadUrlForLayer operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See GetDownloadUrlForLayer for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the GetDownloadUrlForLayer method directly
|
||||
// instead.
|
||||
// See GetDownloadUrlForLayer for more information on using the GetDownloadUrlForLayer
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the GetDownloadUrlForLayerRequest method.
|
||||
// req, resp := client.GetDownloadUrlForLayerRequest(params)
|
||||
@@ -1163,19 +1159,18 @@ const opGetRepositoryPolicy = "GetRepositoryPolicy"
|
||||
|
||||
// GetRepositoryPolicyRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the GetRepositoryPolicy operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See GetRepositoryPolicy for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the GetRepositoryPolicy method directly
|
||||
// instead.
|
||||
// See GetRepositoryPolicy for more information on using the GetRepositoryPolicy
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the GetRepositoryPolicyRequest method.
|
||||
// req, resp := client.GetRepositoryPolicyRequest(params)
|
||||
@@ -1255,19 +1250,18 @@ const opInitiateLayerUpload = "InitiateLayerUpload"
|
||||
|
||||
// InitiateLayerUploadRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the InitiateLayerUpload operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See InitiateLayerUpload for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the InitiateLayerUpload method directly
|
||||
// instead.
|
||||
// See InitiateLayerUpload for more information on using the InitiateLayerUpload
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the InitiateLayerUploadRequest method.
|
||||
// req, resp := client.InitiateLayerUploadRequest(params)
|
||||
@@ -1347,19 +1341,18 @@ const opListImages = "ListImages"
|
||||
|
||||
// ListImagesRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the ListImages operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See ListImages for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the ListImages method directly
|
||||
// instead.
|
||||
// See ListImages for more information on using the ListImages
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the ListImagesRequest method.
|
||||
// req, resp := client.ListImagesRequest(params)
|
||||
@@ -1474,8 +1467,12 @@ func (c *ECR) ListImagesPages(input *ListImagesInput, fn func(*ListImagesOutput,
|
||||
func (c *ECR) ListImagesPagesWithContext(ctx aws.Context, input *ListImagesInput, fn func(*ListImagesOutput, bool) bool, opts ...request.Option) error {
|
||||
p := request.Pagination{
|
||||
NewRequest: func() (*request.Request, error) {
|
||||
inCpy := *input
|
||||
req, _ := c.ListImagesRequest(&inCpy)
|
||||
var inCpy *ListImagesInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.ListImagesRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
@@ -1493,19 +1490,18 @@ const opPutImage = "PutImage"
|
||||
|
||||
// PutImageRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the PutImage operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See PutImage for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the PutImage method directly
|
||||
// instead.
|
||||
// See PutImage for more information on using the PutImage
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the PutImageRequest method.
|
||||
// req, resp := client.PutImageRequest(params)
|
||||
@@ -1599,19 +1595,18 @@ const opSetRepositoryPolicy = "SetRepositoryPolicy"
|
||||
|
||||
// SetRepositoryPolicyRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the SetRepositoryPolicy operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See SetRepositoryPolicy for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the SetRepositoryPolicy method directly
|
||||
// instead.
|
||||
// See SetRepositoryPolicy for more information on using the SetRepositoryPolicy
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the SetRepositoryPolicyRequest method.
|
||||
// req, resp := client.SetRepositoryPolicyRequest(params)
|
||||
@@ -1687,19 +1682,18 @@ const opUploadLayerPart = "UploadLayerPart"
|
||||
|
||||
// UploadLayerPartRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the UploadLayerPart operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See UploadLayerPart for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the UploadLayerPart method directly
|
||||
// instead.
|
||||
// See UploadLayerPart for more information on using the UploadLayerPart
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the UploadLayerPartRequest method.
|
||||
// req, resp := client.UploadLayerPartRequest(params)
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package ecr provides the client and types for making API
|
||||
// requests to Amazon EC2 Container Registry.
|
||||
//
|
||||
// Amazon EC2 Container Registry (Amazon ECR) is a managed AWS Docker registry
|
||||
// service. Customers can use the familiar Docker CLI to push, pull, and manage
|
||||
// images. Amazon ECR provides a secure, scalable, and reliable registry. Amazon
|
||||
// ECR supports private Docker repositories with resource-based permissions
|
||||
// using AWS IAM so that specific users or Amazon EC2 instances can access repositories
|
||||
// and images. Developers can use the Docker CLI to author and manage images.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21 for more information on this service.
|
||||
//
|
||||
// See ecr package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecr/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To Amazon EC2 Container Registry with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Amazon EC2 Container Registry client ECR for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecr/#New
|
||||
package ecr
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package ecriface provides an interface to enable mocking the Amazon EC2 Container Registry service client
|
||||
// for testing your code.
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
// to inject custom request handlers into the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon EC2 Container Registry.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package ecr
|
||||
|
||||
|
||||
+281
-388
@@ -1,450 +1,343 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package ecr_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/ecr"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleECR_BatchCheckLayerAvailability() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.BatchCheckLayerAvailabilityInput{
|
||||
LayerDigests: []*string{ // Required
|
||||
aws.String("BatchedOperationLayerDigest"), // Required
|
||||
// More values...
|
||||
},
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.BatchCheckLayerAvailability(params)
|
||||
var _ strings.Reader
|
||||
var _ aws.Config
|
||||
|
||||
func parseTime(layout, value string) *time.Time {
|
||||
t, err := time.Parse(layout, value)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
return &t
|
||||
}
|
||||
|
||||
func ExampleECR_BatchDeleteImage() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.BatchDeleteImageInput{
|
||||
ImageIds: []*ecr.ImageIdentifier{ // Required
|
||||
{ // Required
|
||||
ImageDigest: aws.String("ImageDigest"),
|
||||
ImageTag: aws.String("ImageTag"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.BatchDeleteImage(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_BatchGetImage() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.BatchGetImageInput{
|
||||
ImageIds: []*ecr.ImageIdentifier{ // Required
|
||||
{ // Required
|
||||
ImageDigest: aws.String("ImageDigest"),
|
||||
ImageTag: aws.String("ImageTag"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
AcceptedMediaTypes: []*string{
|
||||
aws.String("MediaType"), // Required
|
||||
// More values...
|
||||
},
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.BatchGetImage(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_CompleteLayerUpload() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.CompleteLayerUploadInput{
|
||||
LayerDigests: []*string{ // Required
|
||||
aws.String("LayerDigest"), // Required
|
||||
// More values...
|
||||
},
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
UploadId: aws.String("UploadId"), // Required
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.CompleteLayerUpload(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_CreateRepository() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.CreateRepositoryInput{
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
}
|
||||
resp, err := svc.CreateRepository(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_DeleteRepository() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.DeleteRepositoryInput{
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
Force: aws.Bool(true),
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.DeleteRepository(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_DeleteRepositoryPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.DeleteRepositoryPolicyInput{
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.DeleteRepositoryPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_DescribeImages() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.DescribeImagesInput{
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
Filter: &ecr.DescribeImagesFilter{
|
||||
TagStatus: aws.String("TagStatus"),
|
||||
},
|
||||
// To delete multiple images
|
||||
//
|
||||
// This example deletes images with the tags precise and trusty in a repository called
|
||||
// ubuntu in the default registry for an account.
|
||||
func ExampleECR_BatchDeleteImage_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.BatchDeleteImageInput{
|
||||
ImageIds: []*ecr.ImageIdentifier{
|
||||
{ // Required
|
||||
ImageDigest: aws.String("ImageDigest"),
|
||||
ImageTag: aws.String("ImageTag"),
|
||||
{
|
||||
ImageTag: aws.String("precise"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
resp, err := svc.DescribeImages(params)
|
||||
|
||||
result, err := svc.BatchDeleteImage(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleECR_DescribeRepositories() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.DescribeRepositoriesInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
RepositoryNames: []*string{
|
||||
aws.String("RepositoryName"), // Required
|
||||
// More values...
|
||||
// To obtain multiple images in a single request
|
||||
//
|
||||
// This example obtains information for an image with a specified image digest ID from
|
||||
// the repository named ubuntu in the current account.
|
||||
func ExampleECR_BatchGetImage_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.BatchGetImageInput{
|
||||
ImageIds: []*ecr.ImageIdentifier{
|
||||
{
|
||||
ImageTag: aws.String("precise"),
|
||||
},
|
||||
},
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
resp, err := svc.DescribeRepositories(params)
|
||||
|
||||
result, err := svc.BatchGetImage(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleECR_GetAuthorizationToken() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.GetAuthorizationTokenInput{
|
||||
RegistryIds: []*string{
|
||||
aws.String("RegistryId"), // Required
|
||||
// More values...
|
||||
},
|
||||
// To create a new repository
|
||||
//
|
||||
// This example creates a repository called nginx-web-app inside the project-a namespace
|
||||
// in the default registry for an account.
|
||||
func ExampleECR_CreateRepository_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.CreateRepositoryInput{
|
||||
RepositoryName: aws.String("project-a/nginx-web-app"),
|
||||
}
|
||||
resp, err := svc.GetAuthorizationToken(params)
|
||||
|
||||
result, err := svc.CreateRepository(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryAlreadyExistsException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryAlreadyExistsException, aerr.Error())
|
||||
case ecr.ErrCodeLimitExceededException:
|
||||
fmt.Println(ecr.ErrCodeLimitExceededException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleECR_GetDownloadUrlForLayer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.GetDownloadUrlForLayerInput{
|
||||
LayerDigest: aws.String("LayerDigest"), // Required
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.GetDownloadUrlForLayer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_GetRepositoryPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.GetRepositoryPolicyInput{
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.GetRepositoryPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_InitiateLayerUpload() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.InitiateLayerUploadInput{
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.InitiateLayerUpload(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_ListImages() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.ListImagesInput{
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
Filter: &ecr.ListImagesFilter{
|
||||
TagStatus: aws.String("TagStatus"),
|
||||
},
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.ListImages(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_PutImage() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.PutImageInput{
|
||||
ImageManifest: aws.String("ImageManifest"), // Required
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
ImageTag: aws.String("ImageTag"),
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
}
|
||||
resp, err := svc.PutImage(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleECR_SetRepositoryPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.SetRepositoryPolicyInput{
|
||||
PolicyText: aws.String("RepositoryPolicyText"), // Required
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
// To force delete a repository
|
||||
//
|
||||
// This example force deletes a repository named ubuntu in the default registry for
|
||||
// an account. The force parameter is required if the repository contains images.
|
||||
func ExampleECR_DeleteRepository_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.DeleteRepositoryInput{
|
||||
Force: aws.Bool(true),
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
resp, err := svc.SetRepositoryPolicy(params)
|
||||
|
||||
result, err := svc.DeleteRepository(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotEmptyException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotEmptyException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleECR_UploadLayerPart() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := ecr.New(sess)
|
||||
|
||||
params := &ecr.UploadLayerPartInput{
|
||||
LayerPartBlob: []byte("PAYLOAD"), // Required
|
||||
PartFirstByte: aws.Int64(1), // Required
|
||||
PartLastByte: aws.Int64(1), // Required
|
||||
RepositoryName: aws.String("RepositoryName"), // Required
|
||||
UploadId: aws.String("UploadId"), // Required
|
||||
RegistryId: aws.String("RegistryId"),
|
||||
// To delete the policy associated with a repository
|
||||
//
|
||||
// This example deletes the policy associated with the repository named ubuntu in the
|
||||
// current account.
|
||||
func ExampleECR_DeleteRepositoryPolicy_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.DeleteRepositoryPolicyInput{
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
resp, err := svc.UploadLayerPart(params)
|
||||
|
||||
result, err := svc.DeleteRepositoryPolicy(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryPolicyNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryPolicyNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To describe all repositories in the current account
|
||||
//
|
||||
// The following example obtains a list and description of all repositories in the default
|
||||
// registry to which the current user has access.
|
||||
func ExampleECR_DescribeRepositories_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.DescribeRepositoriesInput{}
|
||||
|
||||
result, err := svc.DescribeRepositories(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To obtain an authorization token
|
||||
//
|
||||
// This example gets an authorization token for your default registry.
|
||||
func ExampleECR_GetAuthorizationToken_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.GetAuthorizationTokenInput{}
|
||||
|
||||
result, err := svc.GetAuthorizationToken(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To get the current policy for a repository
|
||||
//
|
||||
// This example obtains the repository policy for the repository named ubuntu.
|
||||
func ExampleECR_GetRepositoryPolicy_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.GetRepositoryPolicyInput{
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
|
||||
result, err := svc.GetRepositoryPolicy(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryPolicyNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryPolicyNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To list all images in a repository
|
||||
//
|
||||
// This example lists all of the images in the repository named ubuntu in the default
|
||||
// registry in the current account.
|
||||
func ExampleECR_ListImages_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.ListImagesInput{
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
|
||||
result, err := svc.ListImages(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
+7
-10
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package ecr
|
||||
|
||||
@@ -11,15 +11,12 @@ import (
|
||||
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
|
||||
)
|
||||
|
||||
// Amazon EC2 Container Registry (Amazon ECR) is a managed AWS Docker registry
|
||||
// service. Customers can use the familiar Docker CLI to push, pull, and manage
|
||||
// images. Amazon ECR provides a secure, scalable, and reliable registry. Amazon
|
||||
// ECR supports private Docker repositories with resource-based permissions
|
||||
// using AWS IAM so that specific users or Amazon EC2 instances can access repositories
|
||||
// and images. Developers can use the Docker CLI to author and manage images.
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21
|
||||
// ECR provides the API operation methods for making requests to
|
||||
// Amazon EC2 Container Registry. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// ECR methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type ECR struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user