From 673557c71763d173fb6025b118fe2f18dd7d39db Mon Sep 17 00:00:00 2001 From: arcturusZhang Date: Wed, 12 Aug 2020 13:59:06 +0800 Subject: [PATCH] Update api-version --- .../services/containers/client/client.go | 2 +- .../containers/container_group_resource.go | 11 +- .../2018-10-01/containerinstance/client.go | 202 ------ .../containerinstance/containergroupusage.go | 116 ---- .../serviceassociationlink.go | 120 ---- .../2019-12-01/containerinstance/client.go | 52 ++ .../containerinstance/containergroups.go | 53 +- .../containerinstance/containers.go} | 52 +- .../2019-12-01/containerinstance/location.go | 337 ++++++++++ .../containerinstance/models.go | 588 +++++++++++++++++- .../containerinstance/operations.go | 50 +- .../containerinstance/version.go | 2 +- vendor/modules.txt | 2 +- 13 files changed, 1065 insertions(+), 522 deletions(-) delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/containergroupusage.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/serviceassociationlink.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/client.go rename vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/{2018-10-01 => 2019-12-01}/containerinstance/containergroups.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/{2018-10-01/containerinstance/container.go => 2019-12-01/containerinstance/containers.go} (72%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/location.go rename vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/{2018-10-01 => 2019-12-01}/containerinstance/models.go (66%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/{2018-10-01 => 2019-12-01}/containerinstance/operations.go (69%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/{2018-10-01 => 2019-12-01}/containerinstance/version.go (99%) diff --git a/azurerm/internal/services/containers/client/client.go b/azurerm/internal/services/containers/client/client.go index 5bf4d7d41e92..8b1342aacce8 100644 --- a/azurerm/internal/services/containers/client/client.go +++ b/azurerm/internal/services/containers/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance" + "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance" "github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2018-09-01/containerregistry" "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice" "github.com/Azure/go-autorest/autorest/azure" diff --git a/azurerm/internal/services/containers/container_group_resource.go b/azurerm/internal/services/containers/container_group_resource.go index 6e142544974c..ddb2ca8128da 100644 --- a/azurerm/internal/services/containers/container_group_resource.go +++ b/azurerm/internal/services/containers/container_group_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance" + "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -603,14 +603,13 @@ func resourceArmContainerGroupDelete(d *schema.ResourceData, meta interface{}) e } } - resp, err := client.Delete(ctx, resourceGroup, name) + future, err := client.Delete(ctx, resourceGroup, name) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { - return nil - } - return fmt.Errorf("Error deleting Container Group %q (Resource Group %q): %+v", name, resourceGroup, err) } + if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("Error waiting for deletion of Container Group %q (Resource Group %q): %+v", name, resourceGroup, err) + } if networkProfileId != "" { parsedProfileId, err := azure.ParseAzureResourceID(networkProfileId) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/client.go deleted file mode 100644 index 80189635adae..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/client.go +++ /dev/null @@ -1,202 +0,0 @@ -// Package containerinstance implements the Azure ARM Containerinstance service API version 2018-10-01. -// -// -package containerinstance - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -const ( - // DefaultBaseURI is the default URI used for the service Containerinstance - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Containerinstance. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} - -// ListCachedImages get the list of cached images on specific OS type for a subscription in a region. -// Parameters: -// location - the identifier for the physical azure location. -func (client BaseClient) ListCachedImages(ctx context.Context, location string) (result CachedImagesListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListCachedImages") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListCachedImagesPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.BaseClient", "ListCachedImages", nil, "Failure preparing request") - return - } - - resp, err := client.ListCachedImagesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerinstance.BaseClient", "ListCachedImages", resp, "Failure sending request") - return - } - - result, err = client.ListCachedImagesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.BaseClient", "ListCachedImages", resp, "Failure responding to request") - } - - return -} - -// ListCachedImagesPreparer prepares the ListCachedImages request. -func (client BaseClient) ListCachedImagesPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCachedImagesSender sends the ListCachedImages request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) ListCachedImagesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListCachedImagesResponder handles the response to the ListCachedImages request. The method always -// closes the http.Response Body. -func (client BaseClient) ListCachedImagesResponder(resp *http.Response) (result CachedImagesListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListCapabilities get the list of CPU/memory/GPU capabilities of a region. -// Parameters: -// location - the identifier for the physical azure location. -func (client BaseClient) ListCapabilities(ctx context.Context, location string) (result CapabilitiesListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListCapabilities") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListCapabilitiesPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.BaseClient", "ListCapabilities", nil, "Failure preparing request") - return - } - - resp, err := client.ListCapabilitiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerinstance.BaseClient", "ListCapabilities", resp, "Failure sending request") - return - } - - result, err = client.ListCapabilitiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.BaseClient", "ListCapabilities", resp, "Failure responding to request") - } - - return -} - -// ListCapabilitiesPreparer prepares the ListCapabilities request. -func (client BaseClient) ListCapabilitiesPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCapabilitiesSender sends the ListCapabilities request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) ListCapabilitiesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListCapabilitiesResponder handles the response to the ListCapabilities request. The method always -// closes the http.Response Body. -func (client BaseClient) ListCapabilitiesResponder(resp *http.Response) (result CapabilitiesListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/containergroupusage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/containergroupusage.go deleted file mode 100644 index 8b8ffcb31c5b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/containergroupusage.go +++ /dev/null @@ -1,116 +0,0 @@ -package containerinstance - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ContainerGroupUsageClient is the client for the ContainerGroupUsage methods of the Containerinstance service. -type ContainerGroupUsageClient struct { - BaseClient -} - -// NewContainerGroupUsageClient creates an instance of the ContainerGroupUsageClient client. -func NewContainerGroupUsageClient(subscriptionID string) ContainerGroupUsageClient { - return NewContainerGroupUsageClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewContainerGroupUsageClientWithBaseURI creates an instance of the ContainerGroupUsageClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewContainerGroupUsageClientWithBaseURI(baseURI string, subscriptionID string) ContainerGroupUsageClient { - return ContainerGroupUsageClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List get the usage for a subscription -// Parameters: -// location - the identifier for the physical azure location. -func (client ContainerGroupUsageClient) List(ctx context.Context, location string) (result UsageListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupUsageClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupUsageClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupUsageClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupUsageClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ContainerGroupUsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerGroupUsageClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ContainerGroupUsageClient) ListResponder(resp *http.Response) (result UsageListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/serviceassociationlink.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/serviceassociationlink.go deleted file mode 100644 index c7f5870ae39e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/serviceassociationlink.go +++ /dev/null @@ -1,120 +0,0 @@ -package containerinstance - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceAssociationLinkClient is the client for the ServiceAssociationLink methods of the Containerinstance service. -type ServiceAssociationLinkClient struct { - BaseClient -} - -// NewServiceAssociationLinkClient creates an instance of the ServiceAssociationLinkClient client. -func NewServiceAssociationLinkClient(subscriptionID string) ServiceAssociationLinkClient { - return NewServiceAssociationLinkClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceAssociationLinkClientWithBaseURI creates an instance of the ServiceAssociationLinkClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewServiceAssociationLinkClientWithBaseURI(baseURI string, subscriptionID string) ServiceAssociationLinkClient { - return ServiceAssociationLinkClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete delete the container instance service association link for the subnet. This operation unblocks user from -// deleting subnet. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -func (client ServiceAssociationLinkClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceAssociationLinkClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ServiceAssociationLinkClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "containerinstance.ServiceAssociationLinkClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ServiceAssociationLinkClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServiceAssociationLinkClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceAssociationLinkClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ServiceAssociationLinkClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/client.go new file mode 100644 index 000000000000..7ccfc3e486ee --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/client.go @@ -0,0 +1,52 @@ +// Package containerinstance implements the Azure ARM Containerinstance service API version 2019-12-01. +// +// +package containerinstance + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +const ( + // DefaultBaseURI is the default URI used for the service Containerinstance + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerinstance. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/containergroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/containergroups.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/containergroups.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/containergroups.go index 0150b4b5f3f4..3b83194f2b59 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/containergroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/containergroups.go @@ -74,6 +74,11 @@ func (client ContainerGroupsClient) CreateOrUpdate(ctx context.Context, resource Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.NetworkProfile.ID", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "containerGroup.ContainerGroupProperties.DNSConfig", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.DNSConfig.NameServers", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "containerGroup.ContainerGroupProperties.EncryptionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.EncryptionProperties.VaultBaseURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "containerGroup.ContainerGroupProperties.EncryptionProperties.KeyName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "containerGroup.ContainerGroupProperties.EncryptionProperties.KeyVersion", Name: validation.Null, Rule: true, Chain: nil}, + }}, }}}}}); err != nil { return result, validation.NewError("containerinstance.ContainerGroupsClient", "CreateOrUpdate", err.Error()) } @@ -101,7 +106,7 @@ func (client ContainerGroupsClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -145,13 +150,13 @@ func (client ContainerGroupsClient) CreateOrUpdateResponder(resp *http.Response) // Parameters: // resourceGroupName - the name of the resource group. // containerGroupName - the name of the container group. -func (client ContainerGroupsClient) Delete(ctx context.Context, resourceGroupName string, containerGroupName string) (result ContainerGroup, err error) { +func (client ContainerGroupsClient) Delete(ctx context.Context, resourceGroupName string, containerGroupName string) (result ContainerGroupsDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.Delete") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -162,18 +167,12 @@ func (client ContainerGroupsClient) Delete(ctx context.Context, resourceGroupNam return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Delete", result.Response(), "Failure sending request") return } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Delete", resp, "Failure responding to request") - } - return } @@ -185,7 +184,7 @@ func (client ContainerGroupsClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -200,8 +199,14 @@ func (client ContainerGroupsClient) DeletePreparer(ctx context.Context, resource // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client ContainerGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client ContainerGroupsClient) DeleteSender(req *http.Request) (future ContainerGroupsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // DeleteResponder handles the response to the Delete request. The method always @@ -209,7 +214,7 @@ func (client ContainerGroupsClient) DeleteSender(req *http.Request) (*http.Respo func (client ContainerGroupsClient) DeleteResponder(resp *http.Response) (result ContainerGroup, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -262,7 +267,7 @@ func (client ContainerGroupsClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -335,7 +340,7 @@ func (client ContainerGroupsClient) ListPreparer(ctx context.Context) (*http.Req "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -448,7 +453,7 @@ func (client ContainerGroupsClient) ListByResourceGroupPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -555,7 +560,7 @@ func (client ContainerGroupsClient) RestartPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -591,7 +596,7 @@ func (client ContainerGroupsClient) RestartResponder(resp *http.Response) (resul return } -// Start starts all containers in a container group. +// Start starts all containers in a container group. Compute resources will be allocated and billing will start. // Parameters: // resourceGroupName - the name of the resource group. // containerGroupName - the name of the container group. @@ -629,7 +634,7 @@ func (client ContainerGroupsClient) StartPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -709,7 +714,7 @@ func (client ContainerGroupsClient) StopPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -784,7 +789,7 @@ func (client ContainerGroupsClient) UpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/container.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/containers.go similarity index 72% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/container.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/containers.go index 8bf2b696188a..d123c72a001b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/container.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/containers.go @@ -25,20 +25,20 @@ import ( "net/http" ) -// ContainerClient is the client for the Container methods of the Containerinstance service. -type ContainerClient struct { +// ContainersClient is the client for the Containers methods of the Containerinstance service. +type ContainersClient struct { BaseClient } -// NewContainerClient creates an instance of the ContainerClient client. -func NewContainerClient(subscriptionID string) ContainerClient { - return NewContainerClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewContainersClient creates an instance of the ContainersClient client. +func NewContainersClient(subscriptionID string) ContainersClient { + return NewContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewContainerClientWithBaseURI creates an instance of the ContainerClient client using a custom endpoint. Use this +// NewContainersClientWithBaseURI creates an instance of the ContainersClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewContainerClientWithBaseURI(baseURI string, subscriptionID string) ContainerClient { - return ContainerClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewContainersClientWithBaseURI(baseURI string, subscriptionID string) ContainersClient { + return ContainersClient{NewWithBaseURI(baseURI, subscriptionID)} } // ExecuteCommand executes a command for a specific container instance in a specified resource group and container @@ -48,9 +48,9 @@ func NewContainerClientWithBaseURI(baseURI string, subscriptionID string) Contai // containerGroupName - the name of the container group. // containerName - the name of the container instance. // containerExecRequest - the request for the exec command. -func (client ContainerClient) ExecuteCommand(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest) (result ContainerExecResponse, err error) { +func (client ContainersClient) ExecuteCommand(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest) (result ContainerExecResponse, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerClient.ExecuteCommand") + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.ExecuteCommand") defer func() { sc := -1 if result.Response.Response != nil { @@ -61,27 +61,27 @@ func (client ContainerClient) ExecuteCommand(ctx context.Context, resourceGroupN } req, err := client.ExecuteCommandPreparer(ctx, resourceGroupName, containerGroupName, containerName, containerExecRequest) if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ContainerClient", "ExecuteCommand", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ExecuteCommand", nil, "Failure preparing request") return } resp, err := client.ExecuteCommandSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerinstance.ContainerClient", "ExecuteCommand", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ExecuteCommand", resp, "Failure sending request") return } result, err = client.ExecuteCommandResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ContainerClient", "ExecuteCommand", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ExecuteCommand", resp, "Failure responding to request") } return } // ExecuteCommandPreparer prepares the ExecuteCommand request. -func (client ContainerClient) ExecuteCommandPreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest) (*http.Request, error) { +func (client ContainersClient) ExecuteCommandPreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ "containerGroupName": autorest.Encode("path", containerGroupName), "containerName": autorest.Encode("path", containerName), @@ -89,7 +89,7 @@ func (client ContainerClient) ExecuteCommandPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -106,13 +106,13 @@ func (client ContainerClient) ExecuteCommandPreparer(ctx context.Context, resour // ExecuteCommandSender sends the ExecuteCommand request. The method will close the // http.Response Body if it receives an error. -func (client ContainerClient) ExecuteCommandSender(req *http.Request) (*http.Response, error) { +func (client ContainersClient) ExecuteCommandSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ExecuteCommandResponder handles the response to the ExecuteCommand request. The method always // closes the http.Response Body. -func (client ContainerClient) ExecuteCommandResponder(resp *http.Response) (result ContainerExecResponse, err error) { +func (client ContainersClient) ExecuteCommandResponder(resp *http.Response) (result ContainerExecResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -129,9 +129,9 @@ func (client ContainerClient) ExecuteCommandResponder(resp *http.Response) (resu // containerName - the name of the container instance. // tail - the number of lines to show from the tail of the container instance log. If not provided, all // available logs are shown up to 4mb. -func (client ContainerClient) ListLogs(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, tail *int32) (result Logs, err error) { +func (client ContainersClient) ListLogs(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, tail *int32) (result Logs, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerClient.ListLogs") + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.ListLogs") defer func() { sc := -1 if result.Response.Response != nil { @@ -142,27 +142,27 @@ func (client ContainerClient) ListLogs(ctx context.Context, resourceGroupName st } req, err := client.ListLogsPreparer(ctx, resourceGroupName, containerGroupName, containerName, tail) if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ContainerClient", "ListLogs", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ListLogs", nil, "Failure preparing request") return } resp, err := client.ListLogsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerinstance.ContainerClient", "ListLogs", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ListLogs", resp, "Failure sending request") return } result, err = client.ListLogsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ContainerClient", "ListLogs", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ListLogs", resp, "Failure responding to request") } return } // ListLogsPreparer prepares the ListLogs request. -func (client ContainerClient) ListLogsPreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, tail *int32) (*http.Request, error) { +func (client ContainersClient) ListLogsPreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, tail *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "containerGroupName": autorest.Encode("path", containerGroupName), "containerName": autorest.Encode("path", containerName), @@ -170,7 +170,7 @@ func (client ContainerClient) ListLogsPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,13 +188,13 @@ func (client ContainerClient) ListLogsPreparer(ctx context.Context, resourceGrou // ListLogsSender sends the ListLogs request. The method will close the // http.Response Body if it receives an error. -func (client ContainerClient) ListLogsSender(req *http.Request) (*http.Response, error) { +func (client ContainersClient) ListLogsSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListLogsResponder handles the response to the ListLogs request. The method always // closes the http.Response Body. -func (client ContainerClient) ListLogsResponder(resp *http.Response) (result Logs, err error) { +func (client ContainersClient) ListLogsResponder(resp *http.Response) (result Logs, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/location.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/location.go new file mode 100644 index 000000000000..654da7ddc84a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/location.go @@ -0,0 +1,337 @@ +package containerinstance + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// LocationClient is the client for the Location methods of the Containerinstance service. +type LocationClient struct { + BaseClient +} + +// NewLocationClient creates an instance of the LocationClient client. +func NewLocationClient(subscriptionID string) LocationClient { + return NewLocationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLocationClientWithBaseURI creates an instance of the LocationClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewLocationClientWithBaseURI(baseURI string, subscriptionID string) LocationClient { + return LocationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListCachedImages get the list of cached images on specific OS type for a subscription in a region. +// Parameters: +// location - the identifier for the physical azure location. +func (client LocationClient) ListCachedImages(ctx context.Context, location string) (result CachedImagesListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListCachedImages") + defer func() { + sc := -1 + if result.cilr.Response.Response != nil { + sc = result.cilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listCachedImagesNextResults + req, err := client.ListCachedImagesPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCachedImages", nil, "Failure preparing request") + return + } + + resp, err := client.ListCachedImagesSender(req) + if err != nil { + result.cilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCachedImages", resp, "Failure sending request") + return + } + + result.cilr, err = client.ListCachedImagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCachedImages", resp, "Failure responding to request") + } + + return +} + +// ListCachedImagesPreparer prepares the ListCachedImages request. +func (client LocationClient) ListCachedImagesPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCachedImagesSender sends the ListCachedImages request. The method will close the +// http.Response Body if it receives an error. +func (client LocationClient) ListCachedImagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCachedImagesResponder handles the response to the ListCachedImages request. The method always +// closes the http.Response Body. +func (client LocationClient) ListCachedImagesResponder(resp *http.Response) (result CachedImagesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listCachedImagesNextResults retrieves the next set of results, if any. +func (client LocationClient) listCachedImagesNextResults(ctx context.Context, lastResults CachedImagesListResult) (result CachedImagesListResult, err error) { + req, err := lastResults.cachedImagesListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCachedImagesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListCachedImagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCachedImagesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListCachedImagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCachedImagesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListCachedImagesComplete enumerates all values, automatically crossing page boundaries as required. +func (client LocationClient) ListCachedImagesComplete(ctx context.Context, location string) (result CachedImagesListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListCachedImages") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListCachedImages(ctx, location) + return +} + +// ListCapabilities get the list of CPU/memory/GPU capabilities of a region. +// Parameters: +// location - the identifier for the physical azure location. +func (client LocationClient) ListCapabilities(ctx context.Context, location string) (result CapabilitiesListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListCapabilities") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listCapabilitiesNextResults + req, err := client.ListCapabilitiesPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCapabilities", nil, "Failure preparing request") + return + } + + resp, err := client.ListCapabilitiesSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCapabilities", resp, "Failure sending request") + return + } + + result.clr, err = client.ListCapabilitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCapabilities", resp, "Failure responding to request") + } + + return +} + +// ListCapabilitiesPreparer prepares the ListCapabilities request. +func (client LocationClient) ListCapabilitiesPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCapabilitiesSender sends the ListCapabilities request. The method will close the +// http.Response Body if it receives an error. +func (client LocationClient) ListCapabilitiesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCapabilitiesResponder handles the response to the ListCapabilities request. The method always +// closes the http.Response Body. +func (client LocationClient) ListCapabilitiesResponder(resp *http.Response) (result CapabilitiesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listCapabilitiesNextResults retrieves the next set of results, if any. +func (client LocationClient) listCapabilitiesNextResults(ctx context.Context, lastResults CapabilitiesListResult) (result CapabilitiesListResult, err error) { + req, err := lastResults.capabilitiesListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCapabilitiesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListCapabilitiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCapabilitiesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListCapabilitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCapabilitiesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListCapabilitiesComplete enumerates all values, automatically crossing page boundaries as required. +func (client LocationClient) ListCapabilitiesComplete(ctx context.Context, location string) (result CapabilitiesListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListCapabilities") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListCapabilities(ctx, location) + return +} + +// ListUsage get the usage for a subscription +// Parameters: +// location - the identifier for the physical azure location. +func (client LocationClient) ListUsage(ctx context.Context, location string) (result UsageListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListUsage") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListUsagePreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListUsage", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListUsage", resp, "Failure sending request") + return + } + + result, err = client.ListUsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListUsage", resp, "Failure responding to request") + } + + return +} + +// ListUsagePreparer prepares the ListUsage request. +func (client LocationClient) ListUsagePreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsageSender sends the ListUsage request. The method will close the +// http.Response Body if it receives an error. +func (client LocationClient) ListUsageSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsageResponder handles the response to the ListUsage request. The method always +// closes the http.Response Body. +func (client LocationClient) ListUsageResponder(resp *http.Response) (result UsageListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/models.go similarity index 66% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/models.go index 7d5b3341c1d7..54a76ed989dd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/models.go @@ -29,7 +29,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance" // ContainerGroupIPAddressType enumerates the values for container group ip address type. type ContainerGroupIPAddressType string @@ -78,6 +78,21 @@ func PossibleContainerGroupRestartPolicyValues() []ContainerGroupRestartPolicy { return []ContainerGroupRestartPolicy{Always, Never, OnFailure} } +// ContainerGroupSku enumerates the values for container group sku. +type ContainerGroupSku string + +const ( + // Dedicated ... + Dedicated ContainerGroupSku = "Dedicated" + // Standard ... + Standard ContainerGroupSku = "Standard" +) + +// PossibleContainerGroupSkuValues returns an array of possible values for the ContainerGroupSku const type. +func PossibleContainerGroupSkuValues() []ContainerGroupSku { + return []ContainerGroupSku{Dedicated, Standard} +} + // ContainerNetworkProtocol enumerates the values for container network protocol. type ContainerNetworkProtocol string @@ -203,8 +218,6 @@ type AzureFileVolume struct { // CachedImages the cached image and OS type. type CachedImages struct { - // ID - The resource Id of the cached image. - ID *string `json:"id,omitempty"` // OsType - The OS type of the cached image. OsType *string `json:"osType,omitempty"` // Image - The cached image name. @@ -220,6 +233,143 @@ type CachedImagesListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// CachedImagesListResultIterator provides access to a complete listing of CachedImages values. +type CachedImagesListResultIterator struct { + i int + page CachedImagesListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CachedImagesListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachedImagesListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CachedImagesListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CachedImagesListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CachedImagesListResultIterator) Response() CachedImagesListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CachedImagesListResultIterator) Value() CachedImages { + if !iter.page.NotDone() { + return CachedImages{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CachedImagesListResultIterator type. +func NewCachedImagesListResultIterator(page CachedImagesListResultPage) CachedImagesListResultIterator { + return CachedImagesListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cilr CachedImagesListResult) IsEmpty() bool { + return cilr.Value == nil || len(*cilr.Value) == 0 +} + +// cachedImagesListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cilr CachedImagesListResult) cachedImagesListResultPreparer(ctx context.Context) (*http.Request, error) { + if cilr.NextLink == nil || len(to.String(cilr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cilr.NextLink))) +} + +// CachedImagesListResultPage contains a page of CachedImages values. +type CachedImagesListResultPage struct { + fn func(context.Context, CachedImagesListResult) (CachedImagesListResult, error) + cilr CachedImagesListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CachedImagesListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachedImagesListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.cilr) + if err != nil { + return err + } + page.cilr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CachedImagesListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CachedImagesListResultPage) NotDone() bool { + return !page.cilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CachedImagesListResultPage) Response() CachedImagesListResult { + return page.cilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CachedImagesListResultPage) Values() []CachedImages { + if page.cilr.IsEmpty() { + return nil + } + return *page.cilr.Value +} + +// Creates a new instance of the CachedImagesListResultPage type. +func NewCachedImagesListResultPage(getNextPage func(context.Context, CachedImagesListResult) (CachedImagesListResult, error)) CachedImagesListResultPage { + return CachedImagesListResultPage{fn: getNextPage} +} + // Capabilities the regional capabilities. type Capabilities struct { // ResourceType - READ-ONLY; The resource type that this capability describes. @@ -255,12 +405,149 @@ type CapabilitiesListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// CloudError an error response from the Batch service. +// CapabilitiesListResultIterator provides access to a complete listing of Capabilities values. +type CapabilitiesListResultIterator struct { + i int + page CapabilitiesListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CapabilitiesListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapabilitiesListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CapabilitiesListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CapabilitiesListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CapabilitiesListResultIterator) Response() CapabilitiesListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CapabilitiesListResultIterator) Value() Capabilities { + if !iter.page.NotDone() { + return Capabilities{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CapabilitiesListResultIterator type. +func NewCapabilitiesListResultIterator(page CapabilitiesListResultPage) CapabilitiesListResultIterator { + return CapabilitiesListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CapabilitiesListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// capabilitiesListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CapabilitiesListResult) capabilitiesListResultPreparer(ctx context.Context) (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CapabilitiesListResultPage contains a page of Capabilities values. +type CapabilitiesListResultPage struct { + fn func(context.Context, CapabilitiesListResult) (CapabilitiesListResult, error) + clr CapabilitiesListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CapabilitiesListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapabilitiesListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CapabilitiesListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CapabilitiesListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CapabilitiesListResultPage) Response() CapabilitiesListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CapabilitiesListResultPage) Values() []Capabilities { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// Creates a new instance of the CapabilitiesListResultPage type. +func NewCapabilitiesListResultPage(getNextPage func(context.Context, CapabilitiesListResult) (CapabilitiesListResult, error)) CapabilitiesListResultPage { + return CapabilitiesListResultPage{fn: getNextPage} +} + +// CloudError an error response from the Container Instance service. type CloudError struct { Error *CloudErrorBody `json:"error,omitempty"` } -// CloudErrorBody an error response from the Batch service. +// CloudErrorBody an error response from the Container Instance service. type CloudErrorBody struct { // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. Code *string `json:"code,omitempty"` @@ -360,7 +647,8 @@ type ContainerExecResponse struct { type ContainerGroup struct { autorest.Response `json:"-"` // Identity - The identity of the container group, if configured. - Identity *ContainerGroupIdentity `json:"identity,omitempty"` + Identity *ContainerGroupIdentity `json:"identity,omitempty"` + // ContainerGroupProperties - The container group properties *ContainerGroupProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource id. ID *string `json:"id,omitempty"` @@ -660,7 +948,7 @@ type ContainerGroupNetworkProfile struct { ID *string `json:"id,omitempty"` } -// ContainerGroupProperties ... +// ContainerGroupProperties the container group properties type ContainerGroupProperties struct { // ProvisioningState - READ-ONLY; The provisioning state of the container group. This only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` @@ -688,6 +976,12 @@ type ContainerGroupProperties struct { NetworkProfile *ContainerGroupNetworkProfile `json:"networkProfile,omitempty"` // DNSConfig - The DNS config information for a container group. DNSConfig *DNSConfiguration `json:"dnsConfig,omitempty"` + // Sku - The SKU for a container group. Possible values include: 'Standard', 'Dedicated' + Sku ContainerGroupSku `json:"sku,omitempty"` + // EncryptionProperties - The encryption properties for a container group. + EncryptionProperties *EncryptionProperties `json:"encryptionProperties,omitempty"` + // InitContainers - The init containers for a container group. + InitContainers *[]InitContainerDefinition `json:"initContainers,omitempty"` } // ContainerGroupPropertiesInstanceView the instance view of the container group. Only valid in response. @@ -727,6 +1021,35 @@ func (future *ContainerGroupsCreateOrUpdateFuture) Result(client ContainerGroups return } +// ContainerGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainerGroupsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerGroupsDeleteFuture) Result(client ContainerGroupsClient) (cg ContainerGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerinstance.ContainerGroupsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cg.Response.Response, err = future.GetResult(sender); err == nil && cg.Response.Response.StatusCode != http.StatusNoContent { + cg, err = client.DeleteResponder(cg.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsDeleteFuture", "Result", cg.Response.Response, "Failure responding to request") + } + } + return +} + // ContainerGroupsRestartFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ContainerGroupsRestartFuture struct { @@ -845,15 +1168,15 @@ type ContainerPropertiesInstanceView struct { // ContainerState the container instance state. type ContainerState struct { - // State - The state of the container instance. + // State - READ-ONLY; The state of the container instance. State *string `json:"state,omitempty"` - // StartTime - The date-time when the container instance state started. + // StartTime - READ-ONLY; The date-time when the container instance state started. StartTime *date.Time `json:"startTime,omitempty"` - // ExitCode - The container instance exit codes correspond to those from the `docker run` command. + // ExitCode - READ-ONLY; The container instance exit codes correspond to those from the `docker run` command. ExitCode *int32 `json:"exitCode,omitempty"` - // FinishTime - The date-time when the container instance state finished. + // FinishTime - READ-ONLY; The date-time when the container instance state finished. FinishTime *date.Time `json:"finishTime,omitempty"` - // DetailStatus - The human-readable status of the container instance state. + // DetailStatus - READ-ONLY; The human-readable status of the container instance state. DetailStatus *string `json:"detailStatus,omitempty"` } @@ -867,6 +1190,16 @@ type DNSConfiguration struct { Options *string `json:"options,omitempty"` } +// EncryptionProperties the container group encryption properties. +type EncryptionProperties struct { + // VaultBaseURL - The keyvault base url. + VaultBaseURL *string `json:"vaultBaseUrl,omitempty"` + // KeyName - The encryption key name. + KeyName *string `json:"keyName,omitempty"` + // KeyVersion - The encryption key version. + KeyVersion *string `json:"keyVersion,omitempty"` +} + // EnvironmentVariable the environment variable to set within the container instance. type EnvironmentVariable struct { // Name - The name of the environment variable. @@ -879,17 +1212,17 @@ type EnvironmentVariable struct { // Event a container group or container instance event. type Event struct { - // Count - The count of the event. + // Count - READ-ONLY; The count of the event. Count *int32 `json:"count,omitempty"` - // FirstTimestamp - The date-time of the earliest logged event. + // FirstTimestamp - READ-ONLY; The date-time of the earliest logged event. FirstTimestamp *date.Time `json:"firstTimestamp,omitempty"` - // LastTimestamp - The date-time of the latest logged event. + // LastTimestamp - READ-ONLY; The date-time of the latest logged event. LastTimestamp *date.Time `json:"lastTimestamp,omitempty"` - // Name - The event name. + // Name - READ-ONLY; The event name. Name *string `json:"name,omitempty"` - // Message - The event message. + // Message - READ-ONLY; The event message. Message *string `json:"message,omitempty"` - // Type - The event type. + // Type - READ-ONLY; The event type. Type *string `json:"type,omitempty"` } @@ -921,6 +1254,86 @@ type ImageRegistryCredential struct { Password *string `json:"password,omitempty"` } +// InitContainerDefinition the init container definition. +type InitContainerDefinition struct { + // Name - The name for the init container. + Name *string `json:"name,omitempty"` + // InitContainerPropertiesDefinition - The properties for the init container. + *InitContainerPropertiesDefinition `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for InitContainerDefinition. +func (icd InitContainerDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icd.Name != nil { + objectMap["name"] = icd.Name + } + if icd.InitContainerPropertiesDefinition != nil { + objectMap["properties"] = icd.InitContainerPropertiesDefinition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for InitContainerDefinition struct. +func (icd *InitContainerDefinition) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + icd.Name = &name + } + case "properties": + if v != nil { + var initContainerPropertiesDefinition InitContainerPropertiesDefinition + err = json.Unmarshal(*v, &initContainerPropertiesDefinition) + if err != nil { + return err + } + icd.InitContainerPropertiesDefinition = &initContainerPropertiesDefinition + } + } + } + + return nil +} + +// InitContainerPropertiesDefinition the init container definition properties. +type InitContainerPropertiesDefinition struct { + // Image - The image of the init container. + Image *string `json:"image,omitempty"` + // Command - The command to execute within the init container in exec form. + Command *[]string `json:"command,omitempty"` + // EnvironmentVariables - The environment variables to set in the init container. + EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"` + // InstanceView - READ-ONLY; The instance view of the init container. Only valid in response. + InstanceView *InitContainerPropertiesDefinitionInstanceView `json:"instanceView,omitempty"` + // VolumeMounts - The volume mounts available to the init container. + VolumeMounts *[]VolumeMount `json:"volumeMounts,omitempty"` +} + +// InitContainerPropertiesDefinitionInstanceView the instance view of the init container. Only valid in +// response. +type InitContainerPropertiesDefinitionInstanceView struct { + // RestartCount - READ-ONLY; The number of times that the init container has been restarted. + RestartCount *int32 `json:"restartCount,omitempty"` + // CurrentState - READ-ONLY; The current state of the init container. + CurrentState *ContainerState `json:"currentState,omitempty"` + // PreviousState - READ-ONLY; The previous state of the init container. + PreviousState *ContainerState `json:"previousState,omitempty"` + // Events - READ-ONLY; The events of the init container. + Events *[]Event `json:"events,omitempty"` +} + // IPAddress IP address for the container group. type IPAddress struct { // Ports - The list of ports exposed on the container group. @@ -1006,6 +1419,143 @@ type OperationListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + // Port the port exposed on the container group. type Port struct { // Protocol - The protocol associated with the port. Possible values include: 'TCP', 'UDP' @@ -1083,7 +1633,7 @@ type Usage struct { // UsageListResult the response containing the usage data type UsageListResult struct { autorest.Response `json:"-"` - // Value - READ-ONLY + // Value - READ-ONLY; The usage data. Value *[]Usage `json:"value,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/operations.go similarity index 69% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/operations.go index bf77d6557908..837ad73a987a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/operations.go @@ -42,17 +42,18 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera } // List list the operations for Azure Container Instance service. -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } + result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "List", nil, "Failure preparing request") @@ -61,12 +62,12 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe resp, err := client.ListSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.olr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "List", resp, "Failure sending request") return } - result, err = client.ListResponder(resp) + result.olr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "List", resp, "Failure responding to request") } @@ -76,7 +77,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-10-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -106,3 +107,40 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Operat result.Response = autorest.Response{Response: resp} return } + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/version.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/version.go index 984b7cb959cc..02df9c676022 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " containerinstance/2018-10-01" + return "Azure-SDK-For-Go/" + Version() + " containerinstance/2019-12-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 68e28b06545f..ad5305eeac19 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -18,7 +18,7 @@ github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2019-04-15/cdn github.com/Azure/azure-sdk-for-go/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute -github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance +github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2018-09-01/containerregistry github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2020-04-01/documentdb