From 26d634f2a111a2b98281ad4b940696a9d3362bf2 Mon Sep 17 00:00:00 2001 From: njucz <740360112@qq.com> Date: Mon, 2 Mar 2020 11:10:14 +0800 Subject: [PATCH 1/6] Support for 'public_ips' in the network_configuration block of azurerm_batch_pool --- azurerm/helpers/azure/batch_account.go | 2 +- azurerm/helpers/azure/batch_pool.go | 15 +- .../internal/services/batch/client/client.go | 2 +- .../batch/data_source_batch_account.go | 2 +- .../batch/resource_arm_batch_account.go | 2 +- .../batch/resource_arm_batch_application.go | 2 +- .../batch/resource_arm_batch_certificate.go | 2 +- .../services/batch/resource_arm_batch_pool.go | 10 +- .../tests/resource_arm_batch_pool_test.go | 9 +- .../batch/account.go | 18 +-- .../batch/application.go | 10 +- .../batch/applicationpackage.go | 17 ++- .../batch/certificate.go | 12 +- .../batch/client.go | 2 +- .../batch/location.go | 4 +- .../batch/models.go | 136 +++++++++++++++--- .../batch/operations.go | 2 +- .../{2018-12-01 => 2019-08-01}/batch/pool.go | 14 +- .../batch/version.go | 2 +- vendor/modules.txt | 2 +- 20 files changed, 199 insertions(+), 66 deletions(-) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/account.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/application.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/applicationpackage.go (97%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/certificate.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/client.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/location.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/models.go (91%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/operations.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/pool.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/{2018-12-01 => 2019-08-01}/batch/version.go (94%) diff --git a/azurerm/helpers/azure/batch_account.go b/azurerm/helpers/azure/batch_account.go index 464792a9ecc2..305b4bac0339 100644 --- a/azurerm/helpers/azure/batch_account.go +++ b/azurerm/helpers/azure/batch_account.go @@ -3,7 +3,7 @@ package azure import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" ) // ExpandBatchAccountKeyVaultReference expands Batch account KeyVault reference diff --git a/azurerm/helpers/azure/batch_pool.go b/azurerm/helpers/azure/batch_pool.go index 8d2afe3fbeb8..f5204723bb1c 100644 --- a/azurerm/helpers/azure/batch_pool.go +++ b/azurerm/helpers/azure/batch_pool.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -571,6 +571,15 @@ func ExpandBatchPoolNetworkConfiguration(list []interface{}) (*batch.NetworkConf } } + if v, ok := networkConfigValue["public_ips"]; ok { + confPublicIPs := v.([]interface{}) + publicIPs := make([]string, 0, len(confPublicIPs)) + for _, publicIP := range confPublicIPs { + publicIPs = append(publicIPs, publicIP.(string)) + } + networkConfiguration.PublicIPs = &publicIPs + } + if v, ok := networkConfigValue["endpoint_configuration"]; ok { endpoint, err := ExpandBatchPoolEndpointConfiguration(v.([]interface{})) if err != nil { @@ -661,6 +670,10 @@ func FlattenBatchPoolNetworkConfiguration(networkConfig *batch.NetworkConfigurat result["subnet_id"] = *networkConfig.SubnetID } + if networkConfig.PublicIPs != nil { + result["public_ips"] = *networkConfig.PublicIPs + } + if cfg := networkConfig.EndpointConfiguration; cfg != nil && cfg.InboundNatPools != nil && len(*cfg.InboundNatPools) != 0 { endpointConfigs := make([]interface{}, len(*cfg.InboundNatPools)) diff --git a/azurerm/internal/services/batch/client/client.go b/azurerm/internal/services/batch/client/client.go index e666035ad408..b808313522d9 100644 --- a/azurerm/internal/services/batch/client/client.go +++ b/azurerm/internal/services/batch/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/batch/data_source_batch_account.go b/azurerm/internal/services/batch/data_source_batch_account.go index c922f05c048d..b9e2acc7901d 100644 --- a/azurerm/internal/services/batch/data_source_batch_account.go +++ b/azurerm/internal/services/batch/data_source_batch_account.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/batch/resource_arm_batch_account.go b/azurerm/internal/services/batch/resource_arm_batch_account.go index 7dabca921739..9f7499867a90 100644 --- a/azurerm/internal/services/batch/resource_arm_batch_account.go +++ b/azurerm/internal/services/batch/resource_arm_batch_account.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" diff --git a/azurerm/internal/services/batch/resource_arm_batch_application.go b/azurerm/internal/services/batch/resource_arm_batch_application.go index f3ed35ab734b..ca09a25f7ad6 100644 --- a/azurerm/internal/services/batch/resource_arm_batch_application.go +++ b/azurerm/internal/services/batch/resource_arm_batch_application.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/batch/resource_arm_batch_certificate.go b/azurerm/internal/services/batch/resource_arm_batch_certificate.go index 0851ad1a0ca2..b7bc8433f4f7 100644 --- a/azurerm/internal/services/batch/resource_arm_batch_certificate.go +++ b/azurerm/internal/services/batch/resource_arm_batch_certificate.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" diff --git a/azurerm/internal/services/batch/resource_arm_batch_pool.go b/azurerm/internal/services/batch/resource_arm_batch_pool.go index 8ea488b72a5c..78d13b858220 100644 --- a/azurerm/internal/services/batch/resource_arm_batch_pool.go +++ b/azurerm/internal/services/batch/resource_arm_batch_pool.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -397,6 +397,14 @@ func resourceArmBatchPool() *schema.Resource { ForceNew: true, ValidateFunc: validation.StringIsNotEmpty, }, + "public_ips": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "endpoint_configuration": { Type: schema.TypeList, Optional: true, diff --git a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go b/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go index e8a8572c94c5..b5832db20161 100644 --- a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go +++ b/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go @@ -1242,6 +1242,13 @@ resource "azurerm_subnet" "test" { address_prefix = "10.0.2.0/24" } +resource "azurerm_public_ip" "test" { + name = "acctestpublicip-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" +} + resource "azurerm_batch_account" "test" { name = "testaccbatch%s" resource_group_name = "${azurerm_resource_group.test.name}" @@ -1283,5 +1290,5 @@ resource "azurerm_batch_pool" "test" { } } } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomString) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomString, data.RandomString) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/account.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/account.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/account.go index e64ef0921785..f565ba8f7ecb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/account.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/account.go @@ -102,7 +102,7 @@ func (client AccountClient) CreatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -189,7 +189,7 @@ func (client AccountClient) DeletePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -279,7 +279,7 @@ func (client AccountClient) GetPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -366,7 +366,7 @@ func (client AccountClient) GetKeysPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -439,7 +439,7 @@ func (client AccountClient) ListPreparer(ctx context.Context) (*http.Request, er "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -552,7 +552,7 @@ func (client AccountClient) ListByResourceGroupPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -675,7 +675,7 @@ func (client AccountClient) RegenerateKeyPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -763,7 +763,7 @@ func (client AccountClient) SynchronizeAutoStorageKeysPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -848,7 +848,7 @@ func (client AccountClient) UpdatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/application.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/application.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/application.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/application.go index 6273fbf6e5fc..7f1d2bf3e27b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/application.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/application.go @@ -100,7 +100,7 @@ func (client ApplicationClient) CreatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -196,7 +196,7 @@ func (client ApplicationClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -286,7 +286,7 @@ func (client ApplicationClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -373,7 +373,7 @@ func (client ApplicationClient) ListPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -505,7 +505,7 @@ func (client ApplicationClient) UpdatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/applicationpackage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/applicationpackage.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/applicationpackage.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/applicationpackage.go index c793f7002c1c..b4611bcdad58 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/applicationpackage.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/applicationpackage.go @@ -41,7 +41,8 @@ func NewApplicationPackageClientWithBaseURI(baseURI string, subscriptionID strin return ApplicationPackageClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Activate activates the specified application package. +// Activate activates the specified application package. This should be done after the `ApplicationPackage` was created +// and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks // Parameters: // resourceGroupName - the name of the resource group that contains the Batch account. // accountName - the name of the Batch account. @@ -108,7 +109,7 @@ func (client ApplicationPackageClient) ActivatePreparer(ctx context.Context, res "versionName": autorest.Encode("path", versionName), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -143,7 +144,9 @@ func (client ApplicationPackageClient) ActivateResponder(resp *http.Response) (r return } -// Create creates an application package record. +// Create creates an application package record. The record contains the SAS where the package should be uploaded to. +// Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be +// used. // Parameters: // resourceGroupName - the name of the resource group that contains the Batch account. // accountName - the name of the Batch account. @@ -208,7 +211,7 @@ func (client ApplicationPackageClient) CreatePreparer(ctx context.Context, resou "versionName": autorest.Encode("path", versionName), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -310,7 +313,7 @@ func (client ApplicationPackageClient) DeletePreparer(ctx context.Context, resou "versionName": autorest.Encode("path", versionName), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -406,7 +409,7 @@ func (client ApplicationPackageClient) GetPreparer(ctx context.Context, resource "versionName": autorest.Encode("path", versionName), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -499,7 +502,7 @@ func (client ApplicationPackageClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/certificate.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/certificate.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/certificate.go index 73a8a1489c7a..c3ae0c699876 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/certificate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/certificate.go @@ -104,7 +104,7 @@ func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -198,7 +198,7 @@ func (client CertificateClient) CreatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -300,7 +300,7 @@ func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -397,7 +397,7 @@ func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -488,7 +488,7 @@ func (client CertificateClient) ListByBatchAccountPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -629,7 +629,7 @@ func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/client.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/client.go index 90fd26ca233d..ce20ef8148f4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/client.go @@ -1,4 +1,4 @@ -// Package batch implements the Azure ARM Batch service API version 2018-12-01. +// Package batch implements the Azure ARM Batch service API version 2019-08-01. // // package batch diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/location.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/location.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/location.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/location.go index 25f3a0d546ff..16a584ad4fd0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/location.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/location.go @@ -91,7 +91,7 @@ func (client LocationClient) CheckNameAvailabilityPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -168,7 +168,7 @@ func (client LocationClient) GetQuotasPreparer(ctx context.Context, locationName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/models.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/models.go index 325a7bf441fc..d89a2826763c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/models.go @@ -29,7 +29,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch" // AccountKeyType enumerates the values for account key type. type AccountKeyType string @@ -159,7 +159,8 @@ const ( // remotely access the node. CertificateVisibilityRemoteUser CertificateVisibility = "RemoteUser" // CertificateVisibilityStartTask The certificate should be visible to the user account under which the - // start task is run. + // start task is run. Note that if AutoUser Scope is Pool for both the StartTask and a Task, this + // certificate will be visible to the Task as well. CertificateVisibilityStartTask CertificateVisibility = "StartTask" // CertificateVisibilityTask The certificate should be visible to the user accounts under which job tasks // are run. @@ -210,6 +211,23 @@ func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType { return []ComputeNodeFillType{Pack, Spread} } +// ContainerWorkingDirectory enumerates the values for container working directory. +type ContainerWorkingDirectory string + +const ( + // ContainerImageDefault Using container image defined working directory. Beware that this directory will + // not contain the resource files downloaded by Batch. + ContainerImageDefault ContainerWorkingDirectory = "ContainerImageDefault" + // TaskWorkingDirectory Use the standard Batch service task working directory, which will contain the Task + // resource files populated by Batch. + TaskWorkingDirectory ContainerWorkingDirectory = "TaskWorkingDirectory" +) + +// PossibleContainerWorkingDirectoryValues returns an array of possible values for the ContainerWorkingDirectory const type. +func PossibleContainerWorkingDirectoryValues() []ContainerWorkingDirectory { + return []ContainerWorkingDirectory{ContainerImageDefault, TaskWorkingDirectory} +} + // ElevationLevel enumerates the values for elevation level. type ElevationLevel string @@ -781,10 +799,14 @@ type AccountProperties struct { KeyVaultReference *KeyVaultReference `json:"keyVaultReference,omitempty"` // AutoStorage - READ-ONLY AutoStorage *AutoStorageProperties `json:"autoStorage,omitempty"` - // DedicatedCoreQuota - READ-ONLY + // DedicatedCoreQuota - READ-ONLY; For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. DedicatedCoreQuota *int32 `json:"dedicatedCoreQuota,omitempty"` - // LowPriorityCoreQuota - READ-ONLY + // LowPriorityCoreQuota - READ-ONLY; For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. LowPriorityCoreQuota *int32 `json:"lowPriorityCoreQuota,omitempty"` + // DedicatedCoreQuotaPerVMFamily - READ-ONLY; A list of the dedicated core quota per Virtual Machine family for the Batch account. For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. + DedicatedCoreQuotaPerVMFamily *[]VirtualMachineFamilyCoreQuota `json:"dedicatedCoreQuotaPerVMFamily,omitempty"` + // DedicatedCoreQuotaPerVMFamilyEnforced - READ-ONLY; Batch is transitioning its core quota system for dedicated cores to be enforced per Virtual Machine family. During this transitional phase, the dedicated core quota per Virtual Machine family may not yet be enforced. If this flag is false, dedicated core quota is enforced via the old dedicatedCoreQuota property on the account and does not consider Virtual Machine family. If this flag is true, dedicated core quota is enforced via the dedicatedCoreQuotaPerVMFamily property on the account, and the old dedicatedCoreQuota does not apply. + DedicatedCoreQuotaPerVMFamilyEnforced *bool `json:"dedicatedCoreQuotaPerVMFamilyEnforced,omitempty"` // PoolQuota - READ-ONLY PoolQuota *int32 `json:"poolQuota,omitempty"` // ActiveJobAndJobScheduleQuota - READ-ONLY @@ -1102,12 +1124,38 @@ type AutoStorageProperties struct { // AutoUserSpecification ... type AutoUserSpecification struct { - // Scope - The default value is task. Possible values include: 'AutoUserScopeTask', 'AutoUserScopePool' + // Scope - The default value is Pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by start tasks. Possible values include: 'AutoUserScopeTask', 'AutoUserScopePool' Scope AutoUserScope `json:"scope,omitempty"` - // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' + // ElevationLevel - The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` } +// AzureBlobFileSystemConfiguration ... +type AzureBlobFileSystemConfiguration struct { + AccountName *string `json:"accountName,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + // AccountKey - This property is mutually exclusive with sasKey and one must be specified. + AccountKey *string `json:"accountKey,omitempty"` + // SasKey - This property is mutually exclusive with accountKey and one must be specified. + SasKey *string `json:"sasKey,omitempty"` + // BlobfuseOptions - These are 'net use' options in Windows and 'mount' options in Linux. + BlobfuseOptions *string `json:"blobfuseOptions,omitempty"` + // RelativeMountPath - All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + RelativeMountPath *string `json:"relativeMountPath,omitempty"` +} + +// AzureFileShareConfiguration ... +type AzureFileShareConfiguration struct { + AccountName *string `json:"accountName,omitempty"` + // AzureFileURL - This is of the form 'https://{account}.file.core.windows.net/'. + AzureFileURL *string `json:"azureFileUrl,omitempty"` + AccountKey *string `json:"accountKey,omitempty"` + // RelativeMountPath - All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + RelativeMountPath *string `json:"relativeMountPath,omitempty"` + // MountOptions - These are 'net use' options in Windows and 'mount' options in Linux. + MountOptions *string `json:"mountOptions,omitempty"` +} + // Certificate contains information about a certificate. type Certificate struct { autorest.Response `json:"-"` @@ -1402,6 +1450,17 @@ type CheckNameAvailabilityResult struct { Message *string `json:"message,omitempty"` } +// CIFSMountConfiguration ... +type CIFSMountConfiguration struct { + Username *string `json:"username,omitempty"` + Source *string `json:"source,omitempty"` + // RelativeMountPath - All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + RelativeMountPath *string `json:"relativeMountPath,omitempty"` + // MountOptions - These are 'net use' options in Windows and 'mount' options in Linux. + MountOptions *string `json:"mountOptions,omitempty"` + Password *string `json:"password,omitempty"` +} + // CloudError an error response from the Batch service. type CloudError struct { Error *CloudErrorBody `json:"error,omitempty"` @@ -1421,7 +1480,7 @@ type CloudErrorBody struct { // CloudServiceConfiguration ... type CloudServiceConfiguration struct { - // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). + // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. 6 - OS Family 6, equivalent to Windows Server 2019. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). OsFamily *string `json:"osFamily,omitempty"` // OsVersion - The default value is * which specifies the latest operating system version for the specified OS family. OsVersion *string `json:"osVersion,omitempty"` @@ -1444,8 +1503,8 @@ type ContainerRegistry struct { Password *string `json:"password,omitempty"` } -// DataDisk data Disk settings which will be used by the data disks associated to Compute Nodes in the -// pool. +// DataDisk settings which will be used by the data disks associated to Compute Nodes in the Pool. When +// using attached data disks, you need to mount and format the disks from within a VM to use them. type DataDisk struct { // Lun - The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. Lun *int32 `json:"lun,omitempty"` @@ -1506,11 +1565,11 @@ type ImageReference struct { Publisher *string `json:"publisher,omitempty"` // Offer - For example, UbuntuServer or WindowsServer. Offer *string `json:"offer,omitempty"` - // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter. + // Sku - For example, 18.04-LTS or 2019-Datacenter. Sku *string `json:"sku,omitempty"` // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. Version *string `json:"version,omitempty"` - // ID - This property is mutually exclusive with other properties. The virtual machine image must be in the same region and subscription as the Azure Batch account. For information about the firewall settings for Batch node agent to communicate with Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration . + // ID - This property is mutually exclusive with other properties. For Virtual Machine Image it must be in the same region and subscription as the Azure Batch account. For SIG image it must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. ID *string `json:"id,omitempty"` } @@ -2147,12 +2206,26 @@ type MetadataItem struct { Value *string `json:"value,omitempty"` } +// MountConfiguration ... +type MountConfiguration struct { + // AzureBlobFileSystemConfiguration - This property is mutually exclusive with all other properties. + AzureBlobFileSystemConfiguration *AzureBlobFileSystemConfiguration `json:"azureBlobFileSystemConfiguration,omitempty"` + // NfsMountConfiguration - This property is mutually exclusive with all other properties. + NfsMountConfiguration *NFSMountConfiguration `json:"nfsMountConfiguration,omitempty"` + // CifsMountConfiguration - This property is mutually exclusive with all other properties. + CifsMountConfiguration *CIFSMountConfiguration `json:"cifsMountConfiguration,omitempty"` + // AzureFileShareConfiguration - This property is mutually exclusive with all other properties. + AzureFileShareConfiguration *AzureFileShareConfiguration `json:"azureFileShareConfiguration,omitempty"` +} + // NetworkConfiguration the network configuration for a pool. type NetworkConfiguration struct { // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For pools created via virtualMachineConfiguration the Batch account must have poolAllocationMode userSubscription in order to use a VNet. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration SubnetID *string `json:"subnetId,omitempty"` // EndpointConfiguration - Pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property. EndpointConfiguration *PoolEndpointConfiguration `json:"endpointConfiguration,omitempty"` + // PublicIPs - The number of IPs specified here limits the maximum size of the Pool - 50 dedicated nodes or 20 low-priority nodes can be allocated for each public IP. For example, a pool needing 150 dedicated VMs would need at least 3 public IPs specified. Each element of this collection is of the form: /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + PublicIPs *[]string `json:"publicIPs,omitempty"` } // NetworkSecurityGroupRule ... @@ -2163,6 +2236,17 @@ type NetworkSecurityGroupRule struct { Access NetworkSecurityGroupRuleAccess `json:"access,omitempty"` // SourceAddressPrefix - Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + // SourcePortRanges - Valid values are '*' (for all ports 0 - 65535) or arrays of ports or port ranges (i.e. 100-200). The ports should in the range of 0 to 65535 and the port ranges or ports can't overlap. If any other values are provided the request fails with HTTP status code 400. Default value will be *. + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} + +// NFSMountConfiguration ... +type NFSMountConfiguration struct { + Source *string `json:"source,omitempty"` + // RelativeMountPath - All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + RelativeMountPath *string `json:"relativeMountPath,omitempty"` + // MountOptions - These are 'net use' options in Windows and 'mount' options in Linux. + MountOptions *string `json:"mountOptions,omitempty"` } // Operation ... @@ -2497,21 +2581,25 @@ type PoolProperties struct { // InterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. Possible values include: 'Enabled', 'Disabled' InterNodeCommunication InterNodeCommunicationState `json:"interNodeCommunication,omitempty"` NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` + // MaxTasksPerNode - The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. + MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` + // TaskSchedulingPolicy - If not specified, the default is spread. + TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` + UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. Metadata *[]MetadataItem `json:"metadata,omitempty"` // StartTask - In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool. StartTask *StartTask `json:"startTask,omitempty"` // Certificates - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Certificates *[]CertificateReference `json:"certificates,omitempty"` - // ApplicationPackages - Changes to application packages affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. + // ApplicationPackages - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. There is a maximum of 10 application package references on any given pool. ApplicationPackages *[]ApplicationPackageReference `json:"applicationPackages,omitempty"` // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"` // ResizeOperationStatus - READ-ONLY ResizeOperationStatus *ResizeOperationStatus `json:"resizeOperationStatus,omitempty"` + // MountConfiguration - This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. + MountConfiguration *[]MountConfiguration `json:"mountConfiguration,omitempty"` } // ProxyResource a definition of an Azure resource. @@ -2596,7 +2684,11 @@ type ScaleSettings struct { AutoScale *AutoScaleSettings `json:"autoScale,omitempty"` } -// StartTask ... +// StartTask in some cases the start task may be re-run even though the node was not rebooted. Due to this, +// start tasks should be idempotent and exit gracefully if the setup they're performing has already been +// done. Special care should be taken to avoid start tasks which create breakaway process or install/launch +// services from the start task working directory, as this will block Batch from being able to re-run the +// start task. type StartTask struct { // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. Required if any other properties of the startTask are specified. CommandLine *string `json:"commandLine,omitempty"` @@ -2606,7 +2698,7 @@ type StartTask struct { UserIdentity *UserIdentity `json:"userIdentity,omitempty"` // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` - // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. + // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is true. WaitForSuccess *bool `json:"waitForSuccess,omitempty"` // ContainerSettings - When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"` @@ -2620,6 +2712,8 @@ type TaskContainerSettings struct { ImageName *string `json:"imageName,omitempty"` // Registry - This setting can be omitted if was already provided at pool creation. Registry *ContainerRegistry `json:"registry,omitempty"` + // WorkingDirectory - Possible values include: 'TaskWorkingDirectory', 'ContainerImageDefault' + WorkingDirectory ContainerWorkingDirectory `json:"workingDirectory,omitempty"` } // TaskSchedulingPolicy ... @@ -2665,6 +2759,14 @@ type VirtualMachineConfiguration struct { ContainerConfiguration *ContainerConfiguration `json:"containerConfiguration,omitempty"` } +// VirtualMachineFamilyCoreQuota a VM Family and its associated core quota for the Batch account. +type VirtualMachineFamilyCoreQuota struct { + // Name - READ-ONLY; The Virtual Machine family name. + Name *string `json:"name,omitempty"` + // CoreQuota - READ-ONLY; The core quota for the VM family for the Batch account. + CoreQuota *int32 `json:"coreQuota,omitempty"` +} + // WindowsConfiguration ... type WindowsConfiguration struct { // EnableAutomaticUpdates - If omitted, the default value is true. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/operations.go index ba0cc0f1e666..ba276f32e2d2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/operations.go @@ -76,7 +76,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-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/pool.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/pool.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/pool.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/pool.go index 4344f2d77d05..9e960d28c858 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/pool.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/pool.go @@ -135,7 +135,7 @@ func (client PoolClient) CreatePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +236,7 @@ func (client PoolClient) DeletePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -332,7 +332,7 @@ func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -423,7 +423,7 @@ func (client PoolClient) GetPreparer(ctx context.Context, resourceGroupName stri "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -525,7 +525,7 @@ func (client PoolClient) ListByBatchAccountPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -666,7 +666,7 @@ func (client PoolClient) StopResizePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -761,7 +761,7 @@ func (client PoolClient) UpdatePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/version.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/version.go index 5c5c5f9133e7..38e5c092b142 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch/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.Number + " batch/2018-12-01" + return "Azure-SDK-For-Go/" + version.Number + " batch/2019-08-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index ef8827c62e16..a39b36a92b58 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -13,7 +13,7 @@ github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimana github.com/Azure/azure-sdk-for-go/services/appconfiguration/mgmt/2019-10-01/appconfiguration github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation -github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2018-12-01/batch +github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-08-01/batch github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-10-12/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-07-01/compute From 3bd937a32932065afb43ec11e6f4f2181488be85 Mon Sep 17 00:00:00 2001 From: njucz <740360112@qq.com> Date: Tue, 3 Mar 2020 17:21:37 +0800 Subject: [PATCH 2/6] update --- .../services/batch/resource_arm_batch_pool.go | 1 + .../batch/tests/resource_arm_batch_pool_test.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/azurerm/internal/services/batch/resource_arm_batch_pool.go b/azurerm/internal/services/batch/resource_arm_batch_pool.go index 78d13b858220..1b4e98936d0a 100644 --- a/azurerm/internal/services/batch/resource_arm_batch_pool.go +++ b/azurerm/internal/services/batch/resource_arm_batch_pool.go @@ -744,6 +744,7 @@ func resourceArmBatchPoolRead(d *schema.ResourceData, meta interface{}) error { if props := resp.PoolProperties; props != nil { d.Set("vm_size", props.VMSize) + d.Set("max_tasks_per_node", props.MaxTasksPerNode) if scaleSettings := props.ScaleSettings; scaleSettings != nil { if err := d.Set("auto_scale", azure.FlattenBatchPoolAutoScaleSettings(scaleSettings.AutoScale)); err != nil { diff --git a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go b/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go index b5832db20161..e1a07657c0d9 100644 --- a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go +++ b/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go @@ -392,6 +392,20 @@ func TestAccAzureRMBatchPool_frontEndPortRanges(t *testing.T) { Config: testaccAzureRMBatchPool_networkConfiguration(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMBatchPoolExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "vm_size", "STANDARD_A1"), + resource.TestCheckResourceAttr(data.ResourceName, "node_agent_sku_id", "batch.node.ubuntu 16.04"), + resource.TestCheckResourceAttr(data.ResourceName, "account_name", fmt.Sprintf("testaccbatch%s", data.RandomString)), + resource.TestCheckResourceAttr(data.ResourceName, "storage_image_reference.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "storage_image_reference.0.publisher", "Canonical"), + resource.TestCheckResourceAttr(data.ResourceName, "storage_image_reference.0.sku", "16.04.0-LTS"), + resource.TestCheckResourceAttr(data.ResourceName, "storage_image_reference.0.offer", "UbuntuServer"), + resource.TestCheckResourceAttr(data.ResourceName, "auto_scale.#", "0"), + resource.TestCheckResourceAttr(data.ResourceName, "fixed_scale.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "fixed_scale.0.target_dedicated_nodes", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "start_task.#", "0"), + resource.TestCheckResourceAttr(data.ResourceName, "network_configuration.#", "1"), + resource.TestCheckResourceAttrSet(data.ResourceName, "network_configuration.0.subnet_id"), + resource.TestCheckResourceAttr(data.ResourceName, "network_configuration.0.public_ips.#", "1"), ), }, data.ImportStep("stop_pending_resize_operation"), @@ -1247,6 +1261,8 @@ resource "azurerm_public_ip" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name allocation_method = "Static" + sku = "Standard" + domain_name_label = "acctest-publicip" } resource "azurerm_batch_account" "test" { From a61418a7315b82937fdf6b9768f775223d7cc5ab Mon Sep 17 00:00:00 2001 From: njucz <740360112@qq.com> Date: Tue, 3 Mar 2020 18:13:58 +0800 Subject: [PATCH 3/6] rebase and add doc --- website/docs/r/batch_pool.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/r/batch_pool.html.markdown b/website/docs/r/batch_pool.html.markdown index 795c68f5a0d6..9bf1d2bc7705 100644 --- a/website/docs/r/batch_pool.html.markdown +++ b/website/docs/r/batch_pool.html.markdown @@ -275,6 +275,8 @@ A `network_configuration` block supports the following: * `subnet_id` - (Optional) The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. Changing this forces a new resource to be created. +* `public_ips` - (Optional) A list of public ip ids that will be allocated to nodes + * `endpoint_configuration` - (Optional) A list of inbound NAT pools that can be used to address specific ports on an individual compute node externally. Set as documented in the inbound_nat_pools block below. Changing this forces a new resource to be created. --- From 884e19edcf6789d8707eea3a74266d446847947f Mon Sep 17 00:00:00 2001 From: njucz <740360112@qq.com> Date: Tue, 3 Mar 2020 18:17:48 +0800 Subject: [PATCH 4/6] update --- .../services/batch/tests/resource_arm_batch_pool_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go b/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go index e1a07657c0d9..98b05dfbd973 100644 --- a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go +++ b/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go @@ -1290,7 +1290,8 @@ resource "azurerm_batch_pool" "test" { } network_configuration { - subnet_id = "${azurerm_subnet.test.id}" + subnet_id = "${azurerm_subnet.test.id}" + public_ips = [azurerm_public_ip.test.id] endpoint_configuration { name = "SSH" From 24d02ab17dcf0030c1fe22e31f592a08cf2a8f63 Mon Sep 17 00:00:00 2001 From: njucz <740360112@qq.com> Date: Wed, 4 Mar 2020 11:42:06 +0800 Subject: [PATCH 5/6] update --- azurerm/helpers/azure/batch_pool.go | 10 +++------- .../internal/services/batch/resource_arm_batch_pool.go | 3 ++- .../batch/tests/resource_arm_batch_pool_test.go | 2 +- website/docs/r/batch_pool.html.markdown | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/azurerm/helpers/azure/batch_pool.go b/azurerm/helpers/azure/batch_pool.go index f5204723bb1c..7659f8037d5b 100644 --- a/azurerm/helpers/azure/batch_pool.go +++ b/azurerm/helpers/azure/batch_pool.go @@ -572,12 +572,8 @@ func ExpandBatchPoolNetworkConfiguration(list []interface{}) (*batch.NetworkConf } if v, ok := networkConfigValue["public_ips"]; ok { - confPublicIPs := v.([]interface{}) - publicIPs := make([]string, 0, len(confPublicIPs)) - for _, publicIP := range confPublicIPs { - publicIPs = append(publicIPs, publicIP.(string)) - } - networkConfiguration.PublicIPs = &publicIPs + publicIPsRaw := v.(*schema.Set).List() + networkConfiguration.PublicIPs = utils.ExpandStringSlice(publicIPsRaw) } if v, ok := networkConfigValue["endpoint_configuration"]; ok { @@ -671,7 +667,7 @@ func FlattenBatchPoolNetworkConfiguration(networkConfig *batch.NetworkConfigurat } if networkConfig.PublicIPs != nil { - result["public_ips"] = *networkConfig.PublicIPs + result["public_ips"] = schema.NewSet(schema.HashString, utils.FlattenStringSlice(networkConfig.PublicIPs)) } if cfg := networkConfig.EndpointConfiguration; cfg != nil && cfg.InboundNatPools != nil && len(*cfg.InboundNatPools) != 0 { diff --git a/azurerm/internal/services/batch/resource_arm_batch_pool.go b/azurerm/internal/services/batch/resource_arm_batch_pool.go index 1b4e98936d0a..ee0c127d36f3 100644 --- a/azurerm/internal/services/batch/resource_arm_batch_pool.go +++ b/azurerm/internal/services/batch/resource_arm_batch_pool.go @@ -398,12 +398,13 @@ func resourceArmBatchPool() *schema.Resource { ValidateFunc: validation.StringIsNotEmpty, }, "public_ips": { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, ForceNew: true, Elem: &schema.Schema{ Type: schema.TypeString, }, + Set: schema.HashString, }, "endpoint_configuration": { Type: schema.TypeList, diff --git a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go b/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go index 98b05dfbd973..69e93639185a 100644 --- a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go +++ b/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go @@ -1290,7 +1290,7 @@ resource "azurerm_batch_pool" "test" { } network_configuration { - subnet_id = "${azurerm_subnet.test.id}" + subnet_id = azurerm_subnet.test.id public_ips = [azurerm_public_ip.test.id] endpoint_configuration { diff --git a/website/docs/r/batch_pool.html.markdown b/website/docs/r/batch_pool.html.markdown index 9bf1d2bc7705..3a3258162e92 100644 --- a/website/docs/r/batch_pool.html.markdown +++ b/website/docs/r/batch_pool.html.markdown @@ -275,7 +275,7 @@ A `network_configuration` block supports the following: * `subnet_id` - (Optional) The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. Changing this forces a new resource to be created. -* `public_ips` - (Optional) A list of public ip ids that will be allocated to nodes +* `public_ips` - (Optional) A list of public ip ids that will be allocated to nodes. Changing this forces a new resource to be created. * `endpoint_configuration` - (Optional) A list of inbound NAT pools that can be used to address specific ports on an individual compute node externally. Set as documented in the inbound_nat_pools block below. Changing this forces a new resource to be created. From dbcd8ac2283832334726775588bbbedde1993300 Mon Sep 17 00:00:00 2001 From: njucz <740360112@qq.com> Date: Wed, 4 Mar 2020 11:53:27 +0800 Subject: [PATCH 6/6] update --- azurerm/internal/services/batch/resource_arm_batch_pool.go | 1 - 1 file changed, 1 deletion(-) diff --git a/azurerm/internal/services/batch/resource_arm_batch_pool.go b/azurerm/internal/services/batch/resource_arm_batch_pool.go index ee0c127d36f3..00eff49e470a 100644 --- a/azurerm/internal/services/batch/resource_arm_batch_pool.go +++ b/azurerm/internal/services/batch/resource_arm_batch_pool.go @@ -745,7 +745,6 @@ func resourceArmBatchPoolRead(d *schema.ResourceData, meta interface{}) error { if props := resp.PoolProperties; props != nil { d.Set("vm_size", props.VMSize) - d.Set("max_tasks_per_node", props.MaxTasksPerNode) if scaleSettings := props.ScaleSettings; scaleSettings != nil { if err := d.Set("auto_scale", azure.FlattenBatchPoolAutoScaleSettings(scaleSettings.AutoScale)); err != nil {