Update vendored dependencies
This includes github.com/kurin/blazer 0.2.0, which resolves #1291
This commit is contained in:
parent
ba23d24dd1
commit
61cb1cc6f8
1044 changed files with 203022 additions and 97709 deletions
414
vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go
generated
vendored
414
vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go
generated
vendored
|
@ -14,9 +14,8 @@ package containerregistry
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
@ -25,8 +24,7 @@ import (
|
|||
"net/http"
|
||||
)
|
||||
|
||||
// RegistriesClient is the client for the Registries methods of the
|
||||
// Containerregistry service.
|
||||
// RegistriesClient is the client for the Registries methods of the Containerregistry service.
|
||||
type RegistriesClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
@ -36,18 +34,15 @@ func NewRegistriesClient(subscriptionID string) RegistriesClient {
|
|||
return NewRegistriesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewRegistriesClientWithBaseURI creates an instance of the RegistriesClient
|
||||
// client.
|
||||
// NewRegistriesClientWithBaseURI creates an instance of the RegistriesClient client.
|
||||
func NewRegistriesClientWithBaseURI(baseURI string, subscriptionID string) RegistriesClient {
|
||||
return RegistriesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CheckNameAvailability checks whether the container registry name is
|
||||
// available for use. The name must contain only alphanumeric characters, be
|
||||
// globally unique, and between 5 and 60 characters in length.
|
||||
// CheckNameAvailability checks whether the container registry name is available for use. The name must contain only
|
||||
// alphanumeric characters, be globally unique, and between 5 and 50 characters in length.
|
||||
//
|
||||
// registryNameCheckRequest is the object containing information for the
|
||||
// availability request.
|
||||
// registryNameCheckRequest is the object containing information for the availability request.
|
||||
func (client RegistriesClient) CheckNameAvailability(registryNameCheckRequest RegistryNameCheckRequest) (result RegistryNameStatus, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: registryNameCheckRequest,
|
||||
|
@ -87,7 +82,7 @@ func (client RegistriesClient) CheckNameAvailabilityPreparer(registryNameCheckRe
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -121,16 +116,13 @@ func (client RegistriesClient) CheckNameAvailabilityResponder(resp *http.Respons
|
|||
return
|
||||
}
|
||||
|
||||
// Create creates a container registry with the specified parameters. This
|
||||
// method may poll for completion. Polling can be canceled by passing the
|
||||
// cancel channel argument. The channel will be used to cancel polling and any
|
||||
// outstanding HTTP requests.
|
||||
// Create creates a container registry with the specified parameters. This method may poll for completion. Polling can
|
||||
// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding
|
||||
// HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the container
|
||||
// registry belongs. registryName is the name of the container registry.
|
||||
// registryCreateParameters is the parameters for creating a container
|
||||
// registry.
|
||||
func (client RegistriesClient) Create(resourceGroupName string, registryName string, registryCreateParameters RegistryCreateParameters, cancel <-chan struct{}) (<-chan Registry, <-chan error) {
|
||||
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the
|
||||
// name of the container registry. registry is the parameters for creating a container registry.
|
||||
func (client RegistriesClient) Create(resourceGroupName string, registryName string, registry Registry, cancel <-chan struct{}) (<-chan Registry, <-chan error) {
|
||||
resultChan := make(chan Registry, 1)
|
||||
errChan := make(chan error, 1)
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
|
@ -138,15 +130,11 @@ func (client RegistriesClient) Create(resourceGroupName string, registryName str
|
|||
Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: registryCreateParameters,
|
||||
Constraints: []validation.Constraint{{Target: "registryCreateParameters.Location", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "registryCreateParameters.Sku", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "registryCreateParameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "registryCreateParameters.RegistryPropertiesCreateParameters", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "registryCreateParameters.RegistryPropertiesCreateParameters.StorageAccount", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "registryCreateParameters.RegistryPropertiesCreateParameters.StorageAccount.Name", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "registryCreateParameters.RegistryPropertiesCreateParameters.StorageAccount.AccessKey", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{TargetValue: registry,
|
||||
Constraints: []validation.Constraint{{Target: "registry.Sku", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "registry.RegistryProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount.ID", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
}}}}}); err != nil {
|
||||
errChan <- validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Create")
|
||||
close(errChan)
|
||||
|
@ -158,12 +146,14 @@ func (client RegistriesClient) Create(resourceGroupName string, registryName str
|
|||
var err error
|
||||
var result Registry
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
req, err := client.CreatePreparer(resourceGroupName, registryName, registryCreateParameters, cancel)
|
||||
req, err := client.CreatePreparer(resourceGroupName, registryName, registry, cancel)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Create", nil, "Failure preparing request")
|
||||
return
|
||||
|
@ -185,14 +175,14 @@ func (client RegistriesClient) Create(resourceGroupName string, registryName str
|
|||
}
|
||||
|
||||
// CreatePreparer prepares the Create request.
|
||||
func (client RegistriesClient) CreatePreparer(resourceGroupName string, registryName string, registryCreateParameters RegistryCreateParameters, cancel <-chan struct{}) (*http.Request, error) {
|
||||
func (client RegistriesClient) CreatePreparer(resourceGroupName string, registryName string, registry Registry, cancel <-chan struct{}) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"registryName": autorest.Encode("path", registryName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -202,7 +192,7 @@ func (client RegistriesClient) CreatePreparer(resourceGroupName string, registry
|
|||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters),
|
||||
autorest.WithJSON(registryCreateParameters),
|
||||
autorest.WithJSON(registry),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{Cancel: cancel})
|
||||
}
|
||||
|
@ -221,56 +211,73 @@ func (client RegistriesClient) CreateResponder(resp *http.Response) (result Regi
|
|||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes a container registry.
|
||||
// Delete deletes a container registry. This method may poll for completion. Polling can be canceled by passing the
|
||||
// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the container
|
||||
// registry belongs. registryName is the name of the container registry.
|
||||
func (client RegistriesClient) Delete(resourceGroupName string, registryName string) (result autorest.Response, err error) {
|
||||
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the
|
||||
// name of the container registry.
|
||||
func (client RegistriesClient) Delete(resourceGroupName string, registryName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: registryName,
|
||||
Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Delete")
|
||||
errChan <- validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Delete")
|
||||
close(errChan)
|
||||
close(resultChan)
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(resourceGroupName, registryName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
var err error
|
||||
var result autorest.Response
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
req, err := client.DeletePreparer(resourceGroupName, registryName, cancel)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure responding to request")
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client RegistriesClient) DeletePreparer(resourceGroupName string, registryName string) (*http.Request, error) {
|
||||
func (client RegistriesClient) DeletePreparer(resourceGroupName string, registryName string, cancel <-chan struct{}) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"registryName": autorest.Encode("path", registryName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -280,13 +287,15 @@ func (client RegistriesClient) DeletePreparer(resourceGroupName string, registry
|
|||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
return preparer.Prepare(&http.Request{Cancel: cancel})
|
||||
}
|
||||
|
||||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client RegistriesClient) DeleteSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
return autorest.SendWithSender(client,
|
||||
req,
|
||||
azure.DoPollForAsynchronous(client.PollingDelay))
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
|
@ -295,7 +304,7 @@ func (client RegistriesClient) DeleteResponder(resp *http.Response) (result auto
|
|||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
|
@ -303,8 +312,8 @@ func (client RegistriesClient) DeleteResponder(resp *http.Response) (result auto
|
|||
|
||||
// Get gets the properties of the specified container registry.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the container
|
||||
// registry belongs. registryName is the name of the container registry.
|
||||
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the
|
||||
// name of the container registry.
|
||||
func (client RegistriesClient) Get(resourceGroupName string, registryName string) (result Registry, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: registryName,
|
||||
|
@ -343,7 +352,7 @@ func (client RegistriesClient) GetPreparer(resourceGroupName string, registryNam
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -404,7 +413,7 @@ func (client RegistriesClient) ListPreparer() (*http.Request, error) {
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -460,11 +469,54 @@ func (client RegistriesClient) ListNextResults(lastResults RegistryListResult) (
|
|||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup lists all the container registries under the specified
|
||||
// resource group.
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client RegistriesClient) ListComplete(cancel <-chan struct{}) (<-chan Registry, <-chan error) {
|
||||
resultChan := make(chan Registry)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListByResourceGroup lists all the container registries under the specified resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the container
|
||||
// registry belongs.
|
||||
// resourceGroupName is the name of the resource group to which the container registry belongs.
|
||||
func (client RegistriesClient) ListByResourceGroup(resourceGroupName string) (result RegistryListResult, err error) {
|
||||
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
|
||||
if err != nil {
|
||||
|
@ -494,7 +546,7 @@ func (client RegistriesClient) ListByResourceGroupPreparer(resourceGroupName str
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -550,11 +602,55 @@ func (client RegistriesClient) ListByResourceGroupNextResults(lastResults Regist
|
|||
return
|
||||
}
|
||||
|
||||
// ListCredentials lists the login credentials for the specified container
|
||||
// registry.
|
||||
// ListByResourceGroupComplete gets all elements from the list without paging.
|
||||
func (client RegistriesClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan Registry, <-chan error) {
|
||||
resultChan := make(chan Registry)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByResourceGroup(resourceGroupName)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListByResourceGroupNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListCredentials lists the login credentials for the specified container registry.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the container
|
||||
// registry belongs. registryName is the name of the container registry.
|
||||
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the
|
||||
// name of the container registry.
|
||||
func (client RegistriesClient) ListCredentials(resourceGroupName string, registryName string) (result RegistryListCredentialsResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: registryName,
|
||||
|
@ -593,7 +689,7 @@ func (client RegistriesClient) ListCredentialsPreparer(resourceGroupName string,
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -625,13 +721,85 @@ func (client RegistriesClient) ListCredentialsResponder(resp *http.Response) (re
|
|||
return
|
||||
}
|
||||
|
||||
// RegenerateCredential regenerates one of the login credentials for the
|
||||
// specified container registry.
|
||||
// ListUsages gets the quota usages for the specified container registry.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the container
|
||||
// registry belongs. registryName is the name of the container registry.
|
||||
// regenerateCredentialParameters is specifies name of the password which
|
||||
// should be regenerated -- password or password2.
|
||||
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the
|
||||
// name of the container registry.
|
||||
func (client RegistriesClient) ListUsages(resourceGroupName string, registryName string) (result RegistryUsageListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: registryName,
|
||||
Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "ListUsages")
|
||||
}
|
||||
|
||||
req, err := client.ListUsagesPreparer(resourceGroupName, registryName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListUsagesSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListUsagesResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListUsagesPreparer prepares the ListUsages request.
|
||||
func (client RegistriesClient) ListUsagesPreparer(resourceGroupName string, registryName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"registryName": autorest.Encode("path", registryName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListUsagesSender sends the ListUsages request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client RegistriesClient) ListUsagesSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListUsagesResponder handles the response to the ListUsages request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client RegistriesClient) ListUsagesResponder(resp *http.Response) (result RegistryUsageListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// RegenerateCredential regenerates one of the login credentials for the specified container registry.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the
|
||||
// name of the container registry. regenerateCredentialParameters is specifies name of the password which should be
|
||||
// regenerated -- password or password2.
|
||||
func (client RegistriesClient) RegenerateCredential(resourceGroupName string, registryName string, regenerateCredentialParameters RegenerateCredentialParameters) (result RegistryListCredentialsResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: registryName,
|
||||
|
@ -670,7 +838,7 @@ func (client RegistriesClient) RegenerateCredentialPreparer(resourceGroupName st
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -704,51 +872,67 @@ func (client RegistriesClient) RegenerateCredentialResponder(resp *http.Response
|
|||
return
|
||||
}
|
||||
|
||||
// Update updates a container registry with the specified parameters.
|
||||
// Update updates a container registry with the specified parameters. This method may poll for completion. Polling can
|
||||
// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding
|
||||
// HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the container
|
||||
// registry belongs. registryName is the name of the container registry.
|
||||
// registryUpdateParameters is the parameters for updating a container
|
||||
// registry.
|
||||
func (client RegistriesClient) Update(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (result Registry, err error) {
|
||||
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the
|
||||
// name of the container registry. registryUpdateParameters is the parameters for updating a container registry.
|
||||
func (client RegistriesClient) Update(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters, cancel <-chan struct{}) (<-chan Registry, <-chan error) {
|
||||
resultChan := make(chan Registry, 1)
|
||||
errChan := make(chan error, 1)
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: registryName,
|
||||
Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Update")
|
||||
errChan <- validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Update")
|
||||
close(errChan)
|
||||
close(resultChan)
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
req, err := client.UpdatePreparer(resourceGroupName, registryName, registryUpdateParameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
var err error
|
||||
var result Registry
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
req, err := client.UpdatePreparer(resourceGroupName, registryName, registryUpdateParameters, cancel)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.UpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
resp, err := client.UpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
result, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure responding to request")
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client RegistriesClient) UpdatePreparer(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (*http.Request, error) {
|
||||
func (client RegistriesClient) UpdatePreparer(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters, cancel <-chan struct{}) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"registryName": autorest.Encode("path", registryName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-01"
|
||||
const APIVersion = "2017-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -760,13 +944,15 @@ func (client RegistriesClient) UpdatePreparer(resourceGroupName string, registry
|
|||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters),
|
||||
autorest.WithJSON(registryUpdateParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
return preparer.Prepare(&http.Request{Cancel: cancel})
|
||||
}
|
||||
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client RegistriesClient) UpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
return autorest.SendWithSender(client,
|
||||
req,
|
||||
azure.DoPollForAsynchronous(client.PollingDelay))
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
|
@ -775,7 +961,7 @@ func (client RegistriesClient) UpdateResponder(resp *http.Response) (result Regi
|
|||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue