From d9f4c76f4abd414dc4d1108a383ec540a26733e6 Mon Sep 17 00:00:00 2001 From: Michael Guirao Date: Tue, 12 May 2020 13:47:41 +0200 Subject: [PATCH 1/2] update --- .../internal/services/iothub/client/client.go | 2 +- .../services/iothub/iothub_dps_resource.go | 2 +- .../iothub_endpoint_eventhub_resource.go | 2 +- ...thub_endpoint_servicebus_queue_resource.go | 2 +- ...thub_endpoint_servicebus_topic_resource.go | 2 +- ...hub_endpoint_storage_container_resource.go | 2 +- .../iothub/iothub_fallback_route_resource.go | 2 +- .../services/iothub/iothub_resource.go | 2 +- .../services/iothub/iothub_route_resource.go | 2 +- .../iothub_shared_access_policy_resource.go | 2 +- .../devices/certificates.go | 12 +- .../devices/client.go | 2 +- .../mgmt/2019-03-22-preview/devices/iothub.go | 127 ++++++++++++++++++ .../devices/iothubresource.go | 46 +++---- .../devices/models.go | 49 ++++++- .../devices/operations.go | 2 +- .../devices/resourceprovidercommon.go | 2 +- .../devices/version.go | 2 +- vendor/modules.txt | 2 +- 19 files changed, 215 insertions(+), 49 deletions(-) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/{2018-12-01-preview => 2019-03-22-preview}/devices/certificates.go (98%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/{2018-12-01-preview => 2019-03-22-preview}/devices/client.go (98%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/iothub.go rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/{2018-12-01-preview => 2019-03-22-preview}/devices/iothubresource.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/{2018-12-01-preview => 2019-03-22-preview}/devices/models.go (98%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/{2018-12-01-preview => 2019-03-22-preview}/devices/operations.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/{2018-12-01-preview => 2019-03-22-preview}/devices/resourceprovidercommon.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/{2018-12-01-preview => 2019-03-22-preview}/devices/version.go (93%) diff --git a/azurerm/internal/services/iothub/client/client.go b/azurerm/internal/services/iothub/client/client.go index 282521be3fb4..ce5ae154b27d 100644 --- a/azurerm/internal/services/iothub/client/client.go +++ b/azurerm/internal/services/iothub/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "github.com/Azure/azure-sdk-for-go/services/provisioningservices/mgmt/2018-01-22/iothub" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/iothub/iothub_dps_resource.go b/azurerm/internal/services/iothub/iothub_dps_resource.go index e8b60604cd32..697db89cfdd2 100644 --- a/azurerm/internal/services/iothub/iothub_dps_resource.go +++ b/azurerm/internal/services/iothub/iothub_dps_resource.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "github.com/Azure/azure-sdk-for-go/services/provisioningservices/mgmt/2018-01-22/iothub" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" diff --git a/azurerm/internal/services/iothub/iothub_endpoint_eventhub_resource.go b/azurerm/internal/services/iothub/iothub_endpoint_eventhub_resource.go index 4418204d86ac..dc0ba88ac9e2 100644 --- a/azurerm/internal/services/iothub/iothub_endpoint_eventhub_resource.go +++ b/azurerm/internal/services/iothub/iothub_endpoint_eventhub_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "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/iothub/iothub_endpoint_servicebus_queue_resource.go b/azurerm/internal/services/iothub/iothub_endpoint_servicebus_queue_resource.go index 9f63cf370392..d9aae7cebedd 100644 --- a/azurerm/internal/services/iothub/iothub_endpoint_servicebus_queue_resource.go +++ b/azurerm/internal/services/iothub/iothub_endpoint_servicebus_queue_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "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/iothub/iothub_endpoint_servicebus_topic_resource.go b/azurerm/internal/services/iothub/iothub_endpoint_servicebus_topic_resource.go index ecd2a8d750ba..b24d1f86d4de 100644 --- a/azurerm/internal/services/iothub/iothub_endpoint_servicebus_topic_resource.go +++ b/azurerm/internal/services/iothub/iothub_endpoint_servicebus_topic_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "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/iothub/iothub_endpoint_storage_container_resource.go b/azurerm/internal/services/iothub/iothub_endpoint_storage_container_resource.go index b25ab7f4c558..197cc5c22b7e 100644 --- a/azurerm/internal/services/iothub/iothub_endpoint_storage_container_resource.go +++ b/azurerm/internal/services/iothub/iothub_endpoint_storage_container_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" diff --git a/azurerm/internal/services/iothub/iothub_fallback_route_resource.go b/azurerm/internal/services/iothub/iothub_fallback_route_resource.go index d40021cdece1..d2ec714e96b8 100644 --- a/azurerm/internal/services/iothub/iothub_fallback_route_resource.go +++ b/azurerm/internal/services/iothub/iothub_fallback_route_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "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/validate" diff --git a/azurerm/internal/services/iothub/iothub_resource.go b/azurerm/internal/services/iothub/iothub_resource.go index 585366b53ccb..1fe9ed38f4c7 100644 --- a/azurerm/internal/services/iothub/iothub_resource.go +++ b/azurerm/internal/services/iothub/iothub_resource.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" diff --git a/azurerm/internal/services/iothub/iothub_route_resource.go b/azurerm/internal/services/iothub/iothub_route_resource.go index 3d58a87d57a5..2262174361b3 100644 --- a/azurerm/internal/services/iothub/iothub_route_resource.go +++ b/azurerm/internal/services/iothub/iothub_route_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" diff --git a/azurerm/internal/services/iothub/iothub_shared_access_policy_resource.go b/azurerm/internal/services/iothub/iothub_shared_access_policy_resource.go index e3c69a0c613c..fe394e6196c4 100644 --- a/azurerm/internal/services/iothub/iothub_shared_access_policy_resource.go +++ b/azurerm/internal/services/iothub/iothub_shared_access_policy_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" + "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/certificates.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/certificates.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/certificates.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/certificates.go index b0bd8d409b5c..5baffe3f78eb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/certificates.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/certificates.go @@ -97,7 +97,7 @@ func (client CertificatesClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +188,7 @@ func (client CertificatesClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -274,7 +274,7 @@ func (client CertificatesClient) GenerateVerificationCodePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -359,7 +359,7 @@ func (client CertificatesClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -435,7 +435,7 @@ func (client CertificatesClient) ListByIotHubPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -522,7 +522,7 @@ func (client CertificatesClient) VerifyPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/client.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/client.go index 2b0ba4681f80..283637031c71 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/client.go @@ -1,4 +1,4 @@ -// Package devices implements the Azure ARM Devices service API version 2018-12-01-preview. +// Package devices implements the Azure ARM Devices service API version 2019-03-22-preview. // // Use this API to manage the IoT hubs in your Azure subscription. package devices diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/iothub.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/iothub.go new file mode 100644 index 000000000000..54bf19953b4f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/iothub.go @@ -0,0 +1,127 @@ +package devices + +// 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/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IotHubClient is the use this API to manage the IoT hubs in your Azure subscription. +type IotHubClient struct { + BaseClient +} + +// NewIotHubClient creates an instance of the IotHubClient client. +func NewIotHubClient(subscriptionID string) IotHubClient { + return NewIotHubClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIotHubClientWithBaseURI creates an instance of the IotHubClient 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 NewIotHubClientWithBaseURI(baseURI string, subscriptionID string) IotHubClient { + return IotHubClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ManualFailover perform manual fail over of given hub +// Parameters: +// iotHubName - iotHub to fail over +// failoverInput - region to failover to. Must be a azure DR pair +// resourceGroupName - resource group which Iot Hub belongs to +func (client IotHubClient) ManualFailover(ctx context.Context, iotHubName string, failoverInput FailoverInput, resourceGroupName string) (result IotHubManualFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubClient.ManualFailover") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.FailoverRegion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.IotHubClient", "ManualFailover", err.Error()) + } + + req, err := client.ManualFailoverPreparer(ctx, iotHubName, failoverInput, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubClient", "ManualFailover", nil, "Failure preparing request") + return + } + + result, err = client.ManualFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubClient", "ManualFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// ManualFailoverPreparer prepares the ManualFailover request. +func (client IotHubClient) ManualFailoverPreparer(ctx context.Context, iotHubName string, failoverInput FailoverInput, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotHubName": autorest.Encode("path", iotHubName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-03-22-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ManualFailoverSender sends the ManualFailover request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubClient) ManualFailoverSender(req *http.Request) (future IotHubManualFailoverFuture, 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 +} + +// ManualFailoverResponder handles the response to the ManualFailover request. The method always +// closes the http.Response Body. +func (client IotHubClient) ManualFailoverResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/iothubresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/iothubresource.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/iothubresource.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/iothubresource.go index 2751b363a5fb..a258ee19d50d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/iothubresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/iothubresource.go @@ -90,7 +90,7 @@ func (client IotHubResourceClient) CheckNameAvailabilityPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,7 +172,7 @@ func (client IotHubResourceClient) CreateEventHubConsumerGroupPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -277,7 +277,7 @@ func (client IotHubResourceClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -359,7 +359,7 @@ func (client IotHubResourceClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -445,7 +445,7 @@ func (client IotHubResourceClient) DeleteEventHubConsumerGroupPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -530,7 +530,7 @@ func (client IotHubResourceClient) ExportDevicesPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -608,7 +608,7 @@ func (client IotHubResourceClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -682,7 +682,7 @@ func (client IotHubResourceClient) GetEndpointHealthPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -799,7 +799,7 @@ func (client IotHubResourceClient) GetEventHubConsumerGroupPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -878,7 +878,7 @@ func (client IotHubResourceClient) GetJobPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -957,7 +957,7 @@ func (client IotHubResourceClient) GetKeysForKeyNamePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1034,7 +1034,7 @@ func (client IotHubResourceClient) GetQuotaMetricsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1147,7 +1147,7 @@ func (client IotHubResourceClient) GetStatsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1224,7 +1224,7 @@ func (client IotHubResourceClient) GetValidSkusPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1347,7 +1347,7 @@ func (client IotHubResourceClient) ImportDevicesPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1424,7 +1424,7 @@ func (client IotHubResourceClient) ListByResourceGroupPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1533,7 +1533,7 @@ func (client IotHubResourceClient) ListBySubscriptionPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1650,7 +1650,7 @@ func (client IotHubResourceClient) ListEventHubConsumerGroupsPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1765,7 +1765,7 @@ func (client IotHubResourceClient) ListJobsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1880,7 +1880,7 @@ func (client IotHubResourceClient) ListKeysPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1994,7 +1994,7 @@ func (client IotHubResourceClient) TestAllRoutesPreparer(ctx context.Context, in "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2087,7 +2087,7 @@ func (client IotHubResourceClient) TestRoutePreparer(ctx context.Context, input "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2160,7 +2160,7 @@ func (client IotHubResourceClient) UpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/models.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/models.go index d145f92a56af..23e4345ab2b4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/models.go @@ -29,7 +29,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices" // AccessRights enumerates the values for access rights. type AccessRights string @@ -583,6 +583,17 @@ func NewEndpointHealthDataListResultPage(getNextPage func(context.Context, Endpo return EndpointHealthDataListResultPage{fn: getNextPage} } +// EnrichmentProperties the properties of an enrichment that your IoT hub applies to messages delivered to +// endpoints. +type EnrichmentProperties struct { + // Key - The key or name for the enrichment property. + Key *string `json:"key,omitempty"` + // Value - The value for the enrichment property. + Value *string `json:"value,omitempty"` + // EndpointNames - The list of endpoints for which the enrichment is applied to the message. + EndpointNames *[]string `json:"endpointNames,omitempty"` +} + // ErrorDetails error details. type ErrorDetails struct { // Code - READ-ONLY; The error code. @@ -789,6 +800,12 @@ type ExportDevicesRequest struct { ExcludeKeys *bool `json:"excludeKeys,omitempty"` } +// FailoverInput use to provide failover region when requesting manual Failover for a hub. +type FailoverInput struct { + // FailoverRegion - Region the hub will be failed over to + FailoverRegion *string `json:"failoverRegion,omitempty"` +} + // FallbackRouteProperties the properties of the fallback route. IoT Hub uses these properties when it // routes messages to the fallback endpoint. type FallbackRouteProperties struct { @@ -1030,6 +1047,29 @@ type IotHubLocationDescription struct { Role IotHubReplicaRoleType `json:"role,omitempty"` } +// IotHubManualFailoverFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IotHubManualFailoverFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IotHubManualFailoverFuture) Result(client IotHubClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubManualFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("devices.IotHubManualFailoverFuture") + return + } + ar.Response = future.Response() + return +} + // IotHubNameAvailabilityInfo the properties indicating whether a given IoT hub name is available. type IotHubNameAvailabilityInfo struct { autorest.Response `json:"-"` @@ -1069,7 +1109,7 @@ type IotHubProperties struct { DeviceStreams *IotHubPropertiesDeviceStreams `json:"deviceStreams,omitempty"` // Features - The capabilities and features enabled for the IoT hub. Possible values include: 'None', 'DeviceManagement' Features Capabilities `json:"features,omitempty"` - // Locations - Primary and secondary location for iot hub + // Locations - READ-ONLY; Primary and secondary location for iot hub Locations *[]IotHubLocationDescription `json:"locations,omitempty"` } @@ -1109,9 +1149,6 @@ func (ihp IotHubProperties) MarshalJSON() ([]byte, error) { if ihp.Features != "" { objectMap["features"] = ihp.Features } - if ihp.Locations != nil { - objectMap["locations"] = ihp.Locations - } return json.Marshal(objectMap) } @@ -2044,6 +2081,8 @@ type RoutingProperties struct { Routes *[]RouteProperties `json:"routes,omitempty"` // FallbackRoute - The properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the built-in eventhub endpoint. FallbackRoute *FallbackRouteProperties `json:"fallbackRoute,omitempty"` + // Enrichments - The list of user-provided enrichments that the IoT hub applies to messages to be delivered to built-in and custom endpoints. See: https://aka.ms/iotmsgenrich + Enrichments *[]EnrichmentProperties `json:"enrichments,omitempty"` } // RoutingServiceBusQueueEndpointProperties the properties related to service bus queue endpoint types. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/operations.go index be9b87ae3897..94dfbf811342 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/operations.go @@ -77,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-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/resourceprovidercommon.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/resourceprovidercommon.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/resourceprovidercommon.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/resourceprovidercommon.go index 763192349649..dbad7f570d87 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/resourceprovidercommon.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/resourceprovidercommon.go @@ -81,7 +81,7 @@ func (client ResourceProviderCommonClient) GetSubscriptionQuotaPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-12-01-preview" + const APIVersion = "2019-03-22-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/version.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/version.go index 39ec68069ce7..43e7aa0be520 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/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 + " devices/2018-12-01-preview" + return "Azure-SDK-For-Go/" + Version() + " devices/2019-03-22-preview" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index e6673de87518..52e98d8f5ce7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -59,7 +59,7 @@ github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2018-07-12/bo github.com/Azure/azure-sdk-for-go/services/preview/customproviders/mgmt/2018-09-01-preview/customproviders github.com/Azure/azure-sdk-for-go/services/preview/eventgrid/mgmt/2020-04-01-preview/eventgrid github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight -github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2018-12-01-preview/devices +github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices github.com/Azure/azure-sdk-for-go/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2019-06-01/insights From f130a21bb8fc8bf7c52a1cceac4999abc9aaaad1 Mon Sep 17 00:00:00 2001 From: Michael Guirao Date: Tue, 12 May 2020 15:00:36 +0200 Subject: [PATCH 2/2] align on versin 41.2 of SDK --- .../preview/iothub/mgmt/2019-03-22-preview/devices/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/version.go index 43e7aa0be520..5d1ff15181c5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-03-22-preview/devices/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() + " devices/2019-03-22-preview" + return "Azure-SDK-For-Go/" + version.Number + " devices/2019-03-22-preview" } // Version returns the semantic version (see http://semver.org) of the client.