diff --git a/builder/azure/arm/authenticate_secret_test.go b/builder/azure/arm/authenticate_secret_test.go
index 532883b4f..ce8868ff5 100644
--- a/builder/azure/arm/authenticate_secret_test.go
+++ b/builder/azure/arm/authenticate_secret_test.go
@@ -22,14 +22,14 @@ func TestNewSecretOAuthTokenProvider(t *testing.T) {
if spn.Token().RefreshToken != "" {
t.Errorf("spn.Token().RefreshToken: expected=\"\", actual=%s", spn.Token().RefreshToken)
}
- if spn.Token().ExpiresIn != "" {
- t.Errorf("spn.Token().ExpiresIn: expected=\"\", actual=%s", spn.Token().ExpiresIn)
+ if spn.Token().ExpiresIn != "0" {
+ t.Errorf("spn.Token().ExpiresIn: expected=\"0\", actual=%s", spn.Token().ExpiresIn)
}
- if spn.Token().ExpiresOn != "" {
- t.Errorf("spn.Token().ExpiresOn: expected=\"\", actual=%s", spn.Token().ExpiresOn)
+ if spn.Token().ExpiresOn != "0" {
+ t.Errorf("spn.Token().ExpiresOn: expected=\"0\", actual=%s", spn.Token().ExpiresOn)
}
- if spn.Token().NotBefore != "" {
- t.Errorf("spn.Token().NotBefore: expected=\"\", actual=%s", spn.Token().NotBefore)
+ if spn.Token().NotBefore != "0" {
+ t.Errorf("spn.Token().NotBefore: expected=\"0\", actual=%s", spn.Token().NotBefore)
}
if spn.Token().Resource != "" {
t.Errorf("spn.Token().Resource: expected=\"\", actual=%s", spn.Token().Resource)
diff --git a/builder/azure/arm/builder.go b/builder/azure/arm/builder.go
index d5ea0d36a..b67f3bec9 100644
--- a/builder/azure/arm/builder.go
+++ b/builder/azure/arm/builder.go
@@ -126,7 +126,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
ui.Say(fmt.Sprintf("the managed image named %s already exists, but deleting it due to -force flag", b.config.ManagedImageName))
f, err := azureClient.ImagesClient.Delete(ctx, b.config.ManagedImageResourceGroupName, b.config.ManagedImageName)
if err == nil {
- err = f.WaitForCompletion(ctx, azureClient.ImagesClient.Client)
+ err = f.WaitForCompletionRef(ctx, azureClient.ImagesClient.Client)
}
if err != nil {
return nil, fmt.Errorf("failed to delete the managed image named %s : %s", b.config.ManagedImageName, azureClient.LastError.Error())
diff --git a/builder/azure/arm/step_capture_image.go b/builder/azure/arm/step_capture_image.go
index ab675116e..b2449ee57 100644
--- a/builder/azure/arm/step_capture_image.go
+++ b/builder/azure/arm/step_capture_image.go
@@ -54,7 +54,7 @@ func (s *StepCaptureImage) captureImageFromVM(ctx context.Context, resourceGroup
if err != nil {
s.say(s.client.LastError.Error())
}
- return f.WaitForCompletion(ctx, s.client.ImagesClient.Client)
+ return f.WaitForCompletionRef(ctx, s.client.ImagesClient.Client)
}
func (s *StepCaptureImage) captureImage(ctx context.Context, resourceGroupName string, computeName string, parameters *compute.VirtualMachineCaptureParameters) error {
@@ -62,7 +62,7 @@ func (s *StepCaptureImage) captureImage(ctx context.Context, resourceGroupName s
if err != nil {
s.say(s.client.LastError.Error())
}
- return f.WaitForCompletion(ctx, s.client.VirtualMachinesClient.Client)
+ return f.WaitForCompletionRef(ctx, s.client.VirtualMachinesClient.Client)
}
func (s *StepCaptureImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
diff --git a/builder/azure/arm/step_create_resource_group.go b/builder/azure/arm/step_create_resource_group.go
index f835933db..7308886b0 100644
--- a/builder/azure/arm/step_create_resource_group.go
+++ b/builder/azure/arm/step_create_resource_group.go
@@ -121,7 +121,7 @@ func (s *StepCreateResourceGroup) Cleanup(state multistep.StateBag) {
if state.Get(constants.ArmAsyncResourceGroupDelete).(bool) {
s.say(fmt.Sprintf("\n Not waiting for Resource Group delete as requested by user. Resource Group Name is %s", resourceGroupName))
} else {
- err = f.WaitForCompletion(ctx, s.client.GroupsClient.Client)
+ err = f.WaitForCompletionRef(ctx, s.client.GroupsClient.Client)
}
}
if err != nil {
diff --git a/builder/azure/arm/step_delete_additional_disks.go b/builder/azure/arm/step_delete_additional_disks.go
index 95b2edb4a..0c8b26b3a 100644
--- a/builder/azure/arm/step_delete_additional_disks.go
+++ b/builder/azure/arm/step_delete_additional_disks.go
@@ -48,7 +48,7 @@ func (s *StepDeleteAdditionalDisk) deleteManagedDisk(ctx context.Context, resour
diskName = xs[len(xs)-1]
f, err := s.client.DisksClient.Delete(ctx, resourceGroupName, diskName)
if err == nil {
- err = f.WaitForCompletion(ctx, s.client.DisksClient.Client)
+ err = f.WaitForCompletionRef(ctx, s.client.DisksClient.Client)
}
return err
}
diff --git a/builder/azure/arm/step_delete_os_disk.go b/builder/azure/arm/step_delete_os_disk.go
index ad525591b..0e96f5b7d 100644
--- a/builder/azure/arm/step_delete_os_disk.go
+++ b/builder/azure/arm/step_delete_os_disk.go
@@ -48,7 +48,7 @@ func (s *StepDeleteOSDisk) deleteManagedDisk(ctx context.Context, resourceGroupN
diskName := xs[len(xs)-1]
f, err := s.client.DisksClient.Delete(ctx, resourceGroupName, diskName)
if err == nil {
- err = f.WaitForCompletion(ctx, s.client.DisksClient.Client)
+ err = f.WaitForCompletionRef(ctx, s.client.DisksClient.Client)
}
return err
}
diff --git a/builder/azure/arm/step_delete_resource_group.go b/builder/azure/arm/step_delete_resource_group.go
index ec62870ae..ee8e2a08e 100644
--- a/builder/azure/arm/step_delete_resource_group.go
+++ b/builder/azure/arm/step_delete_resource_group.go
@@ -59,7 +59,7 @@ func (s *StepDeleteResourceGroup) deleteResourceGroup(ctx context.Context, state
// No need to wait for the complition for delete if request is Accepted
s.say(fmt.Sprintf("\nResource Group is being deleted, not waiting for deletion due to config. Resource Group Name '%s'", resourceGroupName))
} else {
- f.WaitForCompletion(ctx, s.client.GroupsClient.Client)
+ f.WaitForCompletionRef(ctx, s.client.GroupsClient.Client)
}
}
diff --git a/builder/azure/arm/step_deploy_template.go b/builder/azure/arm/step_deploy_template.go
index 83590afd7..c20e4630d 100644
--- a/builder/azure/arm/step_deploy_template.go
+++ b/builder/azure/arm/step_deploy_template.go
@@ -50,7 +50,7 @@ func (s *StepDeployTemplate) deployTemplate(ctx context.Context, resourceGroupNa
f, err := s.client.DeploymentsClient.CreateOrUpdate(ctx, resourceGroupName, deploymentName, *deployment)
if err == nil {
- err = f.WaitForCompletion(ctx, s.client.DeploymentsClient.Client)
+ err = f.WaitForCompletionRef(ctx, s.client.DeploymentsClient.Client)
}
if err != nil {
s.say(s.client.LastError.Error())
@@ -96,7 +96,7 @@ func deleteResource(ctx context.Context, client *AzureClient, resourceType strin
case "Microsoft.Compute/virtualMachines":
f, err := client.VirtualMachinesClient.Delete(ctx, resourceGroupName, resourceName)
if err == nil {
- err = f.WaitForCompletion(ctx, client.VirtualMachinesClient.Client)
+ err = f.WaitForCompletionRef(ctx, client.VirtualMachinesClient.Client)
}
return err
case "Microsoft.KeyVault/vaults":
@@ -106,19 +106,19 @@ func deleteResource(ctx context.Context, client *AzureClient, resourceType strin
case "Microsoft.Network/networkInterfaces":
f, err := client.InterfacesClient.Delete(ctx, resourceGroupName, resourceName)
if err == nil {
- err = f.WaitForCompletion(ctx, client.InterfacesClient.Client)
+ err = f.WaitForCompletionRef(ctx, client.InterfacesClient.Client)
}
return err
case "Microsoft.Network/virtualNetworks":
f, err := client.VirtualNetworksClient.Delete(ctx, resourceGroupName, resourceName)
if err == nil {
- err = f.WaitForCompletion(ctx, client.VirtualNetworksClient.Client)
+ err = f.WaitForCompletionRef(ctx, client.VirtualNetworksClient.Client)
}
return err
case "Microsoft.Network/publicIPAddresses":
f, err := client.PublicIPAddressesClient.Delete(ctx, resourceGroupName, resourceName)
if err == nil {
- err = f.WaitForCompletion(ctx, client.PublicIPAddressesClient.Client)
+ err = f.WaitForCompletionRef(ctx, client.PublicIPAddressesClient.Client)
}
return err
}
@@ -132,7 +132,7 @@ func (s *StepDeployTemplate) deleteImage(ctx context.Context, imageType string,
diskName := xs[len(xs)-1]
f, err := s.client.DisksClient.Delete(ctx, resourceGroupName, diskName)
if err == nil {
- err = f.WaitForCompletion(ctx, s.client.DisksClient.Client)
+ err = f.WaitForCompletionRef(ctx, s.client.DisksClient.Client)
}
return err
}
diff --git a/builder/azure/arm/step_power_off_compute.go b/builder/azure/arm/step_power_off_compute.go
index 4f03adefd..86f51935b 100644
--- a/builder/azure/arm/step_power_off_compute.go
+++ b/builder/azure/arm/step_power_off_compute.go
@@ -30,7 +30,7 @@ func NewStepPowerOffCompute(client *AzureClient, ui packer.Ui) *StepPowerOffComp
func (s *StepPowerOffCompute) powerOffCompute(ctx context.Context, resourceGroupName string, computeName string) error {
f, err := s.client.VirtualMachinesClient.Deallocate(ctx, resourceGroupName, computeName)
if err == nil {
- err = f.WaitForCompletion(ctx, s.client.VirtualMachinesClient.Client)
+ err = f.WaitForCompletionRef(ctx, s.client.VirtualMachinesClient.Client)
}
if err != nil {
s.say(s.client.LastError.Error())
diff --git a/builder/azure/arm/step_snapshot_data_disks.go b/builder/azure/arm/step_snapshot_data_disks.go
index f0f476d5e..dba6f7634 100644
--- a/builder/azure/arm/step_snapshot_data_disks.go
+++ b/builder/azure/arm/step_snapshot_data_disks.go
@@ -52,7 +52,7 @@ func (s *StepSnapshotDataDisks) createDataDiskSnapshot(ctx context.Context, reso
return err
}
- err = f.WaitForCompletion(ctx, s.client.SnapshotsClient.Client)
+ err = f.WaitForCompletionRef(ctx, s.client.SnapshotsClient.Client)
if err != nil {
s.say(s.client.LastError.Error())
diff --git a/builder/azure/arm/step_snapshot_os_disk.go b/builder/azure/arm/step_snapshot_os_disk.go
index 614b1a5cd..28fc844a9 100644
--- a/builder/azure/arm/step_snapshot_os_disk.go
+++ b/builder/azure/arm/step_snapshot_os_disk.go
@@ -51,7 +51,7 @@ func (s *StepSnapshotOSDisk) createSnapshot(ctx context.Context, resourceGroupNa
return err
}
- err = f.WaitForCompletion(ctx, s.client.SnapshotsClient.Client)
+ err = f.WaitForCompletionRef(ctx, s.client.SnapshotsClient.Client)
if err != nil {
s.say(s.client.LastError.Error())
diff --git a/builder/azure/common/vault.go b/builder/azure/common/vault.go
index ab54ee493..1bda604a2 100644
--- a/builder/azure/common/vault.go
+++ b/builder/azure/common/vault.go
@@ -137,7 +137,7 @@ func (client *VaultClient) DeletePreparer(resourceGroupName string, vaultName st
func (client *VaultClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
- azure.DoPollForAsynchronous(client.PollingDelay))
+ azure.DoRetryWithRegistration(client.Client))
}
// DeleteResponder handles the response to the Delete request. The method always
diff --git a/go.mod b/go.mod
index bd5319b08..74e6a706d 100644
--- a/go.mod
+++ b/go.mod
@@ -1,10 +1,10 @@
module github.com/hashicorp/packer
require (
+ contrib.go.opencensus.io/exporter/ocagent v0.5.0 // indirect
github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1
- github.com/Azure/azure-sdk-for-go v27.3.0+incompatible
- github.com/Azure/go-autorest v10.12.0+incompatible
- github.com/Azure/go-autorest/tracing v0.1.0 // indirect
+ github.com/Azure/azure-sdk-for-go v30.0.0+incompatible
+ github.com/Azure/go-autorest v12.0.0+incompatible
github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 // indirect
github.com/ChrisTrenkamp/goxpath v0.0.0-20170625215350-4fe035839290
github.com/NaverCloudPlatform/ncloud-sdk-go v0.0.0-20180110055012-c2e73f942591
@@ -15,6 +15,7 @@ require (
github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd // indirect
github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607 // indirect
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6 // indirect
+ github.com/apache/thrift v0.12.0 // indirect
github.com/approvals/go-approval-tests v0.0.0-20160714161514-ad96e53bea43
github.com/armon/go-radix v1.0.0 // indirect
github.com/aws/aws-sdk-go v1.16.24
@@ -80,6 +81,7 @@ require (
github.com/mitchellh/panicwrap v0.0.0-20170106182340-fce601fe5557
github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784
github.com/mitchellh/reflectwalk v1.0.0
+ github.com/mna/pigeon v1.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/moul/anonuuid v0.0.0-20160222162117-609b752a95ef // indirect
@@ -87,6 +89,7 @@ require (
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 // indirect
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b
+ github.com/openzipkin/zipkin-go v0.1.6 // indirect
github.com/oracle/oci-go-sdk v1.8.0
github.com/packer-community/winrmcp v0.0.0-20180921204643-0fd363d6159a
github.com/pierrec/lz4 v2.0.5+incompatible
@@ -94,6 +97,7 @@ require (
github.com/pkg/sftp v0.0.0-20160118190721-e84cc8c755ca
github.com/posener/complete v1.1.1
github.com/profitbricks/profitbricks-sdk-go v4.0.2+incompatible
+ github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 // indirect
github.com/renstrom/fuzzysearch v0.0.0-20160331204855-2d205ac6ec17 // indirect
github.com/rwtodd/Go.Sed v0.0.0-20170507045331-d6d5d585814e
github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735 // indirect
@@ -115,8 +119,9 @@ require (
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20190425145619-16072639606e
golang.org/x/text v0.3.1 // indirect
- google.golang.org/api v0.3.1
- google.golang.org/grpc v1.19.1
+ golang.org/x/tools v0.0.0-20190530184349-ce1a3806b557 // indirect
+ google.golang.org/api v0.4.0
+ google.golang.org/grpc v1.20.1
gopkg.in/h2non/gock.v1 v1.0.12 // indirect
gopkg.in/ini.v1 v1.42.0 // indirect
gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516 // indirect
diff --git a/go.sum b/go.sum
index 1ad98b4e9..a844f081d 100644
--- a/go.sum
+++ b/go.sum
@@ -5,6 +5,8 @@ cloud.google.com/go v0.36.0 h1:+aCSj7tOo2LODWVEuZDZeGCckdt6MlSF+X/rB3wUiS8=
cloud.google.com/go v0.36.0/go.mod h1:RUoy9p/M4ge0HzT8L+SDZ8jg+Q6fth0CiBuhFJpSV40=
contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc=
contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA=
+contrib.go.opencensus.io/exporter/ocagent v0.5.0 h1:TKXjQSRS0/cCDrP7KvkgU6SmILtF/yV2TOs/02K/WZQ=
+contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0=
dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU=
dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU=
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
@@ -14,8 +16,12 @@ github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1 h1:RMTyvS5bjvSWiUcfqfr/E2px
github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1/go.mod h1:61apmbkVJH4kg+38ftT+/l0XxdUCVnHggqcOTqZRSEE=
github.com/Azure/azure-sdk-for-go v27.3.0+incompatible h1:i+ROfG3CsZUPoVAnhK06T3R6PmBzKB9ds+lHBpN7Mzo=
github.com/Azure/azure-sdk-for-go v27.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
+github.com/Azure/azure-sdk-for-go v30.0.0+incompatible h1:6o1Yzl7wTBYg+xw0pY4qnalaPmEQolubEEdepo1/kmI=
+github.com/Azure/azure-sdk-for-go v30.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-autorest v10.12.0+incompatible h1:6YphwUK+oXbzvCc1fd5VrnxCekwzDkpA7gUEbci2MvI=
github.com/Azure/go-autorest v10.12.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
+github.com/Azure/go-autorest v12.0.0+incompatible h1:N+VqClcomLGD/sHb3smbSYYtNMgKpVV3Cd5r5i8z6bQ=
+github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/tracing v0.1.0 h1:TRBxC5Pj/fIuh4Qob0ZpkggbfT8RC0SubHbpV3p4/Vc=
github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88=
github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 h1:pSm8mp0T2OH2CPmPDPtwHPr3VAQaOwVF/JbllOPP4xA=
@@ -291,6 +297,8 @@ github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 h1:+DAetXqxv/
github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo=
github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY=
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
+github.com/mna/pigeon v1.0.0 h1:n46IoStjdzjaXuyBH53j9HZ8CVqGWpC7P5/v8dP4qEY=
+github.com/mna/pigeon v1.0.0/go.mod h1:Iym28+kJVnC1hfQvv5MUtI6AiFFzvQjHcvI4RFTG/04=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
@@ -414,9 +422,12 @@ github.com/yandex-cloud/go-sdk v0.0.0-20190402114215-3fc1d6947035 h1:2ZLZeg6xp+k
github.com/yandex-cloud/go-sdk v0.0.0-20190402114215-3fc1d6947035/go.mod h1:Eml0jFLU4VVHgIN8zPHMuNwZXVzUMILyO6lQZSfz854=
go.opencensus.io v0.18.0 h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
+go.opencensus.io v0.20.1 h1:pMEjRZ1M4ebWGikflH7nQpV6+Zr88KBMA2XJD3sbijw=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk=
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
+go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
+go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -432,6 +443,7 @@ golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTk
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -498,13 +510,18 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190530184349-ce1a3806b557 h1:WFdP1eIY3AwGUPgVua5UIX4C7BzCIK8TOwm6RA+0vAQ=
+golang.org/x/tools v0.0.0-20190530184349-ce1a3806b557/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.1.0 h1:K6z2u68e86TPdSdefXdzvXgR1zEMa+459vBSfWYAZkI=
google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
+google.golang.org/api v0.4.0 h1:KKgc1aqhV8wDPbDzlDtpvyjZFY3vjz85FP7p4wcQUyI=
+google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -525,6 +542,8 @@ google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM=
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU=
+google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go
index 3a9beda43..b08d663c4 100644
--- a/vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go
@@ -18,15 +18,27 @@ import (
"math/rand"
"sync/atomic"
"time"
+ "unsafe"
)
-const (
- sDisconnected int32 = 5 + iota
- sConnected
-)
+func (ae *Exporter) lastConnectError() error {
+ errPtr := (*error)(atomic.LoadPointer(&ae.lastConnectErrPtr))
+ if errPtr == nil {
+ return nil
+ }
+ return *errPtr
+}
-func (ae *Exporter) setStateDisconnected() {
- atomic.StoreInt32(&ae.connectionState, sDisconnected)
+func (ae *Exporter) saveLastConnectError(err error) {
+ var errPtr *error
+ if err != nil {
+ errPtr = &err
+ }
+ atomic.StorePointer(&ae.lastConnectErrPtr, unsafe.Pointer(errPtr))
+}
+
+func (ae *Exporter) setStateDisconnected(err error) {
+ ae.saveLastConnectError(err)
select {
case ae.disconnectedCh <- true:
default:
@@ -34,11 +46,11 @@ func (ae *Exporter) setStateDisconnected() {
}
func (ae *Exporter) setStateConnected() {
- atomic.StoreInt32(&ae.connectionState, sConnected)
+ ae.saveLastConnectError(nil)
}
func (ae *Exporter) connected() bool {
- return atomic.LoadInt32(&ae.connectionState) == sConnected
+ return ae.lastConnectError() == nil
}
const defaultConnReattemptPeriod = 10 * time.Second
@@ -77,14 +89,18 @@ func (ae *Exporter) indefiniteBackgroundConnection() error {
if err := ae.connect(); err == nil {
ae.setStateConnected()
} else {
- ae.setStateDisconnected()
+ ae.setStateDisconnected(err)
}
// Apply some jitter to avoid lockstep retrials of other
// agent-exporters. Lockstep retrials could result in an
// innocent DDOS, by clogging the machine's resources and network.
jitter := time.Duration(rng.Int63n(maxJitter))
- <-time.After(connReattemptPeriod + jitter)
+ select {
+ case <-ae.stopCh:
+ return errStopped
+ case <-time.After(connReattemptPeriod + jitter):
+ }
}
}
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/go.mod b/vendor/contrib.go.opencensus.io/exporter/ocagent/go.mod
index 72a9068e4..00db1613b 100644
--- a/vendor/contrib.go.opencensus.io/exporter/ocagent/go.mod
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/go.mod
@@ -4,7 +4,7 @@ require (
github.com/census-instrumentation/opencensus-proto v0.2.0 // this is to match the version used in census-instrumentation/opencensus-service
github.com/golang/protobuf v1.3.1
github.com/grpc-ecosystem/grpc-gateway v1.8.5 // indirect
- go.opencensus.io v0.20.2
- google.golang.org/api v0.3.1
- google.golang.org/grpc v1.19.1
+ go.opencensus.io v0.21.0
+ google.golang.org/api v0.4.0
+ google.golang.org/grpc v1.20.1
)
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/go.sum b/vendor/contrib.go.opencensus.io/exporter/ocagent/go.sum
index 52c362aaa..c4faa0c27 100644
--- a/vendor/contrib.go.opencensus.io/exporter/ocagent/go.sum
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/go.sum
@@ -1,26 +1,10 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
-github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
-github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
-github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
-github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
-github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
@@ -28,60 +12,28 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
-github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/grpc-ecosystem/grpc-gateway v1.8.5 h1:2+KSC78XiO6Qy0hIjfc1OD9H+hsaJdJlb8Kqsd41CTE=
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
-github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
-github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
-github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
-github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
-github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
-go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk=
-go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
+go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -94,37 +46,26 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8=
-google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
+google.golang.org/api v0.4.0 h1:KKgc1aqhV8wDPbDzlDtpvyjZFY3vjz85FP7p4wcQUyI=
+google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM=
-google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU=
+google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
-gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
-gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go
index 510da99ea..b3a1388d0 100644
--- a/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go
@@ -18,8 +18,10 @@ import (
"context"
"errors"
"fmt"
+ "io"
"sync"
"time"
+ "unsafe"
"google.golang.org/api/support/bundler"
"google.golang.org/grpc"
@@ -52,12 +54,12 @@ var _ trace.Exporter = (*Exporter)(nil)
var _ view.Exporter = (*Exporter)(nil)
type Exporter struct {
- connectionState int32
-
// mu protects the non-atomic and non-channel variables
mu sync.RWMutex
- // senderMu protects the concurrent unsafe traceExporter client
- senderMu sync.RWMutex
+ // senderMu protects the concurrent unsafe send on traceExporter client
+ senderMu sync.Mutex
+ // recvMu protects the concurrent unsafe recv on traceExporter client
+ recvMu sync.Mutex
started bool
stopped bool
agentAddress string
@@ -71,6 +73,7 @@ type Exporter struct {
resource *resourcepb.Resource
compressor string
headers map[string]string
+ lastConnectErrPtr unsafe.Pointer
startOnce sync.Once
stopCh chan bool
@@ -86,6 +89,8 @@ type Exporter struct {
viewDataBundler *bundler.Bundler
clientTransportCredentials credentials.TransportCredentials
+
+ grpcDialOptions []grpc.DialOption
}
func NewExporter(opts ...ExporterOption) (*Exporter, error) {
@@ -134,7 +139,6 @@ var (
errAlreadyStarted = errors.New("already started")
errNotStarted = errors.New("not started")
errStopped = errors.New("stopped")
- errNoConnection = errors.New("no active connection")
)
// Start dials to the agent, establishing a connection to it. It also
@@ -146,14 +150,20 @@ func (ae *Exporter) Start() error {
var err = errAlreadyStarted
ae.startOnce.Do(func() {
ae.mu.Lock()
- defer ae.mu.Unlock()
-
ae.started = true
ae.disconnectedCh = make(chan bool, 1)
ae.stopCh = make(chan bool)
ae.backgroundConnectionDoneCh = make(chan bool)
+ ae.mu.Unlock()
- ae.setStateDisconnected()
+ // An optimistic first connection attempt to ensure that
+ // applications under heavy load can immediately process
+ // data. See https://github.com/census-ecosystem/opencensus-go-exporter-ocagent/pull/63
+ if err := ae.connect(); err == nil {
+ ae.setStateConnected()
+ } else {
+ ae.setStateDisconnected(err)
+ }
go ae.indefiniteBackgroundConnection()
err = nil
@@ -270,6 +280,9 @@ func (ae *Exporter) dialToAgent() (*grpc.ClientConn, error) {
dialOpts = append(dialOpts, grpc.WithDefaultCallOptions(grpc.UseCompressor(ae.compressor)))
}
dialOpts = append(dialOpts, grpc.WithStatsHandler(&ocgrpc.ClientHandler{}))
+ if len(ae.grpcDialOptions) != 0 {
+ dialOpts = append(dialOpts, ae.grpcDialOptions...)
+ }
ctx := context.Background()
if len(ae.headers) > 0 {
@@ -368,16 +381,33 @@ func (ae *Exporter) ExportTraceServiceRequest(batch *agenttracepb.ExportTraceSer
return errStopped
default:
- if !ae.connected() {
- return errNoConnection
+ if lastConnectErr := ae.lastConnectError(); lastConnectErr != nil {
+ return fmt.Errorf("ExportTraceServiceRequest: no active connection, last connection error: %v", lastConnectErr)
}
ae.senderMu.Lock()
err := ae.traceExporter.Send(batch)
ae.senderMu.Unlock()
if err != nil {
- ae.setStateDisconnected()
- return err
+ if err == io.EOF {
+ ae.recvMu.Lock()
+ // Perform a .Recv to try to find out why the RPC actually ended.
+ // See:
+ // * https://github.com/grpc/grpc-go/blob/d389f9fac68eea0dcc49957d0b4cca5b3a0a7171/stream.go#L98-L100
+ // * https://groups.google.com/forum/#!msg/grpc-io/XcN4hA9HonI/F_UDiejTAwAJ
+ for {
+ _, err = ae.traceExporter.Recv()
+ if err != nil {
+ break
+ }
+ }
+ ae.recvMu.Unlock()
+ }
+
+ ae.setStateDisconnected(err)
+ if err != io.EOF {
+ return err
+ }
}
return nil
}
@@ -423,7 +453,7 @@ func (ae *Exporter) uploadTraces(sdl []*trace.SpanData) {
})
ae.senderMu.Unlock()
if err != nil {
- ae.setStateDisconnected()
+ ae.setStateDisconnected(err)
}
}
}
@@ -467,7 +497,7 @@ func (ae *Exporter) uploadViewData(vdl []*view.Data) {
// or better letting users of the exporter configure it.
})
if err != nil {
- ae.setStateDisconnected()
+ ae.setStateDisconnected(err)
}
}
}
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go
index 3e05ae8b3..edeae65e1 100644
--- a/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go
@@ -17,6 +17,7 @@ package ocagent
import (
"time"
+ "google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)
@@ -126,3 +127,18 @@ func WithTLSCredentials(creds credentials.TransportCredentials) ExporterOption {
func (cc *clientCredentials) withExporter(e *Exporter) {
e.clientTransportCredentials = cc.TransportCredentials
}
+
+type grpcDialOptions []grpc.DialOption
+
+var _ ExporterOption = (*grpcDialOptions)(nil)
+
+// WithGRPCDialOption opens support to any grpc.DialOption to be used. If it conflicts
+// with some other configuration the GRPC specified via the agent the ones here will
+// take preference since they are set last.
+func WithGRPCDialOption(opts ...grpc.DialOption) ExporterOption {
+ return grpcDialOptions(opts)
+}
+
+func (opts grpcDialOptions) withExporter(e *Exporter) {
+ e.grpcDialOptions = opts
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/disks.go
index 3a1b735d7..64bbe0fac 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/disks.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/disks.go
@@ -108,6 +108,7 @@ func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr
"api-version": APIVersion,
}
+ disk.ManagedBy = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/models.go
index 1e2f65035..8d5759ac3 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/models.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/models.go
@@ -818,7 +818,7 @@ func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes {
// AccessURI a disk access SAS uri.
type AccessURI struct {
autorest.Response `json:"-"`
- // AccessSAS - A SAS uri for accessing a disk.
+ // AccessSAS - READ-ONLY; A SAS uri for accessing a disk.
AccessSAS *string `json:"accessSAS,omitempty"`
}
@@ -887,11 +887,11 @@ type AvailabilitySet struct {
*AvailabilitySetProperties `json:"properties,omitempty"`
// Sku - Sku of the availability set
Sku *Sku `json:"sku,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -908,15 +908,6 @@ func (as AvailabilitySet) MarshalJSON() ([]byte, error) {
if as.Sku != nil {
objectMap["sku"] = as.Sku
}
- if as.ID != nil {
- objectMap["id"] = as.ID
- }
- if as.Name != nil {
- objectMap["name"] = as.Name
- }
- if as.Type != nil {
- objectMap["type"] = as.Type
- }
if as.Location != nil {
objectMap["location"] = as.Location
}
@@ -1160,7 +1151,7 @@ type AvailabilitySetProperties struct {
VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"`
// ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to.
Minimum api-version: 2018-04-01.
ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"`
- // Statuses - The resource status information.
+ // Statuses - READ-ONLY; The resource status information.
Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
}
@@ -1243,11 +1234,11 @@ type BootDiagnostics struct {
// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics.
type BootDiagnosticsInstanceView struct {
- // ConsoleScreenshotBlobURI - The console screenshot blob URI.
+ // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI.
ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"`
- // SerialConsoleLogBlobURI - The Linux serial console log blob Uri.
+ // SerialConsoleLogBlobURI - READ-ONLY; The Linux serial console log blob Uri.
SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"`
- // Status - The boot diagnostics status information for the VM.
NOTE: It will be set only if there are errors encountered in enabling boot diagnostics.
+ // Status - READ-ONLY; The boot diagnostics status information for the VM.
NOTE: It will be set only if there are errors encountered in enabling boot diagnostics.
Status *InstanceViewStatus `json:"status,omitempty"`
}
@@ -1289,7 +1280,7 @@ type DataDisk struct {
// DataDiskImage contains the data disk images information.
type DataDiskImage struct {
- // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
+ // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
Lun *int32 `json:"lun,omitempty"`
}
@@ -1303,17 +1294,17 @@ type DiagnosticsProfile struct {
// Disk disk resource.
type Disk struct {
autorest.Response `json:"-"`
- // ManagedBy - A relative URI containing the ID of the VM that has the disk attached.
+ // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached.
ManagedBy *string `json:"managedBy,omitempty"`
Sku *DiskSku `json:"sku,omitempty"`
// Zones - The Logical zone list for Disk.
Zones *[]string `json:"zones,omitempty"`
*DiskProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -1324,9 +1315,6 @@ type Disk struct {
// MarshalJSON is the custom marshaler for Disk.
func (d Disk) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if d.ManagedBy != nil {
- objectMap["managedBy"] = d.ManagedBy
- }
if d.Sku != nil {
objectMap["sku"] = d.Sku
}
@@ -1336,15 +1324,6 @@ func (d Disk) MarshalJSON() ([]byte, error) {
if d.DiskProperties != nil {
objectMap["properties"] = d.DiskProperties
}
- if d.ID != nil {
- objectMap["id"] = d.ID
- }
- if d.Name != nil {
- objectMap["name"] = d.Name
- }
- if d.Type != nil {
- objectMap["type"] = d.Type
- }
if d.Location != nil {
objectMap["location"] = d.Location
}
@@ -1618,7 +1597,7 @@ func NewDiskListPage(getNextPage func(context.Context, DiskList) (DiskList, erro
// DiskProperties disk resource properties.
type DiskProperties struct {
- // TimeCreated - The time when the disk was created.
+ // TimeCreated - READ-ONLY; The time when the disk was created.
TimeCreated *date.Time `json:"timeCreated,omitempty"`
// OsType - The Operating System type. Possible values include: 'Windows', 'Linux'
OsType OperatingSystemTypes `json:"osType,omitempty"`
@@ -1628,7 +1607,7 @@ type DiskProperties struct {
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
// EncryptionSettings - Encryption settings for disk or snapshot
EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"`
- // ProvisioningState - The disk provisioning state.
+ // ProvisioningState - READ-ONLY; The disk provisioning state.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -1642,7 +1621,7 @@ type DisksCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *DisksCreateOrUpdateFuture) Result(client DisksClient) (d Disk, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -1670,7 +1649,7 @@ type DisksDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *DisksDeleteFuture) Result(client DisksClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -1693,7 +1672,7 @@ type DisksGrantAccessFuture struct {
// If the operation has not completed it will return an error.
func (future *DisksGrantAccessFuture) Result(client DisksClient) (au AccessURI, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure")
return
@@ -1716,7 +1695,7 @@ func (future *DisksGrantAccessFuture) Result(client DisksClient) (au AccessURI,
type DiskSku struct {
// Name - The sku name. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS'
Name StorageAccountTypes `json:"name,omitempty"`
- // Tier - The sku tier.
+ // Tier - READ-ONLY; The sku tier.
Tier *string `json:"tier,omitempty"`
}
@@ -1730,7 +1709,7 @@ type DisksRevokeAccessFuture struct {
// If the operation has not completed it will return an error.
func (future *DisksRevokeAccessFuture) Result(client DisksClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure")
return
@@ -1752,7 +1731,7 @@ type DisksUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *DisksUpdateFuture) Result(client DisksClient) (d Disk, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -1876,11 +1855,11 @@ type HardwareProfile struct {
type Image struct {
autorest.Response `json:"-"`
*ImageProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -1894,15 +1873,6 @@ func (i Image) MarshalJSON() ([]byte, error) {
if i.ImageProperties != nil {
objectMap["properties"] = i.ImageProperties
}
- if i.ID != nil {
- objectMap["id"] = i.ID
- }
- if i.Name != nil {
- objectMap["name"] = i.Name
- }
- if i.Type != nil {
- objectMap["type"] = i.Type
- }
if i.Location != nil {
objectMap["location"] = i.Location
}
@@ -2179,7 +2149,7 @@ type ImageProperties struct {
SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"`
// StorageProfile - Specifies the storage settings for the virtual machine disks.
StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"`
- // ProvisioningState - The provisioning state.
+ // ProvisioningState - READ-ONLY; The provisioning state.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -2210,7 +2180,7 @@ type ImagesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *ImagesCreateOrUpdateFuture) Result(client ImagesClient) (i Image, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -2238,7 +2208,7 @@ type ImagesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *ImagesDeleteFuture) Result(client ImagesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -2270,7 +2240,7 @@ type ImagesUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *ImagesUpdateFuture) Result(client ImagesClient) (i Image, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -2576,7 +2546,7 @@ type LogAnalyticsExportRequestRateByIntervalFuture struct {
// If the operation has not completed it will return an error.
func (future *LogAnalyticsExportRequestRateByIntervalFuture) Result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure")
return
@@ -2605,7 +2575,7 @@ type LogAnalyticsExportThrottledRequestsFuture struct {
// If the operation has not completed it will return an error.
func (future *LogAnalyticsExportThrottledRequestsFuture) Result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure")
return
@@ -2643,13 +2613,13 @@ type LogAnalyticsInputBase struct {
// LogAnalyticsOperationResult logAnalytics operation status response
type LogAnalyticsOperationResult struct {
autorest.Response `json:"-"`
- // Properties - LogAnalyticsOutput
+ // Properties - READ-ONLY; LogAnalyticsOutput
Properties *LogAnalyticsOutput `json:"properties,omitempty"`
}
// LogAnalyticsOutput logAnalytics output properties
type LogAnalyticsOutput struct {
- // Output - Output file Uri path to blob container.
+ // Output - READ-ONLY; Output file Uri path to blob container.
Output *string `json:"output,omitempty"`
}
@@ -2746,15 +2716,15 @@ type NetworkProfile struct {
// OperationListResult the List Compute Operation operation response.
type OperationListResult struct {
autorest.Response `json:"-"`
- // Value - The list of compute operations
+ // Value - READ-ONLY; The list of compute operations
Value *[]OperationValue `json:"value,omitempty"`
}
// OperationValue describes the properties of a Compute Operation value.
type OperationValue struct {
- // Origin - The origin of the compute operation.
+ // Origin - READ-ONLY; The origin of the compute operation.
Origin *string `json:"origin,omitempty"`
- // Name - The name of the compute operation.
+ // Name - READ-ONLY; The name of the compute operation.
Name *string `json:"name,omitempty"`
*OperationValueDisplay `json:"display,omitempty"`
}
@@ -2762,12 +2732,6 @@ type OperationValue struct {
// MarshalJSON is the custom marshaler for OperationValue.
func (ov OperationValue) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if ov.Origin != nil {
- objectMap["origin"] = ov.Origin
- }
- if ov.Name != nil {
- objectMap["name"] = ov.Name
- }
if ov.OperationValueDisplay != nil {
objectMap["display"] = ov.OperationValueDisplay
}
@@ -2818,13 +2782,13 @@ func (ov *OperationValue) UnmarshalJSON(body []byte) error {
// OperationValueDisplay describes the properties of a Compute Operation Value Display.
type OperationValueDisplay struct {
- // Operation - The display name of the compute operation.
+ // Operation - READ-ONLY; The display name of the compute operation.
Operation *string `json:"operation,omitempty"`
- // Resource - The display name of the resource the operation applies to.
+ // Resource - READ-ONLY; The display name of the resource the operation applies to.
Resource *string `json:"resource,omitempty"`
- // Description - The description of the operation.
+ // Description - READ-ONLY; The description of the operation.
Description *string `json:"description,omitempty"`
- // Provider - The resource provider for the operation.
+ // Provider - READ-ONLY; The resource provider for the operation.
Provider *string `json:"provider,omitempty"`
}
@@ -2899,11 +2863,11 @@ type ProximityPlacementGroup struct {
autorest.Response `json:"-"`
// ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group.
*ProximityPlacementGroupProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -2917,15 +2881,6 @@ func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) {
if ppg.ProximityPlacementGroupProperties != nil {
objectMap["properties"] = ppg.ProximityPlacementGroupProperties
}
- if ppg.ID != nil {
- objectMap["id"] = ppg.ID
- }
- if ppg.Name != nil {
- objectMap["name"] = ppg.Name
- }
- if ppg.Type != nil {
- objectMap["type"] = ppg.Type
- }
if ppg.Location != nil {
objectMap["location"] = ppg.Location
}
@@ -3155,11 +3110,11 @@ func NewProximityPlacementGroupListResultPage(getNextPage func(context.Context,
type ProximityPlacementGroupProperties struct {
// ProximityPlacementGroupType - Specifies the type of the proximity placement group.
Possible values are:
**Standard**
**Ultra**. Possible values include: 'Standard', 'Ultra'
ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"`
- // VirtualMachines - A list of references to all virtual machines in the proximity placement group.
+ // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group.
VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"`
- // VirtualMachineScaleSets - A list of references to all virtual machine scale sets in the proximity placement group.
+ // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group.
VirtualMachineScaleSets *[]SubResource `json:"virtualMachineScaleSets,omitempty"`
- // AvailabilitySets - A list of references to all availability sets in the proximity placement group.
+ // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group.
AvailabilitySets *[]SubResource `json:"availabilitySets,omitempty"`
}
@@ -3191,9 +3146,9 @@ type PurchasePlan struct {
// RecoveryWalkResponse response after calling a manual recovery walk
type RecoveryWalkResponse struct {
autorest.Response `json:"-"`
- // WalkPerformed - Whether the recovery walk was performed
+ // WalkPerformed - READ-ONLY; Whether the recovery walk was performed
WalkPerformed *bool `json:"walkPerformed,omitempty"`
- // NextPlatformUpdateDomain - The next update domain that needs to be walked. Null means walk spanning all update domains has been completed
+ // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed
NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"`
}
@@ -3217,11 +3172,11 @@ type RequestRateByIntervalInput struct {
// Resource the Resource model definition.
type Resource struct {
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -3232,15 +3187,6 @@ type Resource struct {
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if r.ID != nil {
- objectMap["id"] = r.ID
- }
- if r.Name != nil {
- objectMap["name"] = r.Name
- }
- if r.Type != nil {
- objectMap["type"] = r.Type
- }
if r.Location != nil {
objectMap["location"] = r.Location
}
@@ -3252,11 +3198,11 @@ func (r Resource) MarshalJSON() ([]byte, error) {
// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation.
type RollbackStatusInfo struct {
- // SuccessfullyRolledbackInstanceCount - The number of instances which have been successfully rolled back.
+ // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back.
SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"`
- // FailedRolledbackInstanceCount - The number of instances which failed to rollback.
+ // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback.
FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"`
- // RollbackError - Error details if OS rollback failed.
+ // RollbackError - READ-ONLY; Error details if OS rollback failed.
RollbackError *APIError `json:"rollbackError,omitempty"`
}
@@ -3275,25 +3221,25 @@ type RollingUpgradePolicy struct {
// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade
// state.
type RollingUpgradeProgressInfo struct {
- // SuccessfulInstanceCount - The number of instances that have been successfully upgraded.
+ // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded.
SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"`
- // FailedInstanceCount - The number of instances that have failed to be upgraded successfully.
+ // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully.
FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"`
- // InProgressInstanceCount - The number of instances that are currently being upgraded.
+ // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded.
InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"`
- // PendingInstanceCount - The number of instances that have not yet begun to be upgraded.
+ // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded.
PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"`
}
// RollingUpgradeRunningStatus information about the current running state of the overall upgrade.
type RollingUpgradeRunningStatus struct {
- // Code - Code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted'
+ // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted'
Code RollingUpgradeStatusCode `json:"code,omitempty"`
- // StartTime - Start time of the upgrade.
+ // StartTime - READ-ONLY; Start time of the upgrade.
StartTime *date.Time `json:"startTime,omitempty"`
- // LastAction - The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel'
+ // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel'
LastAction RollingUpgradeActionType `json:"lastAction,omitempty"`
- // LastActionTime - Last action time of the upgrade.
+ // LastActionTime - READ-ONLY; Last action time of the upgrade.
LastActionTime *date.Time `json:"lastActionTime,omitempty"`
}
@@ -3301,11 +3247,11 @@ type RollingUpgradeRunningStatus struct {
type RollingUpgradeStatusInfo struct {
autorest.Response `json:"-"`
*RollingUpgradeStatusInfoProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -3319,15 +3265,6 @@ func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) {
if rusi.RollingUpgradeStatusInfoProperties != nil {
objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties
}
- if rusi.ID != nil {
- objectMap["id"] = rusi.ID
- }
- if rusi.Name != nil {
- objectMap["name"] = rusi.Name
- }
- if rusi.Type != nil {
- objectMap["type"] = rusi.Type
- }
if rusi.Location != nil {
objectMap["location"] = rusi.Location
}
@@ -3408,13 +3345,13 @@ func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error {
// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade.
type RollingUpgradeStatusInfoProperties struct {
- // Policy - The rolling upgrade policies applied for this upgrade.
+ // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade.
Policy *RollingUpgradePolicy `json:"policy,omitempty"`
- // RunningStatus - Information about the current running state of the overall upgrade.
+ // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade.
RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"`
- // Progress - Information about the number of virtual machine instances in each upgrade state.
+ // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state.
Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"`
- // Error - Error details for this upgrade, if there are any.
+ // Error - READ-ONLY; Error details for this upgrade, if there are any.
Error *APIError `json:"error,omitempty"`
}
@@ -3647,15 +3584,15 @@ type Sku struct {
// Snapshot snapshot resource.
type Snapshot struct {
autorest.Response `json:"-"`
- // ManagedBy - Unused. Always Null.
+ // ManagedBy - READ-ONLY; Unused. Always Null.
ManagedBy *string `json:"managedBy,omitempty"`
Sku *SnapshotSku `json:"sku,omitempty"`
*DiskProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -3666,24 +3603,12 @@ type Snapshot struct {
// MarshalJSON is the custom marshaler for Snapshot.
func (s Snapshot) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if s.ManagedBy != nil {
- objectMap["managedBy"] = s.ManagedBy
- }
if s.Sku != nil {
objectMap["sku"] = s.Sku
}
if s.DiskProperties != nil {
objectMap["properties"] = s.DiskProperties
}
- if s.ID != nil {
- objectMap["id"] = s.ID
- }
- if s.Name != nil {
- objectMap["name"] = s.Name
- }
- if s.Type != nil {
- objectMap["type"] = s.Type
- }
if s.Location != nil {
objectMap["location"] = s.Location
}
@@ -3936,7 +3861,7 @@ type SnapshotsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *SnapshotsCreateOrUpdateFuture) Result(client SnapshotsClient) (s Snapshot, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -3965,7 +3890,7 @@ type SnapshotsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *SnapshotsDeleteFuture) Result(client SnapshotsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -3988,7 +3913,7 @@ type SnapshotsGrantAccessFuture struct {
// If the operation has not completed it will return an error.
func (future *SnapshotsGrantAccessFuture) Result(client SnapshotsClient) (au AccessURI, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure")
return
@@ -4011,7 +3936,7 @@ func (future *SnapshotsGrantAccessFuture) Result(client SnapshotsClient) (au Acc
type SnapshotSku struct {
// Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardZRS'
Name SnapshotStorageAccountTypes `json:"name,omitempty"`
- // Tier - The sku tier.
+ // Tier - READ-ONLY; The sku tier.
Tier *string `json:"tier,omitempty"`
}
@@ -4025,7 +3950,7 @@ type SnapshotsRevokeAccessFuture struct {
// If the operation has not completed it will return an error.
func (future *SnapshotsRevokeAccessFuture) Result(client SnapshotsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure")
return
@@ -4048,7 +3973,7 @@ type SnapshotsUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *SnapshotsUpdateFuture) Result(client SnapshotsClient) (s Snapshot, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -4172,7 +4097,7 @@ type SubResource struct {
// SubResourceReadOnly ...
type SubResourceReadOnly struct {
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
}
@@ -4209,38 +4134,38 @@ func (ur UpdateResource) MarshalJSON() ([]byte, error) {
// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response.
type UpgradeOperationHistoricalStatusInfo struct {
- // Properties - Information about the properties of the upgrade operation.
+ // Properties - READ-ONLY; Information about the properties of the upgrade operation.
Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
- // Location - Resource location
+ // Location - READ-ONLY; Resource location
Location *string `json:"location,omitempty"`
}
// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale
// Set.
type UpgradeOperationHistoricalStatusInfoProperties struct {
- // RunningStatus - Information about the overall status of the upgrade operation.
+ // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation.
RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"`
- // Progress - Counts of the VMs in each state.
+ // Progress - READ-ONLY; Counts of the VMs in each state.
Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"`
- // Error - Error Details for this upgrade if there are any.
+ // Error - READ-ONLY; Error Details for this upgrade if there are any.
Error *APIError `json:"error,omitempty"`
- // StartedBy - Invoker of the Upgrade Operation. Possible values include: 'Unknown', 'User', 'Platform'
+ // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'Unknown', 'User', 'Platform'
StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"`
- // TargetImageReference - Image Reference details
+ // TargetImageReference - READ-ONLY; Image Reference details
TargetImageReference *ImageReference `json:"targetImageReference,omitempty"`
- // RollbackInfo - Information about OS rollback if performed
+ // RollbackInfo - READ-ONLY; Information about OS rollback if performed
RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"`
}
// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade.
type UpgradeOperationHistoryStatus struct {
- // Code - Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted'
+ // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted'
Code UpgradeState `json:"code,omitempty"`
- // StartTime - Start time of the upgrade.
+ // StartTime - READ-ONLY; Start time of the upgrade.
StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - End time of the upgrade.
+ // EndTime - READ-ONLY; End time of the upgrade.
EndTime *date.Time `json:"endTime,omitempty"`
}
@@ -4305,17 +4230,17 @@ type VirtualMachine struct {
// Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
Plan *Plan `json:"plan,omitempty"`
*VirtualMachineProperties `json:"properties,omitempty"`
- // Resources - The virtual machine child extension resources.
+ // Resources - READ-ONLY; The virtual machine child extension resources.
Resources *[]VirtualMachineExtension `json:"resources,omitempty"`
// Identity - The identity of the virtual machine, if configured.
Identity *VirtualMachineIdentity `json:"identity,omitempty"`
// Zones - The virtual machine zones.
Zones *[]string `json:"zones,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -4332,24 +4257,12 @@ func (VM VirtualMachine) MarshalJSON() ([]byte, error) {
if VM.VirtualMachineProperties != nil {
objectMap["properties"] = VM.VirtualMachineProperties
}
- if VM.Resources != nil {
- objectMap["resources"] = VM.Resources
- }
if VM.Identity != nil {
objectMap["identity"] = VM.Identity
}
if VM.Zones != nil {
objectMap["zones"] = VM.Zones
}
- if VM.ID != nil {
- objectMap["id"] = VM.ID
- }
- if VM.Name != nil {
- objectMap["name"] = VM.Name
- }
- if VM.Type != nil {
- objectMap["type"] = VM.Type
- }
if VM.Location != nil {
objectMap["location"] = VM.Location
}
@@ -4487,13 +4400,13 @@ type VirtualMachineCaptureParameters struct {
// VirtualMachineCaptureResult output of virtual machine capture operation.
type VirtualMachineCaptureResult struct {
autorest.Response `json:"-"`
- // Schema - the schema of the captured virtual machine
+ // Schema - READ-ONLY; the schema of the captured virtual machine
Schema *string `json:"$schema,omitempty"`
- // ContentVersion - the version of the content
+ // ContentVersion - READ-ONLY; the version of the content
ContentVersion *string `json:"contentVersion,omitempty"`
- // Parameters - parameters of the captured virtual machine
+ // Parameters - READ-ONLY; parameters of the captured virtual machine
Parameters interface{} `json:"parameters,omitempty"`
- // Resources - a list of resource items of the captured virtual machine
+ // Resources - READ-ONLY; a list of resource items of the captured virtual machine
Resources *[]interface{} `json:"resources,omitempty"`
// ID - Resource Id
ID *string `json:"id,omitempty"`
@@ -4503,11 +4416,11 @@ type VirtualMachineCaptureResult struct {
type VirtualMachineExtension struct {
autorest.Response `json:"-"`
*VirtualMachineExtensionProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -4521,15 +4434,6 @@ func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) {
if vme.VirtualMachineExtensionProperties != nil {
objectMap["properties"] = vme.VirtualMachineExtensionProperties
}
- if vme.ID != nil {
- objectMap["id"] = vme.ID
- }
- if vme.Name != nil {
- objectMap["name"] = vme.Name
- }
- if vme.Type != nil {
- objectMap["type"] = vme.Type
- }
if vme.Location != nil {
objectMap["location"] = vme.Location
}
@@ -4622,11 +4526,11 @@ type VirtualMachineExtensionHandlerInstanceView struct {
type VirtualMachineExtensionImage struct {
autorest.Response `json:"-"`
*VirtualMachineExtensionImageProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -4640,15 +4544,6 @@ func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) {
if vmei.VirtualMachineExtensionImageProperties != nil {
objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties
}
- if vmei.ID != nil {
- objectMap["id"] = vmei.ID
- }
- if vmei.Name != nil {
- objectMap["name"] = vmei.Name
- }
- if vmei.Type != nil {
- objectMap["type"] = vmei.Type
- }
if vmei.Location != nil {
objectMap["location"] = vmei.Location
}
@@ -4771,7 +4666,7 @@ type VirtualMachineExtensionProperties struct {
Settings interface{} `json:"settings,omitempty"`
// ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
ProtectedSettings interface{} `json:"protectedSettings,omitempty"`
- // ProvisioningState - The provisioning state, which only appears in the response.
+ // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
ProvisioningState *string `json:"provisioningState,omitempty"`
// InstanceView - The virtual machine extension instance view.
InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"`
@@ -4787,7 +4682,7 @@ type VirtualMachineExtensionsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineExtensionsCreateOrUpdateFuture) Result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -4816,7 +4711,7 @@ type VirtualMachineExtensionsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineExtensionsDeleteFuture) Result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -4846,7 +4741,7 @@ type VirtualMachineExtensionsUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineExtensionsUpdateFuture) Result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -4937,15 +4832,15 @@ type VirtualMachineExtensionUpdateProperties struct {
// VirtualMachineHealthStatus the health status of the VM.
type VirtualMachineHealthStatus struct {
- // Status - The health status information for the VM.
+ // Status - READ-ONLY; The health status information for the VM.
Status *InstanceViewStatus `json:"status,omitempty"`
}
// VirtualMachineIdentity identity for the virtual machine.
type VirtualMachineIdentity struct {
- // PrincipalID - The principal id of virtual machine identity. This property will only be provided for a system assigned identity.
+ // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity.
PrincipalID *string `json:"principalId,omitempty"`
- // TenantID - The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity.
+ // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity.
TenantID *string `json:"tenantId,omitempty"`
// Type - The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone'
Type ResourceIdentityType `json:"type,omitempty"`
@@ -5276,13 +5171,13 @@ type VirtualMachineProperties struct {
AvailabilitySet *SubResource `json:"availabilitySet,omitempty"`
// ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to.
Minimum api-version: 2018-04-01.
ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"`
- // ProvisioningState - The provisioning state, which only appears in the response.
+ // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
ProvisioningState *string `json:"provisioningState,omitempty"`
- // InstanceView - The virtual machine instance view.
+ // InstanceView - READ-ONLY; The virtual machine instance view.
InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"`
// LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.
Possible values are:
Windows_Client
Windows_Server
If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.
For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
Minimum api-version: 2015-06-15
LicenseType *string `json:"licenseType,omitempty"`
- // VMID - Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands.
+ // VMID - READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands.
VMID *string `json:"vmId,omitempty"`
}
@@ -5298,11 +5193,11 @@ type VirtualMachineScaleSet struct {
Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"`
// Zones - The virtual machine scale set zones.
Zones *[]string `json:"zones,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -5328,15 +5223,6 @@ func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) {
if vmss.Zones != nil {
objectMap["zones"] = vmss.Zones
}
- if vmss.ID != nil {
- objectMap["id"] = vmss.ID
- }
- if vmss.Name != nil {
- objectMap["name"] = vmss.Name
- }
- if vmss.Type != nil {
- objectMap["type"] = vmss.Type
- }
if vmss.Location != nil {
objectMap["location"] = vmss.Location
}
@@ -5475,7 +5361,7 @@ type VirtualMachineScaleSetExtension struct {
// Name - The name of the extension.
Name *string `json:"name,omitempty"`
*VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
}
@@ -5488,9 +5374,6 @@ func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) {
if vmsse.VirtualMachineScaleSetExtensionProperties != nil {
objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties
}
- if vmsse.ID != nil {
- objectMap["id"] = vmsse.ID
- }
return json.Marshal(objectMap)
}
@@ -5706,7 +5589,7 @@ type VirtualMachineScaleSetExtensionProperties struct {
Settings interface{} `json:"settings,omitempty"`
// ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
ProtectedSettings interface{} `json:"protectedSettings,omitempty"`
- // ProvisioningState - The provisioning state, which only appears in the response.
+ // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -5720,7 +5603,7 @@ type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -5749,7 +5632,7 @@ type VirtualMachineScaleSetExtensionsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetExtensionsDeleteFuture) Result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -5764,9 +5647,9 @@ func (future *VirtualMachineScaleSetExtensionsDeleteFuture) Result(client Virtua
// VirtualMachineScaleSetIdentity identity for the virtual machine scale set.
type VirtualMachineScaleSetIdentity struct {
- // PrincipalID - The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity.
+ // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity.
PrincipalID *string `json:"principalId,omitempty"`
- // TenantID - The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity.
+ // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity.
TenantID *string `json:"tenantId,omitempty"`
// Type - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone'
Type ResourceIdentityType `json:"type,omitempty"`
@@ -5777,9 +5660,9 @@ type VirtualMachineScaleSetIdentity struct {
// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set.
type VirtualMachineScaleSetInstanceView struct {
autorest.Response `json:"-"`
- // VirtualMachine - The instance view status summary for the virtual machine scale set.
+ // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set.
VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"`
- // Extensions - The extensions information.
+ // Extensions - READ-ONLY; The extensions information.
Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"`
// Statuses - The resource status information.
Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
@@ -5788,7 +5671,7 @@ type VirtualMachineScaleSetInstanceView struct {
// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of
// a virtual machine scale set.
type VirtualMachineScaleSetInstanceViewStatusesSummary struct {
- // StatusesSummary - The extensions information.
+ // StatusesSummary - READ-ONLY; The extensions information.
StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"`
}
@@ -6627,11 +6510,11 @@ type VirtualMachineScaleSetProperties struct {
UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"`
// VirtualMachineProfile - The virtual machine profile.
VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"`
- // ProvisioningState - The provisioning state, which only appears in the response.
+ // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
ProvisioningState *string `json:"provisioningState,omitempty"`
// Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned.
Overprovision *bool `json:"overprovision,omitempty"`
- // UniqueID - Specifies the ID which uniquely identifies a Virtual Machine Scale Set.
+ // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set.
UniqueID *string `json:"uniqueId,omitempty"`
// SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines.
SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"`
@@ -6724,7 +6607,7 @@ type VirtualMachineScaleSetRollingUpgradesCancelFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) Result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure")
return
@@ -6747,7 +6630,7 @@ type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) Result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure")
return
@@ -6770,7 +6653,7 @@ type VirtualMachineScaleSetsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -6799,7 +6682,7 @@ type VirtualMachineScaleSetsDeallocateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsDeallocateFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure")
return
@@ -6822,7 +6705,7 @@ type VirtualMachineScaleSetsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsDeleteFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -6845,7 +6728,7 @@ type VirtualMachineScaleSetsDeleteInstancesFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsDeleteInstancesFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure")
return
@@ -6860,23 +6743,23 @@ func (future *VirtualMachineScaleSetsDeleteInstancesFuture) Result(client Virtua
// VirtualMachineScaleSetSku describes an available virtual machine scale set sku.
type VirtualMachineScaleSetSku struct {
- // ResourceType - The type of resource the sku applies to.
+ // ResourceType - READ-ONLY; The type of resource the sku applies to.
ResourceType *string `json:"resourceType,omitempty"`
- // Sku - The Sku.
+ // Sku - READ-ONLY; The Sku.
Sku *Sku `json:"sku,omitempty"`
- // Capacity - Specifies the number of virtual machines in the scale set.
+ // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set.
Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"`
}
// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku.
type VirtualMachineScaleSetSkuCapacity struct {
- // Minimum - The minimum capacity.
+ // Minimum - READ-ONLY; The minimum capacity.
Minimum *int64 `json:"minimum,omitempty"`
- // Maximum - The maximum capacity that can be set.
+ // Maximum - READ-ONLY; The maximum capacity that can be set.
Maximum *int64 `json:"maximum,omitempty"`
- // DefaultCapacity - The default capacity.
+ // DefaultCapacity - READ-ONLY; The default capacity.
DefaultCapacity *int64 `json:"defaultCapacity,omitempty"`
- // ScaleType - The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone'
+ // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone'
ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"`
}
@@ -6890,7 +6773,7 @@ type VirtualMachineScaleSetsPerformMaintenanceFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure")
return
@@ -6913,7 +6796,7 @@ type VirtualMachineScaleSetsPowerOffFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsPowerOffFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure")
return
@@ -6936,7 +6819,7 @@ type VirtualMachineScaleSetsRedeployFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsRedeployFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure")
return
@@ -6959,7 +6842,7 @@ type VirtualMachineScaleSetsReimageAllFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsReimageAllFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure")
return
@@ -6982,7 +6865,7 @@ type VirtualMachineScaleSetsReimageFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsReimageFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure")
return
@@ -7005,7 +6888,7 @@ type VirtualMachineScaleSetsRestartFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsRestartFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure")
return
@@ -7028,7 +6911,7 @@ type VirtualMachineScaleSetsStartFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsStartFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure")
return
@@ -7061,7 +6944,7 @@ type VirtualMachineScaleSetsUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsUpdateFuture) Result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -7090,7 +6973,7 @@ type VirtualMachineScaleSetsUpdateInstancesFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetsUpdateInstancesFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure")
return
@@ -7506,22 +7389,22 @@ type VirtualMachineScaleSetUpdateVMProfile struct {
// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine.
type VirtualMachineScaleSetVM struct {
autorest.Response `json:"-"`
- // InstanceID - The virtual machine instance ID.
+ // InstanceID - READ-ONLY; The virtual machine instance ID.
InstanceID *string `json:"instanceId,omitempty"`
- // Sku - The virtual machine SKU.
+ // Sku - READ-ONLY; The virtual machine SKU.
Sku *Sku `json:"sku,omitempty"`
*VirtualMachineScaleSetVMProperties `json:"properties,omitempty"`
// Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
Plan *Plan `json:"plan,omitempty"`
- // Resources - The virtual machine child extension resources.
+ // Resources - READ-ONLY; The virtual machine child extension resources.
Resources *[]VirtualMachineExtension `json:"resources,omitempty"`
- // Zones - The virtual machine zones.
+ // Zones - READ-ONLY; The virtual machine zones.
Zones *[]string `json:"zones,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -7532,33 +7415,12 @@ type VirtualMachineScaleSetVM struct {
// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM.
func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if vmssv.InstanceID != nil {
- objectMap["instanceId"] = vmssv.InstanceID
- }
- if vmssv.Sku != nil {
- objectMap["sku"] = vmssv.Sku
- }
if vmssv.VirtualMachineScaleSetVMProperties != nil {
objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties
}
if vmssv.Plan != nil {
objectMap["plan"] = vmssv.Plan
}
- if vmssv.Resources != nil {
- objectMap["resources"] = vmssv.Resources
- }
- if vmssv.Zones != nil {
- objectMap["zones"] = vmssv.Zones
- }
- if vmssv.ID != nil {
- objectMap["id"] = vmssv.ID
- }
- if vmssv.Name != nil {
- objectMap["name"] = vmssv.Name
- }
- if vmssv.Type != nil {
- objectMap["type"] = vmssv.Type
- }
if vmssv.Location != nil {
objectMap["location"] = vmssv.Location
}
@@ -7685,9 +7547,9 @@ func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error {
// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine
// scale set.
type VirtualMachineScaleSetVMExtensionsSummary struct {
- // Name - The extension name.
+ // Name - READ-ONLY; The extension name.
Name *string `json:"name,omitempty"`
- // StatusesSummary - The extensions information.
+ // StatusesSummary - READ-ONLY; The extensions information.
StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"`
}
@@ -7722,7 +7584,7 @@ type VirtualMachineScaleSetVMInstanceView struct {
Disks *[]DiskInstanceView `json:"disks,omitempty"`
// Extensions - The extensions information.
Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"`
- // VMHealth - The health status for the VM.
+ // VMHealth - READ-ONLY; The health status for the VM.
VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"`
// BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.
You can easily view the output of your console log.
Azure also enables you to see a screenshot of the VM from the hypervisor.
BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"`
@@ -7902,11 +7764,11 @@ type VirtualMachineScaleSetVMProfile struct {
// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual
// machine.
type VirtualMachineScaleSetVMProperties struct {
- // LatestModelApplied - Specifies whether the latest model has been applied to the virtual machine.
+ // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine.
LatestModelApplied *bool `json:"latestModelApplied,omitempty"`
- // VMID - Azure VM unique ID.
+ // VMID - READ-ONLY; Azure VM unique ID.
VMID *string `json:"vmId,omitempty"`
- // InstanceView - The virtual machine instance view.
+ // InstanceView - READ-ONLY; The virtual machine instance view.
InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"`
// HardwareProfile - Specifies the hardware settings for the virtual machine.
HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"`
@@ -7920,7 +7782,7 @@ type VirtualMachineScaleSetVMProperties struct {
DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
// AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set.
AvailabilitySet *SubResource `json:"availabilitySet,omitempty"`
- // ProvisioningState - The provisioning state, which only appears in the response.
+ // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
ProvisioningState *string `json:"provisioningState,omitempty"`
// LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.
Possible values are:
Windows_Client
Windows_Server
If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.
For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
Minimum api-version: 2015-06-15
LicenseType *string `json:"licenseType,omitempty"`
@@ -7936,7 +7798,7 @@ type VirtualMachineScaleSetVMsDeallocateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsDeallocateFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure")
return
@@ -7959,7 +7821,7 @@ type VirtualMachineScaleSetVMsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsDeleteFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -7982,7 +7844,7 @@ type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure")
return
@@ -8005,7 +7867,7 @@ type VirtualMachineScaleSetVMsPowerOffFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsPowerOffFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure")
return
@@ -8028,7 +7890,7 @@ type VirtualMachineScaleSetVMsRedeployFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsRedeployFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure")
return
@@ -8051,7 +7913,7 @@ type VirtualMachineScaleSetVMsReimageAllFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsReimageAllFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure")
return
@@ -8074,7 +7936,7 @@ type VirtualMachineScaleSetVMsReimageFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsReimageFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure")
return
@@ -8097,7 +7959,7 @@ type VirtualMachineScaleSetVMsRestartFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsRestartFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure")
return
@@ -8120,7 +7982,7 @@ type VirtualMachineScaleSetVMsRunCommandFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsRunCommandFuture) Result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure")
return
@@ -8149,7 +8011,7 @@ type VirtualMachineScaleSetVMsStartFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsStartFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure")
return
@@ -8172,7 +8034,7 @@ type VirtualMachineScaleSetVMsUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachineScaleSetVMsUpdateFuture) Result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -8201,7 +8063,7 @@ type VirtualMachinesCaptureFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesCaptureFuture) Result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure")
return
@@ -8230,7 +8092,7 @@ type VirtualMachinesConvertToManagedDisksFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesConvertToManagedDisksFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure")
return
@@ -8253,7 +8115,7 @@ type VirtualMachinesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesCreateOrUpdateFuture) Result(client VirtualMachinesClient) (VM VirtualMachine, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -8282,7 +8144,7 @@ type VirtualMachinesDeallocateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesDeallocateFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure")
return
@@ -8305,7 +8167,7 @@ type VirtualMachinesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesDeleteFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -8351,7 +8213,7 @@ type VirtualMachinesPerformMaintenanceFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesPerformMaintenanceFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure")
return
@@ -8374,7 +8236,7 @@ type VirtualMachinesPowerOffFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesPowerOffFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure")
return
@@ -8397,7 +8259,7 @@ type VirtualMachinesRedeployFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesRedeployFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure")
return
@@ -8420,7 +8282,7 @@ type VirtualMachinesRestartFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesRestartFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure")
return
@@ -8443,7 +8305,7 @@ type VirtualMachinesRunCommandFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesRunCommandFuture) Result(client VirtualMachinesClient) (rcr RunCommandResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure")
return
@@ -8472,7 +8334,7 @@ type VirtualMachinesStartFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesStartFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure")
return
@@ -8488,9 +8350,9 @@ func (future *VirtualMachinesStartFuture) Result(client VirtualMachinesClient) (
// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view
// status summary.
type VirtualMachineStatusCodeCount struct {
- // Code - The instance view status code.
+ // Code - READ-ONLY; The instance view status code.
Code *string `json:"code,omitempty"`
- // Count - The number of instances having a particular status code.
+ // Count - READ-ONLY; The number of instances having a particular status code.
Count *int32 `json:"count,omitempty"`
}
@@ -8504,7 +8366,7 @@ type VirtualMachinesUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualMachinesUpdateFuture) Result(client VirtualMachinesClient) (VM VirtualMachine, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure")
return
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/snapshots.go
index 022082ab2..09e9d0c3c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/snapshots.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/snapshots.go
@@ -107,6 +107,7 @@ func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resour
"api-version": APIVersion,
}
+ snapshot.ManagedBy = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachines.go
index baeac7664..2d81a663c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachines.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachines.go
@@ -272,6 +272,7 @@ func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context,
"api-version": APIVersion,
}
+ parameters.Resources = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachinescalesetvms.go
index a5e4eb72e..031b16135 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachinescalesetvms.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachinescalesetvms.go
@@ -1187,6 +1187,10 @@ func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context
"api-version": APIVersion,
}
+ parameters.InstanceID = nil
+ parameters.Sku = nil
+ parameters.Resources = nil
+ parameters.Zones = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/applicationsecuritygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/applicationsecuritygroups.go
index c755b861d..31fa14b19 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/applicationsecuritygroups.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/applicationsecuritygroups.go
@@ -84,6 +84,7 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context
"api-version": APIVersion,
}
+ parameters.Etag = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitauthorizations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitauthorizations.go
index 5909c11a3..386991124 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitauthorizations.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitauthorizations.go
@@ -89,6 +89,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx
"api-version": APIVersion,
}
+ authorizationParameters.Etag = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitpeerings.go
index 3af8a79bf..f61e90d4f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitpeerings.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitpeerings.go
@@ -98,6 +98,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte
"api-version": APIVersion,
}
+ peeringParameters.Etag = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuits.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuits.go
index f71693b4c..40a10edaf 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuits.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuits.go
@@ -84,6 +84,7 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(ctx context.Cont
"api-version": APIVersion,
}
+ parameters.Etag = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/models.go
index 281a21b7d..ad88a1bb7 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/models.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/models.go
@@ -1294,9 +1294,9 @@ type ApplicationGateway struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -1316,12 +1316,6 @@ func (ag ApplicationGateway) MarshalJSON() ([]byte, error) {
if ag.ID != nil {
objectMap["id"] = ag.ID
}
- if ag.Name != nil {
- objectMap["name"] = ag.Name
- }
- if ag.Type != nil {
- objectMap["type"] = ag.Type
- }
if ag.Location != nil {
objectMap["location"] = ag.Location
}
@@ -1519,9 +1513,9 @@ type ApplicationGatewayAvailableSslOptions struct {
*ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -1538,12 +1532,6 @@ func (agaso ApplicationGatewayAvailableSslOptions) MarshalJSON() ([]byte, error)
if agaso.ID != nil {
objectMap["id"] = agaso.ID
}
- if agaso.Name != nil {
- objectMap["name"] = agaso.Name
- }
- if agaso.Type != nil {
- objectMap["type"] = agaso.Type
- }
if agaso.Location != nil {
objectMap["location"] = agaso.Location
}
@@ -2103,9 +2091,9 @@ type ApplicationGatewayFirewallRuleSet struct {
*ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -2122,12 +2110,6 @@ func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) {
if agfrs.ID != nil {
objectMap["id"] = agfrs.ID
}
- if agfrs.Name != nil {
- objectMap["name"] = agfrs.Name
- }
- if agfrs.Type != nil {
- objectMap["type"] = agfrs.Type
- }
if agfrs.Location != nil {
objectMap["location"] = agfrs.Location
}
@@ -3031,7 +3013,7 @@ type ApplicationGatewayPropertiesFormat struct {
Sku *ApplicationGatewaySku `json:"sku,omitempty"`
// SslPolicy - SSL policy of the application gateway resource.
SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"`
- // OperationalState - Operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping'
+ // OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping'
OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"`
// GatewayIPConfigurations - Subnets of application the gateway resource.
GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"`
@@ -3305,7 +3287,7 @@ type ApplicationGatewaysBackendHealthFuture struct {
// If the operation has not completed it will return an error.
func (future *ApplicationGatewaysBackendHealthFuture) Result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure")
return
@@ -3334,7 +3316,7 @@ type ApplicationGatewaysCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *ApplicationGatewaysCreateOrUpdateFuture) Result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -3363,7 +3345,7 @@ type ApplicationGatewaysDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *ApplicationGatewaysDeleteFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -3593,7 +3575,7 @@ type ApplicationGatewaysStartFuture struct {
// If the operation has not completed it will return an error.
func (future *ApplicationGatewaysStartFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure")
return
@@ -3616,7 +3598,7 @@ type ApplicationGatewaysStopFuture struct {
// If the operation has not completed it will return an error.
func (future *ApplicationGatewaysStopFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure")
return
@@ -3639,7 +3621,7 @@ type ApplicationGatewaysUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *ApplicationGatewaysUpdateTagsFuture) Result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -3791,13 +3773,13 @@ type ApplicationSecurityGroup struct {
autorest.Response `json:"-"`
// ApplicationSecurityGroupPropertiesFormat - Properties of the application security group.
*ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"`
- // Etag - A unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -3811,18 +3793,9 @@ func (asg ApplicationSecurityGroup) MarshalJSON() ([]byte, error) {
if asg.ApplicationSecurityGroupPropertiesFormat != nil {
objectMap["properties"] = asg.ApplicationSecurityGroupPropertiesFormat
}
- if asg.Etag != nil {
- objectMap["etag"] = asg.Etag
- }
if asg.ID != nil {
objectMap["id"] = asg.ID
}
- if asg.Name != nil {
- objectMap["name"] = asg.Name
- }
- if asg.Type != nil {
- objectMap["type"] = asg.Type
- }
if asg.Location != nil {
objectMap["location"] = asg.Location
}
@@ -3915,7 +3888,7 @@ type ApplicationSecurityGroupListResult struct {
autorest.Response `json:"-"`
// Value - A list of application security groups.
Value *[]ApplicationSecurityGroup `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -4059,9 +4032,9 @@ func NewApplicationSecurityGroupListResultPage(getNextPage func(context.Context,
// ApplicationSecurityGroupPropertiesFormat application security group properties.
type ApplicationSecurityGroupPropertiesFormat struct {
- // ResourceGUID - The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
+ // ResourceGUID - READ-ONLY; The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
ResourceGUID *string `json:"resourceGuid,omitempty"`
- // ProvisioningState - The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -4075,7 +4048,7 @@ type ApplicationSecurityGroupsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) Result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -4104,7 +4077,7 @@ type ApplicationSecurityGroupsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *ApplicationSecurityGroupsDeleteFuture) Result(client ApplicationSecurityGroupsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -4480,11 +4453,11 @@ func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error {
// BackendAddressPoolPropertiesFormat properties of the backend address pool.
type BackendAddressPoolPropertiesFormat struct {
- // BackendIPConfigurations - Gets collection of references to IP addresses defined in network interfaces.
+ // BackendIPConfigurations - READ-ONLY; Gets collection of references to IP addresses defined in network interfaces.
BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"`
- // LoadBalancingRules - Gets load balancing rules that use this backend address pool.
+ // LoadBalancingRules - READ-ONLY; Gets load balancing rules that use this backend address pool.
LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
- // OutboundNatRule - Gets outbound rules that use this backend address pool.
+ // OutboundNatRule - READ-ONLY; Gets outbound rules that use this backend address pool.
OutboundNatRule *SubResource `json:"outboundNatRule,omitempty"`
// ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -4508,21 +4481,21 @@ type BGPCommunity struct {
// BgpPeerStatus BGP peer status details
type BgpPeerStatus struct {
- // LocalAddress - The virtual network gateway's local address
+ // LocalAddress - READ-ONLY; The virtual network gateway's local address
LocalAddress *string `json:"localAddress,omitempty"`
- // Neighbor - The remote BGP peer
+ // Neighbor - READ-ONLY; The remote BGP peer
Neighbor *string `json:"neighbor,omitempty"`
- // Asn - The autonomous system number of the remote BGP peer
+ // Asn - READ-ONLY; The autonomous system number of the remote BGP peer
Asn *int32 `json:"asn,omitempty"`
- // State - The BGP peer state. Possible values include: 'BgpPeerStateUnknown', 'BgpPeerStateStopped', 'BgpPeerStateIdle', 'BgpPeerStateConnecting', 'BgpPeerStateConnected'
+ // State - READ-ONLY; The BGP peer state. Possible values include: 'BgpPeerStateUnknown', 'BgpPeerStateStopped', 'BgpPeerStateIdle', 'BgpPeerStateConnecting', 'BgpPeerStateConnected'
State BgpPeerState `json:"state,omitempty"`
- // ConnectedDuration - For how long the peering has been up
+ // ConnectedDuration - READ-ONLY; For how long the peering has been up
ConnectedDuration *string `json:"connectedDuration,omitempty"`
- // RoutesReceived - The number of routes learned from this peer
+ // RoutesReceived - READ-ONLY; The number of routes learned from this peer
RoutesReceived *int64 `json:"routesReceived,omitempty"`
- // MessagesSent - The number of BGP messages sent
+ // MessagesSent - READ-ONLY; The number of BGP messages sent
MessagesSent *int64 `json:"messagesSent,omitempty"`
- // MessagesReceived - The number of BGP messages received
+ // MessagesReceived - READ-ONLY; The number of BGP messages received
MessagesReceived *int64 `json:"messagesReceived,omitempty"`
}
@@ -4538,9 +4511,9 @@ type BgpServiceCommunity struct {
*BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -4557,12 +4530,6 @@ func (bsc BgpServiceCommunity) MarshalJSON() ([]byte, error) {
if bsc.ID != nil {
objectMap["id"] = bsc.ID
}
- if bsc.Name != nil {
- objectMap["name"] = bsc.Name
- }
- if bsc.Type != nil {
- objectMap["type"] = bsc.Type
- }
if bsc.Location != nil {
objectMap["location"] = bsc.Location
}
@@ -4909,12 +4876,12 @@ type ConnectionMonitorQueryResult struct {
// ConnectionMonitorResult information about the connection monitor.
type ConnectionMonitorResult struct {
autorest.Response `json:"-"`
- // Name - Name of the connection monitor.
+ // Name - READ-ONLY; Name of the connection monitor.
Name *string `json:"name,omitempty"`
- // ID - ID of the connection monitor.
+ // ID - READ-ONLY; ID of the connection monitor.
ID *string `json:"id,omitempty"`
Etag *string `json:"etag,omitempty"`
- // Type - Connection monitor type.
+ // Type - READ-ONLY; Connection monitor type.
Type *string `json:"type,omitempty"`
// Location - Connection monitor location.
Location *string `json:"location,omitempty"`
@@ -4926,18 +4893,9 @@ type ConnectionMonitorResult struct {
// MarshalJSON is the custom marshaler for ConnectionMonitorResult.
func (cmr ConnectionMonitorResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if cmr.Name != nil {
- objectMap["name"] = cmr.Name
- }
- if cmr.ID != nil {
- objectMap["id"] = cmr.ID
- }
if cmr.Etag != nil {
objectMap["etag"] = cmr.Etag
}
- if cmr.Type != nil {
- objectMap["type"] = cmr.Type
- }
if cmr.Location != nil {
objectMap["location"] = cmr.Location
}
@@ -5054,7 +5012,7 @@ type ConnectionMonitorsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *ConnectionMonitorsCreateOrUpdateFuture) Result(client ConnectionMonitorsClient) (cmr ConnectionMonitorResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -5083,7 +5041,7 @@ type ConnectionMonitorsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *ConnectionMonitorsDeleteFuture) Result(client ConnectionMonitorsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -5114,7 +5072,7 @@ type ConnectionMonitorsQueryFuture struct {
// If the operation has not completed it will return an error.
func (future *ConnectionMonitorsQueryFuture) Result(client ConnectionMonitorsClient) (cmqr ConnectionMonitorQueryResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", future.Response(), "Polling failure")
return
@@ -5143,7 +5101,7 @@ type ConnectionMonitorsStartFuture struct {
// If the operation has not completed it will return an error.
func (future *ConnectionMonitorsStartFuture) Result(client ConnectionMonitorsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStartFuture", "Result", future.Response(), "Polling failure")
return
@@ -5166,7 +5124,7 @@ type ConnectionMonitorsStopFuture struct {
// If the operation has not completed it will return an error.
func (future *ConnectionMonitorsStopFuture) Result(client ConnectionMonitorsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStopFuture", "Result", future.Response(), "Polling failure")
return
@@ -5203,7 +5161,7 @@ type ConnectionStateSnapshot struct {
EndTime *date.Time `json:"endTime,omitempty"`
// EvaluationState - Connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'
EvaluationState EvaluationState `json:"evaluationState,omitempty"`
- // Hops - List of hops between the source and the destination.
+ // Hops - READ-ONLY; List of hops between the source and the destination.
Hops *[]ConnectivityHop `json:"hops,omitempty"`
}
@@ -5219,48 +5177,48 @@ type ConnectivityDestination struct {
// ConnectivityHop information about a hop between the source and the destination.
type ConnectivityHop struct {
- // Type - The type of the hop.
+ // Type - READ-ONLY; The type of the hop.
Type *string `json:"type,omitempty"`
- // ID - The ID of the hop.
+ // ID - READ-ONLY; The ID of the hop.
ID *string `json:"id,omitempty"`
- // Address - The IP address of the hop.
+ // Address - READ-ONLY; The IP address of the hop.
Address *string `json:"address,omitempty"`
- // ResourceID - The ID of the resource corresponding to this hop.
+ // ResourceID - READ-ONLY; The ID of the resource corresponding to this hop.
ResourceID *string `json:"resourceId,omitempty"`
- // NextHopIds - List of next hop identifiers.
+ // NextHopIds - READ-ONLY; List of next hop identifiers.
NextHopIds *[]string `json:"nextHopIds,omitempty"`
- // Issues - List of issues.
+ // Issues - READ-ONLY; List of issues.
Issues *[]ConnectivityIssue `json:"issues,omitempty"`
}
// ConnectivityInformation information on the connectivity status.
type ConnectivityInformation struct {
autorest.Response `json:"-"`
- // Hops - List of hops between the source and the destination.
+ // Hops - READ-ONLY; List of hops between the source and the destination.
Hops *[]ConnectivityHop `json:"hops,omitempty"`
- // ConnectionStatus - The connection status. Possible values include: 'ConnectionStatusUnknown', 'ConnectionStatusConnected', 'ConnectionStatusDisconnected', 'ConnectionStatusDegraded'
+ // ConnectionStatus - READ-ONLY; The connection status. Possible values include: 'ConnectionStatusUnknown', 'ConnectionStatusConnected', 'ConnectionStatusDisconnected', 'ConnectionStatusDegraded'
ConnectionStatus ConnectionStatus `json:"connectionStatus,omitempty"`
- // AvgLatencyInMs - Average latency in milliseconds.
+ // AvgLatencyInMs - READ-ONLY; Average latency in milliseconds.
AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"`
- // MinLatencyInMs - Minimum latency in milliseconds.
+ // MinLatencyInMs - READ-ONLY; Minimum latency in milliseconds.
MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"`
- // MaxLatencyInMs - Maximum latency in milliseconds.
+ // MaxLatencyInMs - READ-ONLY; Maximum latency in milliseconds.
MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"`
- // ProbesSent - Total number of probes sent.
+ // ProbesSent - READ-ONLY; Total number of probes sent.
ProbesSent *int32 `json:"probesSent,omitempty"`
- // ProbesFailed - Number of failed probes.
+ // ProbesFailed - READ-ONLY; Number of failed probes.
ProbesFailed *int32 `json:"probesFailed,omitempty"`
}
// ConnectivityIssue information about an issue encountered in the process of checking for connectivity.
type ConnectivityIssue struct {
- // Origin - The origin of the issue. Possible values include: 'OriginLocal', 'OriginInbound', 'OriginOutbound'
+ // Origin - READ-ONLY; The origin of the issue. Possible values include: 'OriginLocal', 'OriginInbound', 'OriginOutbound'
Origin Origin `json:"origin,omitempty"`
- // Severity - The severity of the issue. Possible values include: 'SeverityError', 'SeverityWarning'
+ // Severity - READ-ONLY; The severity of the issue. Possible values include: 'SeverityError', 'SeverityWarning'
Severity Severity `json:"severity,omitempty"`
- // Type - The type of issue. Possible values include: 'IssueTypeUnknown', 'IssueTypeAgentStopped', 'IssueTypeGuestFirewall', 'IssueTypeDNSResolution', 'IssueTypeSocketBind', 'IssueTypeNetworkSecurityRule', 'IssueTypeUserDefinedRoute', 'IssueTypePortThrottled', 'IssueTypePlatform'
+ // Type - READ-ONLY; The type of issue. Possible values include: 'IssueTypeUnknown', 'IssueTypeAgentStopped', 'IssueTypeGuestFirewall', 'IssueTypeDNSResolution', 'IssueTypeSocketBind', 'IssueTypeNetworkSecurityRule', 'IssueTypeUserDefinedRoute', 'IssueTypePortThrottled', 'IssueTypePlatform'
Type IssueType `json:"type,omitempty"`
- // Context - Provides additional context on the issue.
+ // Context - READ-ONLY; Provides additional context on the issue.
Context *[]map[string]*string `json:"context,omitempty"`
}
@@ -5346,7 +5304,7 @@ type EffectiveNetworkSecurityGroupListResult struct {
autorest.Response `json:"-"`
// Value - A list of effective network security groups.
Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -5405,15 +5363,15 @@ type EffectiveRouteListResult struct {
autorest.Response `json:"-"`
// Value - A list of effective routes.
Value *[]EffectiveRoute `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
// EndpointServiceResult endpoint service.
type EndpointServiceResult struct {
- // Name - Name of the endpoint service.
+ // Name - READ-ONLY; Name of the endpoint service.
Name *string `json:"name,omitempty"`
- // Type - Type of the endpoint service.
+ // Type - READ-ONLY; Type of the endpoint service.
Type *string `json:"type,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
@@ -5588,13 +5546,13 @@ type ExpressRouteCircuit struct {
// Sku - The SKU.
Sku *ExpressRouteCircuitSku `json:"sku,omitempty"`
*ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"`
- // Etag - Gets a unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -5611,18 +5569,9 @@ func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) {
if erc.ExpressRouteCircuitPropertiesFormat != nil {
objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat
}
- if erc.Etag != nil {
- objectMap["etag"] = erc.Etag
- }
if erc.ID != nil {
objectMap["id"] = erc.ID
}
- if erc.Name != nil {
- objectMap["name"] = erc.Name
- }
- if erc.Type != nil {
- objectMap["type"] = erc.Type
- }
if erc.Location != nil {
objectMap["location"] = erc.Location
}
@@ -5737,7 +5686,7 @@ type ExpressRouteCircuitAuthorization struct {
*AuthorizationPropertiesFormat `json:"properties,omitempty"`
// Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource.
Name *string `json:"name,omitempty"`
- // Etag - A unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
@@ -5752,9 +5701,6 @@ func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) {
if erca.Name != nil {
objectMap["name"] = erca.Name
}
- if erca.Etag != nil {
- objectMap["etag"] = erca.Etag
- }
if erca.ID != nil {
objectMap["id"] = erca.ID
}
@@ -5822,7 +5768,7 @@ type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) Result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -5851,7 +5797,7 @@ type ExpressRouteCircuitAuthorizationsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) Result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -6017,7 +5963,7 @@ type ExpressRouteCircuitPeering struct {
*ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"`
// Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource.
Name *string `json:"name,omitempty"`
- // Etag - A unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
@@ -6032,9 +5978,6 @@ func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) {
if ercp.Name != nil {
objectMap["name"] = ercp.Name
}
- if ercp.Etag != nil {
- objectMap["etag"] = ercp.Etag
- }
if ercp.ID != nil {
objectMap["id"] = ercp.ID
}
@@ -6304,7 +6247,7 @@ type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) Result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -6333,7 +6276,7 @@ type ExpressRouteCircuitPeeringsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitPeeringsDeleteFuture) Result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -6418,7 +6361,7 @@ type ExpressRouteCircuitsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitsCreateOrUpdateFuture) Result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -6447,7 +6390,7 @@ type ExpressRouteCircuitsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitsDeleteFuture) Result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -6491,7 +6434,7 @@ type ExpressRouteCircuitsListArpTableFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitsListArpTableFuture) Result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure")
return
@@ -6520,7 +6463,7 @@ type ExpressRouteCircuitsListRoutesTableFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitsListRoutesTableFuture) Result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure")
return
@@ -6549,7 +6492,7 @@ type ExpressRouteCircuitsListRoutesTableSummaryFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) Result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure")
return
@@ -6611,7 +6554,7 @@ type ExpressRouteCircuitsUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *ExpressRouteCircuitsUpdateTagsFuture) Result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -6635,9 +6578,9 @@ type ExpressRouteServiceProvider struct {
*ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -6654,12 +6597,6 @@ func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) {
if ersp.ID != nil {
objectMap["id"] = ersp.ID
}
- if ersp.Name != nil {
- objectMap["name"] = ersp.Name
- }
- if ersp.Type != nil {
- objectMap["type"] = ersp.Type
- }
if ersp.Location != nil {
objectMap["location"] = ersp.Location
}
@@ -7084,13 +7021,13 @@ func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error {
// FrontendIPConfigurationPropertiesFormat properties of Frontend IP Configuration of the load balancer.
type FrontendIPConfigurationPropertiesFormat struct {
- // InboundNatRules - Read only. Inbound rules URIs that use this frontend IP.
+ // InboundNatRules - READ-ONLY; Read only. Inbound rules URIs that use this frontend IP.
InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"`
- // InboundNatPools - Read only. Inbound pools URIs that use this frontend IP.
+ // InboundNatPools - READ-ONLY; Read only. Inbound pools URIs that use this frontend IP.
InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"`
- // OutboundNatRules - Read only. Outbound rules URIs that use this frontend IP.
+ // OutboundNatRules - READ-ONLY; Read only. Outbound rules URIs that use this frontend IP.
OutboundNatRules *[]SubResource `json:"outboundNatRules,omitempty"`
- // LoadBalancingRules - Gets load balancing rules URIs that use this frontend IP.
+ // LoadBalancingRules - READ-ONLY; Gets load balancing rules URIs that use this frontend IP.
LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
// PrivateIPAddress - The private IP address of the IP configuration.
PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
@@ -7106,19 +7043,19 @@ type FrontendIPConfigurationPropertiesFormat struct {
// GatewayRoute gateway routing details
type GatewayRoute struct {
- // LocalAddress - The gateway's local address
+ // LocalAddress - READ-ONLY; The gateway's local address
LocalAddress *string `json:"localAddress,omitempty"`
- // NetworkProperty - The route's network prefix
+ // NetworkProperty - READ-ONLY; The route's network prefix
NetworkProperty *string `json:"network,omitempty"`
- // NextHop - The route's next hop
+ // NextHop - READ-ONLY; The route's next hop
NextHop *string `json:"nextHop,omitempty"`
- // SourcePeer - The peer this route was learned from
+ // SourcePeer - READ-ONLY; The peer this route was learned from
SourcePeer *string `json:"sourcePeer,omitempty"`
- // Origin - The source this route was learned from
+ // Origin - READ-ONLY; The source this route was learned from
Origin *string `json:"origin,omitempty"`
- // AsPath - The route's AS path sequence
+ // AsPath - READ-ONLY; The route's AS path sequence
AsPath *string `json:"asPath,omitempty"`
- // Weight - The route's weight
+ // Weight - READ-ONLY; The route's weight
Weight *int32 `json:"weight,omitempty"`
}
@@ -7317,7 +7254,7 @@ type InboundNatRuleListResult struct {
autorest.Response `json:"-"`
// Value - A list of inbound nat rules in a load balancer.
Value *[]InboundNatRule `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -7462,7 +7399,7 @@ func NewInboundNatRuleListResultPage(getNextPage func(context.Context, InboundNa
type InboundNatRulePropertiesFormat struct {
// FrontendIPConfiguration - A reference to frontend IP addresses.
FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
- // BackendIPConfiguration - A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP.
+ // BackendIPConfiguration - READ-ONLY; A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP.
BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"`
// Protocol - Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll'
Protocol TransportProtocol `json:"protocol,omitempty"`
@@ -7488,7 +7425,7 @@ type InboundNatRulesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *InboundNatRulesCreateOrUpdateFuture) Result(client InboundNatRulesClient) (inr InboundNatRule, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -7517,7 +7454,7 @@ type InboundNatRulesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *InboundNatRulesDeleteFuture) Result(client InboundNatRulesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -7539,9 +7476,9 @@ type Interface struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -7561,12 +7498,6 @@ func (i Interface) MarshalJSON() ([]byte, error) {
if i.ID != nil {
objectMap["id"] = i.ID
}
- if i.Name != nil {
- objectMap["name"] = i.Name
- }
- if i.Type != nil {
- objectMap["type"] = i.Type
- }
if i.Location != nil {
objectMap["location"] = i.Location
}
@@ -7656,7 +7587,7 @@ func (i *Interface) UnmarshalJSON(body []byte) error {
// InterfaceAssociation network interface and its custom security rules.
type InterfaceAssociation struct {
- // ID - Network interface ID.
+ // ID - READ-ONLY; Network interface ID.
ID *string `json:"id,omitempty"`
// SecurityRules - Collection of custom security rules.
SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
@@ -7763,7 +7694,7 @@ type InterfaceIPConfigurationListResult struct {
autorest.Response `json:"-"`
// Value - A list of ip configurations.
Value *[]InterfaceIPConfiguration `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -7936,7 +7867,7 @@ type InterfaceListResult struct {
autorest.Response `json:"-"`
// Value - A list of network interfaces in a resource group.
Value *[]Interface `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -8082,7 +8013,7 @@ type InterfaceLoadBalancerListResult struct {
autorest.Response `json:"-"`
// Value - A list of load balancers.
Value *[]LoadBalancer `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -8257,7 +8188,7 @@ type InterfacesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *InterfacesCreateOrUpdateFuture) Result(client InterfacesClient) (i Interface, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -8286,7 +8217,7 @@ type InterfacesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *InterfacesDeleteFuture) Result(client InterfacesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -8309,7 +8240,7 @@ type InterfacesGetEffectiveRouteTableFuture struct {
// If the operation has not completed it will return an error.
func (future *InterfacesGetEffectiveRouteTableFuture) Result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure")
return
@@ -8338,7 +8269,7 @@ type InterfacesListEffectiveNetworkSecurityGroupsFuture struct {
// If the operation has not completed it will return an error.
func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) Result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure")
return
@@ -8367,7 +8298,7 @@ type InterfacesUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *InterfacesUpdateTagsFuture) Result(client InterfacesClient) (i Interface, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InterfacesUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -8543,9 +8474,9 @@ type LoadBalancer struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -8568,12 +8499,6 @@ func (lb LoadBalancer) MarshalJSON() ([]byte, error) {
if lb.ID != nil {
objectMap["id"] = lb.ID
}
- if lb.Name != nil {
- objectMap["name"] = lb.Name
- }
- if lb.Type != nil {
- objectMap["type"] = lb.Type
- }
if lb.Location != nil {
objectMap["location"] = lb.Location
}
@@ -8675,7 +8600,7 @@ type LoadBalancerBackendAddressPoolListResult struct {
autorest.Response `json:"-"`
// Value - A list of backend address pools in a load balancer.
Value *[]BackendAddressPool `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -8822,7 +8747,7 @@ type LoadBalancerFrontendIPConfigurationListResult struct {
autorest.Response `json:"-"`
// Value - A list of frontend IP configurations in a load balancer.
Value *[]FrontendIPConfiguration `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -8969,7 +8894,7 @@ type LoadBalancerListResult struct {
autorest.Response `json:"-"`
// Value - A list of load balancers in a resource group.
Value *[]LoadBalancer `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -9115,7 +9040,7 @@ type LoadBalancerLoadBalancingRuleListResult struct {
autorest.Response `json:"-"`
// Value - A list of load balancing rules in a load balancer.
Value *[]LoadBalancingRule `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -9262,7 +9187,7 @@ type LoadBalancerProbeListResult struct {
autorest.Response `json:"-"`
// Value - A list of probes in a load balancer.
Value *[]Probe `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -9435,7 +9360,7 @@ type LoadBalancersCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *LoadBalancersCreateOrUpdateFuture) Result(client LoadBalancersClient) (lb LoadBalancer, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -9464,7 +9389,7 @@ type LoadBalancersDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *LoadBalancersDeleteFuture) Result(client LoadBalancersClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -9493,7 +9418,7 @@ type LoadBalancersUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *LoadBalancersUpdateTagsFuture) Result(client LoadBalancersClient) (lb LoadBalancer, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -9629,9 +9554,9 @@ type LocalNetworkGateway struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -9651,12 +9576,6 @@ func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) {
if lng.ID != nil {
objectMap["id"] = lng.ID
}
- if lng.Name != nil {
- objectMap["name"] = lng.Name
- }
- if lng.Type != nil {
- objectMap["type"] = lng.Type
- }
if lng.Location != nil {
objectMap["location"] = lng.Location
}
@@ -9749,7 +9668,7 @@ type LocalNetworkGatewayListResult struct {
autorest.Response `json:"-"`
// Value - A list of local network gateways that exists in a resource group.
Value *[]LocalNetworkGateway `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -9901,7 +9820,7 @@ type LocalNetworkGatewayPropertiesFormat struct {
BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
// ResourceGUID - The resource GUID property of the LocalNetworkGateway resource.
ResourceGUID *string `json:"resourceGuid,omitempty"`
- // ProvisioningState - The provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -9915,7 +9834,7 @@ type LocalNetworkGatewaysCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *LocalNetworkGatewaysCreateOrUpdateFuture) Result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -9944,7 +9863,7 @@ type LocalNetworkGatewaysDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *LocalNetworkGatewaysDeleteFuture) Result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -9967,7 +9886,7 @@ type LocalNetworkGatewaysUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *LocalNetworkGatewaysUpdateTagsFuture) Result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -10400,11 +10319,11 @@ type OutboundNatRulePropertiesFormat struct {
// PacketCapture parameters that define the create packet capture operation.
type PacketCapture struct {
- // Name - Name of the packet capture.
+ // Name - READ-ONLY; Name of the packet capture.
Name *string `json:"name,omitempty"`
- // ID - ID of the packet capture.
+ // ID - READ-ONLY; ID of the packet capture.
ID *string `json:"id,omitempty"`
- // Type - Packet capture type.
+ // Type - READ-ONLY; Packet capture type.
Type *string `json:"type,omitempty"`
*PacketCaptureParameters `json:"properties,omitempty"`
}
@@ -10412,15 +10331,6 @@ type PacketCapture struct {
// MarshalJSON is the custom marshaler for PacketCapture.
func (pc PacketCapture) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if pc.Name != nil {
- objectMap["name"] = pc.Name
- }
- if pc.ID != nil {
- objectMap["id"] = pc.ID
- }
- if pc.Type != nil {
- objectMap["type"] = pc.Type
- }
if pc.PacketCaptureParameters != nil {
objectMap["properties"] = pc.PacketCaptureParameters
}
@@ -10533,11 +10443,11 @@ type PacketCaptureQueryStatusResult struct {
// PacketCaptureResult information about packet capture session.
type PacketCaptureResult struct {
autorest.Response `json:"-"`
- // Name - Name of the packet capture.
+ // Name - READ-ONLY; Name of the packet capture.
Name *string `json:"name,omitempty"`
- // ID - ID of the packet capture.
+ // ID - READ-ONLY; ID of the packet capture.
ID *string `json:"id,omitempty"`
- // Type - Packet capture type.
+ // Type - READ-ONLY; Packet capture type.
Type *string `json:"type,omitempty"`
Etag *string `json:"etag,omitempty"`
*PacketCaptureResultProperties `json:"properties,omitempty"`
@@ -10546,15 +10456,6 @@ type PacketCaptureResult struct {
// MarshalJSON is the custom marshaler for PacketCaptureResult.
func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if pcr.Name != nil {
- objectMap["name"] = pcr.Name
- }
- if pcr.ID != nil {
- objectMap["id"] = pcr.ID
- }
- if pcr.Type != nil {
- objectMap["type"] = pcr.Type
- }
if pcr.Etag != nil {
objectMap["etag"] = pcr.Etag
}
@@ -10650,7 +10551,7 @@ type PacketCapturesCreateFuture struct {
// If the operation has not completed it will return an error.
func (future *PacketCapturesCreateFuture) Result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure")
return
@@ -10679,7 +10580,7 @@ type PacketCapturesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *PacketCapturesDeleteFuture) Result(client PacketCapturesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -10702,7 +10603,7 @@ type PacketCapturesGetStatusFuture struct {
// If the operation has not completed it will return an error.
func (future *PacketCapturesGetStatusFuture) Result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure")
return
@@ -10731,7 +10632,7 @@ type PacketCapturesStopFuture struct {
// If the operation has not completed it will return an error.
func (future *PacketCapturesStopFuture) Result(client PacketCapturesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure")
return
@@ -10757,11 +10658,11 @@ type PacketCaptureStorageLocation struct {
// PatchRouteFilter route Filter Resource.
type PatchRouteFilter struct {
*RouteFilterPropertiesFormat `json:"properties,omitempty"`
- // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
+ // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource.
Name *string `json:"name,omitempty"`
- // Etag - A unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
@@ -10775,15 +10676,6 @@ func (prf PatchRouteFilter) MarshalJSON() ([]byte, error) {
if prf.RouteFilterPropertiesFormat != nil {
objectMap["properties"] = prf.RouteFilterPropertiesFormat
}
- if prf.Name != nil {
- objectMap["name"] = prf.Name
- }
- if prf.Etag != nil {
- objectMap["etag"] = prf.Etag
- }
- if prf.Type != nil {
- objectMap["type"] = prf.Type
- }
if prf.Tags != nil {
objectMap["tags"] = prf.Tags
}
@@ -10865,9 +10757,9 @@ func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error {
// PatchRouteFilterRule route Filter Rule Resource
type PatchRouteFilterRule struct {
*RouteFilterRulePropertiesFormat `json:"properties,omitempty"`
- // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
+ // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource.
Name *string `json:"name,omitempty"`
- // Etag - A unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
@@ -10879,12 +10771,6 @@ func (prfr PatchRouteFilterRule) MarshalJSON() ([]byte, error) {
if prfr.RouteFilterRulePropertiesFormat != nil {
objectMap["properties"] = prfr.RouteFilterRulePropertiesFormat
}
- if prfr.Name != nil {
- objectMap["name"] = prfr.Name
- }
- if prfr.Etag != nil {
- objectMap["etag"] = prfr.Etag
- }
if prfr.ID != nil {
objectMap["id"] = prfr.ID
}
@@ -11026,7 +10912,7 @@ func (p *Probe) UnmarshalJSON(body []byte) error {
// ProbePropertiesFormat load balancer probe resource.
type ProbePropertiesFormat struct {
- // LoadBalancingRules - The load balancer rules that use this probe.
+ // LoadBalancingRules - READ-ONLY; The load balancer rules that use this probe.
LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
// Protocol - The protocol of the end point. Possible values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP'
Protocol ProbeProtocol `json:"protocol,omitempty"`
@@ -11055,9 +10941,9 @@ type PublicIPAddress struct {
Zones *[]string `json:"zones,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -11083,12 +10969,6 @@ func (pia PublicIPAddress) MarshalJSON() ([]byte, error) {
if pia.ID != nil {
objectMap["id"] = pia.ID
}
- if pia.Name != nil {
- objectMap["name"] = pia.Name
- }
- if pia.Type != nil {
- objectMap["type"] = pia.Type
- }
if pia.Location != nil {
objectMap["location"] = pia.Location
}
@@ -11214,7 +11094,7 @@ type PublicIPAddressesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *PublicIPAddressesCreateOrUpdateFuture) Result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -11243,7 +11123,7 @@ type PublicIPAddressesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *PublicIPAddressesDeleteFuture) Result(client PublicIPAddressesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -11266,7 +11146,7 @@ type PublicIPAddressesUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *PublicIPAddressesUpdateTagsFuture) Result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.PublicIPAddressesUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -11437,7 +11317,7 @@ type PublicIPAddressPropertiesFormat struct {
PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"`
// PublicIPAddressVersion - The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'
PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"`
- // IPConfiguration - The IP configuration associated with the public IP address.
+ // IPConfiguration - READ-ONLY; The IP configuration associated with the public IP address.
IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"`
// DNSSettings - The FQDN of the DNS record associated with the public IP address.
DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"`
@@ -11469,9 +11349,9 @@ type QueryTroubleshootingParameters struct {
type Resource struct {
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -11485,12 +11365,6 @@ func (r Resource) MarshalJSON() ([]byte, error) {
if r.ID != nil {
objectMap["id"] = r.ID
}
- if r.Name != nil {
- objectMap["name"] = r.Name
- }
- if r.Type != nil {
- objectMap["type"] = r.Type
- }
if r.Location != nil {
objectMap["location"] = r.Location
}
@@ -11506,7 +11380,7 @@ type ResourceNavigationLink struct {
*ResourceNavigationLinkFormat `json:"properties,omitempty"`
// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
Name *string `json:"name,omitempty"`
- // Etag - A unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
@@ -11521,9 +11395,6 @@ func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) {
if rnl.Name != nil {
objectMap["name"] = rnl.Name
}
- if rnl.Etag != nil {
- objectMap["etag"] = rnl.Etag
- }
if rnl.ID != nil {
objectMap["id"] = rnl.ID
}
@@ -11587,7 +11458,7 @@ type ResourceNavigationLinkFormat struct {
LinkedResourceType *string `json:"linkedResourceType,omitempty"`
// Link - Link to the external resource
Link *string `json:"link,omitempty"`
- // ProvisioningState - Provisioning state of the ResourceNavigationLink resource.
+ // ProvisioningState - READ-ONLY; Provisioning state of the ResourceNavigationLink resource.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -11685,13 +11556,13 @@ func (r *Route) UnmarshalJSON(body []byte) error {
type RouteFilter struct {
autorest.Response `json:"-"`
*RouteFilterPropertiesFormat `json:"properties,omitempty"`
- // Etag - Gets a unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -11705,18 +11576,9 @@ func (rf RouteFilter) MarshalJSON() ([]byte, error) {
if rf.RouteFilterPropertiesFormat != nil {
objectMap["properties"] = rf.RouteFilterPropertiesFormat
}
- if rf.Etag != nil {
- objectMap["etag"] = rf.Etag
- }
if rf.ID != nil {
objectMap["id"] = rf.ID
}
- if rf.Name != nil {
- objectMap["name"] = rf.Name
- }
- if rf.Type != nil {
- objectMap["type"] = rf.Type
- }
if rf.Location != nil {
objectMap["location"] = rf.Location
}
@@ -11956,7 +11818,7 @@ type RouteFilterPropertiesFormat struct {
Rules *[]RouteFilterRule `json:"rules,omitempty"`
// Peerings - A collection of references to express route circuit peerings.
Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"`
- // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -11968,7 +11830,7 @@ type RouteFilterRule struct {
Name *string `json:"name,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
- // Etag - A unique read-only string that changes whenever the resource is updated.
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
@@ -11986,9 +11848,6 @@ func (rfr RouteFilterRule) MarshalJSON() ([]byte, error) {
if rfr.Location != nil {
objectMap["location"] = rfr.Location
}
- if rfr.Etag != nil {
- objectMap["etag"] = rfr.Etag
- }
if rfr.ID != nil {
objectMap["id"] = rfr.ID
}
@@ -12209,7 +12068,7 @@ type RouteFilterRulePropertiesFormat struct {
RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"`
// Communities - The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']
Communities *[]string `json:"communities,omitempty"`
- // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -12223,7 +12082,7 @@ type RouteFilterRulesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteFilterRulesCreateOrUpdateFuture) Result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -12252,7 +12111,7 @@ type RouteFilterRulesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteFilterRulesDeleteFuture) Result(client RouteFilterRulesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -12275,7 +12134,7 @@ type RouteFilterRulesUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteFilterRulesUpdateFuture) Result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -12304,7 +12163,7 @@ type RouteFiltersCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteFiltersCreateOrUpdateFuture) Result(client RouteFiltersClient) (rf RouteFilter, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -12333,7 +12192,7 @@ type RouteFiltersDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteFiltersDeleteFuture) Result(client RouteFiltersClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -12356,7 +12215,7 @@ type RouteFiltersUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteFiltersUpdateFuture) Result(client RouteFiltersClient) (rf RouteFilter, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -12543,7 +12402,7 @@ type RoutesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *RoutesCreateOrUpdateFuture) Result(client RoutesClient) (r Route, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -12571,7 +12430,7 @@ type RoutesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *RoutesDeleteFuture) Result(client RoutesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -12593,9 +12452,9 @@ type RouteTable struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -12615,12 +12474,6 @@ func (rt RouteTable) MarshalJSON() ([]byte, error) {
if rt.ID != nil {
objectMap["id"] = rt.ID
}
- if rt.Name != nil {
- objectMap["name"] = rt.Name
- }
- if rt.Type != nil {
- objectMap["type"] = rt.Type
- }
if rt.Location != nil {
objectMap["location"] = rt.Location
}
@@ -12858,7 +12711,7 @@ func NewRouteTableListResultPage(getNextPage func(context.Context, RouteTableLis
type RouteTablePropertiesFormat struct {
// Routes - Collection of routes contained within a route table.
Routes *[]Route `json:"routes,omitempty"`
- // Subnets - A collection of references to subnets.
+ // Subnets - READ-ONLY; A collection of references to subnets.
Subnets *[]Subnet `json:"subnets,omitempty"`
// DisableBgpRoutePropagation - Gets or sets whether to disable the routes learned by BGP on that route table. True means disable.
DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"`
@@ -12876,7 +12729,7 @@ type RouteTablesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteTablesCreateOrUpdateFuture) Result(client RouteTablesClient) (rt RouteTable, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -12905,7 +12758,7 @@ type RouteTablesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteTablesDeleteFuture) Result(client RouteTablesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -12928,7 +12781,7 @@ type RouteTablesUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *RouteTablesUpdateTagsFuture) Result(client RouteTablesClient) (rt RouteTable, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.RouteTablesUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -12956,9 +12809,9 @@ type SecurityGroup struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -12978,12 +12831,6 @@ func (sg SecurityGroup) MarshalJSON() ([]byte, error) {
if sg.ID != nil {
objectMap["id"] = sg.ID
}
- if sg.Name != nil {
- objectMap["name"] = sg.Name
- }
- if sg.Type != nil {
- objectMap["type"] = sg.Type
- }
if sg.Location != nil {
objectMap["location"] = sg.Location
}
@@ -13230,9 +13077,9 @@ type SecurityGroupPropertiesFormat struct {
SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
// DefaultSecurityRules - The default security rules of network security group.
DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"`
- // NetworkInterfaces - A collection of references to network interfaces.
+ // NetworkInterfaces - READ-ONLY; A collection of references to network interfaces.
NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"`
- // Subnets - A collection of references to subnets.
+ // Subnets - READ-ONLY; A collection of references to subnets.
Subnets *[]Subnet `json:"subnets,omitempty"`
// ResourceGUID - The resource GUID property of the network security group resource.
ResourceGUID *string `json:"resourceGuid,omitempty"`
@@ -13250,7 +13097,7 @@ type SecurityGroupsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *SecurityGroupsCreateOrUpdateFuture) Result(client SecurityGroupsClient) (sg SecurityGroup, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -13279,7 +13126,7 @@ type SecurityGroupsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *SecurityGroupsDeleteFuture) Result(client SecurityGroupsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -13302,7 +13149,7 @@ type SecurityGroupsUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *SecurityGroupsUpdateTagsFuture) Result(client SecurityGroupsClient) (sg SecurityGroup, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.SecurityGroupsUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -13619,7 +13466,7 @@ type SecurityRulesCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *SecurityRulesCreateOrUpdateFuture) Result(client SecurityRulesClient) (sr SecurityRule, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -13648,7 +13495,7 @@ type SecurityRulesDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *SecurityRulesDeleteFuture) Result(client SecurityRulesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -13761,7 +13608,7 @@ func (s *Subnet) UnmarshalJSON(body []byte) error {
// SubnetAssociation network interface and its custom security rules.
type SubnetAssociation struct {
- // ID - Subnet ID.
+ // ID - READ-ONLY; Subnet ID.
ID *string `json:"id,omitempty"`
// SecurityRules - Collection of custom security rules.
SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
@@ -13924,7 +13771,7 @@ type SubnetPropertiesFormat struct {
RouteTable *RouteTable `json:"routeTable,omitempty"`
// ServiceEndpoints - An array of service endpoints.
ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"`
- // IPConfigurations - Gets an array of references to the network interface IP configurations using subnet.
+ // IPConfigurations - READ-ONLY; Gets an array of references to the network interface IP configurations using subnet.
IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"`
// ResourceNavigationLinks - Gets an array of references to the external resources using subnet.
ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"`
@@ -13942,7 +13789,7 @@ type SubnetsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *SubnetsCreateOrUpdateFuture) Result(client SubnetsClient) (s Subnet, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -13971,7 +13818,7 @@ type SubnetsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *SubnetsDeleteFuture) Result(client SubnetsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -14008,11 +13855,11 @@ func (toVar TagsObject) MarshalJSON() ([]byte, error) {
// Topology topology of the specified resource group.
type Topology struct {
autorest.Response `json:"-"`
- // ID - GUID representing the operation id.
+ // ID - READ-ONLY; GUID representing the operation id.
ID *string `json:"id,omitempty"`
- // CreatedDateTime - The datetime when the topology was initially created for the resource group.
+ // CreatedDateTime - READ-ONLY; The datetime when the topology was initially created for the resource group.
CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
- // LastModified - The datetime when the topology was last modified.
+ // LastModified - READ-ONLY; The datetime when the topology was last modified.
LastModified *date.Time `json:"lastModified,omitempty"`
Resources *[]TopologyResource `json:"resources,omitempty"`
}
@@ -14167,21 +14014,21 @@ type TroubleshootingResult struct {
// TunnelConnectionHealth virtualNetworkGatewayConnection properties
type TunnelConnectionHealth struct {
- // Tunnel - Tunnel name.
+ // Tunnel - READ-ONLY; Tunnel name.
Tunnel *string `json:"tunnel,omitempty"`
- // ConnectionStatus - Virtual network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected'
+ // ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected'
ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
- // IngressBytesTransferred - The Ingress Bytes Transferred in this connection
+ // IngressBytesTransferred - READ-ONLY; The Ingress Bytes Transferred in this connection
IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
- // EgressBytesTransferred - The Egress Bytes Transferred in this connection
+ // EgressBytesTransferred - READ-ONLY; The Egress Bytes Transferred in this connection
EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
- // LastConnectionEstablishedUtcTime - The time at which connection was established in Utc format.
+ // LastConnectionEstablishedUtcTime - READ-ONLY; The time at which connection was established in Utc format.
LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"`
}
// Usage describes network resource usage.
type Usage struct {
- // ID - Resource identifier.
+ // ID - READ-ONLY; Resource identifier.
ID *string `json:"id,omitempty"`
// Unit - An enum describing the unit of measurement.
Unit *string `json:"unit,omitempty"`
@@ -14385,9 +14232,9 @@ type VirtualNetwork struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -14407,12 +14254,6 @@ func (vn VirtualNetwork) MarshalJSON() ([]byte, error) {
if vn.ID != nil {
objectMap["id"] = vn.ID
}
- if vn.Name != nil {
- objectMap["name"] = vn.Name
- }
- if vn.Type != nil {
- objectMap["type"] = vn.Type
- }
if vn.Location != nil {
objectMap["location"] = vn.Location
}
@@ -14516,9 +14357,9 @@ type VirtualNetworkGateway struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -14538,12 +14379,6 @@ func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) {
if vng.ID != nil {
objectMap["id"] = vng.ID
}
- if vng.Name != nil {
- objectMap["name"] = vng.Name
- }
- if vng.Type != nil {
- objectMap["type"] = vng.Type
- }
if vng.Location != nil {
objectMap["location"] = vng.Location
}
@@ -14640,9 +14475,9 @@ type VirtualNetworkGatewayConnection struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -14662,12 +14497,6 @@ func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) {
if vngc.ID != nil {
objectMap["id"] = vngc.ID
}
- if vngc.Name != nil {
- objectMap["name"] = vngc.Name
- }
- if vngc.Type != nil {
- objectMap["type"] = vngc.Type
- }
if vngc.Location != nil {
objectMap["location"] = vngc.Location
}
@@ -14764,9 +14593,9 @@ type VirtualNetworkGatewayConnectionListEntity struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -14786,12 +14615,6 @@ func (vngcle VirtualNetworkGatewayConnectionListEntity) MarshalJSON() ([]byte, e
if vngcle.ID != nil {
objectMap["id"] = vngcle.ID
}
- if vngcle.Name != nil {
- objectMap["name"] = vngcle.Name
- }
- if vngcle.Type != nil {
- objectMap["type"] = vngcle.Type
- }
if vngcle.Location != nil {
objectMap["location"] = vngcle.Location
}
@@ -14895,13 +14718,13 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct {
RoutingWeight *int32 `json:"routingWeight,omitempty"`
// SharedKey - The IPSec shared key.
SharedKey *string `json:"sharedKey,omitempty"`
- // ConnectionStatus - Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected'
+ // ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected'
ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
- // TunnelConnectionStatus - Collection of all tunnels' connection health status.
+ // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status.
TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"`
- // EgressBytesTransferred - The egress bytes transferred in this connection.
+ // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection.
EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
- // IngressBytesTransferred - The ingress bytes transferred in this connection.
+ // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection.
IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
// Peer - The reference to peerings resource.
Peer *SubResource `json:"peer,omitempty"`
@@ -14913,7 +14736,7 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct {
IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"`
// ResourceGUID - The resource GUID property of the VirtualNetworkGatewayConnection resource.
ResourceGUID *string `json:"resourceGuid,omitempty"`
- // ProvisioningState - The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -14923,7 +14746,7 @@ type VirtualNetworkGatewayConnectionListResult struct {
autorest.Response `json:"-"`
// Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group.
Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -15081,13 +14904,13 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct {
RoutingWeight *int32 `json:"routingWeight,omitempty"`
// SharedKey - The IPSec shared key.
SharedKey *string `json:"sharedKey,omitempty"`
- // ConnectionStatus - Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected'
+ // ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected'
ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
- // TunnelConnectionStatus - Collection of all tunnels' connection health status.
+ // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status.
TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"`
- // EgressBytesTransferred - The egress bytes transferred in this connection.
+ // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection.
EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
- // IngressBytesTransferred - The ingress bytes transferred in this connection.
+ // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection.
IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
// Peer - The reference to peerings resource.
Peer *SubResource `json:"peer,omitempty"`
@@ -15099,7 +14922,7 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct {
IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"`
// ResourceGUID - The resource GUID property of the VirtualNetworkGatewayConnection resource.
ResourceGUID *string `json:"resourceGuid,omitempty"`
- // ProvisioningState - The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -15113,7 +14936,7 @@ type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) Result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -15142,7 +14965,7 @@ type VirtualNetworkGatewayConnectionsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewayConnectionsDeleteFuture) Result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -15165,7 +14988,7 @@ type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) Result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure")
return
@@ -15194,7 +15017,7 @@ type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) Result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure")
return
@@ -15223,7 +15046,7 @@ type VirtualNetworkGatewayConnectionsUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) Result(client VirtualNetworkGatewayConnectionsClient) (vngcle VirtualNetworkGatewayConnectionListEntity, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -15331,7 +15154,7 @@ type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct {
Subnet *SubResource `json:"subnet,omitempty"`
// PublicIPAddress - The reference of the public IP resource.
PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
- // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -15341,7 +15164,7 @@ type VirtualNetworkGatewayListConnectionsResult struct {
autorest.Response `json:"-"`
// Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group.
Value *[]VirtualNetworkGatewayConnectionListEntity `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -15489,7 +15312,7 @@ type VirtualNetworkGatewayListResult struct {
autorest.Response `json:"-"`
// Value - Gets a list of VirtualNetworkGateway resources that exists in a resource group.
Value *[]VirtualNetworkGateway `json:"value,omitempty"`
- // NextLink - The URL to get the next set of results.
+ // NextLink - READ-ONLY; The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -15653,7 +15476,7 @@ type VirtualNetworkGatewayPropertiesFormat struct {
BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
// ResourceGUID - The resource GUID property of the VirtualNetworkGateway resource.
ResourceGUID *string `json:"resourceGuid,omitempty"`
- // ProvisioningState - The provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -15667,7 +15490,7 @@ type VirtualNetworkGatewaysCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) Result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -15696,7 +15519,7 @@ type VirtualNetworkGatewaysDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysDeleteFuture) Result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -15719,7 +15542,7 @@ type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) Result(client VirtualNetworkGatewaysClient) (s String, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Polling failure")
return
@@ -15738,35 +15561,6 @@ func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) Result(clien
return
}
-// VirtualNetworkGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results
-// of a long-running operation.
-type VirtualNetworkGatewaysGenerateVpnProfileFuture struct {
- azure.Future
-}
-
-// Result returns the result of the asynchronous operation.
-// If the operation has not completed it will return an error.
-func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) Result(client VirtualNetworkGatewaysClient) (s String, err error) {
- var done bool
- done, err = future.Done(client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGenerateVpnProfileFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
- s, err = client.GenerateVpnProfileResponder(s.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", s.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results
// of a long-running operation.
type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct {
@@ -15777,7 +15571,7 @@ type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) Result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure")
return
@@ -15806,7 +15600,7 @@ type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) Result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure")
return
@@ -15835,7 +15629,7 @@ type VirtualNetworkGatewaysGetLearnedRoutesFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) Result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure")
return
@@ -15864,7 +15658,7 @@ type VirtualNetworkGatewaysGetVpnProfilePackageURLFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) Result(client VirtualNetworkGatewaysClient) (s String, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", future.Response(), "Polling failure")
return
@@ -15903,7 +15697,7 @@ type VirtualNetworkGatewaysResetFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysResetFuture) Result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure")
return
@@ -15932,7 +15726,7 @@ type VirtualNetworkGatewaysUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkGatewaysUpdateTagsFuture) Result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -16100,7 +15894,7 @@ func NewVirtualNetworkListResultPage(getNextPage func(context.Context, VirtualNe
// VirtualNetworkListUsageResult response for the virtual networks GetUsage API service call.
type VirtualNetworkListUsageResult struct {
autorest.Response `json:"-"`
- // Value - VirtualNetwork usage stats.
+ // Value - READ-ONLY; VirtualNetwork usage stats.
Value *[]VirtualNetworkUsage `json:"value,omitempty"`
// NextLink - The URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
@@ -16504,7 +16298,7 @@ type VirtualNetworkPeeringsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) Result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -16533,7 +16327,7 @@ type VirtualNetworkPeeringsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworkPeeringsDeleteFuture) Result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -16576,7 +16370,7 @@ type VirtualNetworksCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworksCreateOrUpdateFuture) Result(client VirtualNetworksClient) (vn VirtualNetwork, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -16605,7 +16399,7 @@ type VirtualNetworksDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworksDeleteFuture) Result(client VirtualNetworksClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -16628,7 +16422,7 @@ type VirtualNetworksUpdateTagsFuture struct {
// If the operation has not completed it will return an error.
func (future *VirtualNetworksUpdateTagsFuture) Result(client VirtualNetworksClient) (vn VirtualNetwork, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworksUpdateTagsFuture", "Result", future.Response(), "Polling failure")
return
@@ -16649,23 +16443,23 @@ func (future *VirtualNetworksUpdateTagsFuture) Result(client VirtualNetworksClie
// VirtualNetworkUsage usage details for subnet.
type VirtualNetworkUsage struct {
- // CurrentValue - Indicates number of IPs used from the Subnet.
+ // CurrentValue - READ-ONLY; Indicates number of IPs used from the Subnet.
CurrentValue *float64 `json:"currentValue,omitempty"`
- // ID - Subnet identifier.
+ // ID - READ-ONLY; Subnet identifier.
ID *string `json:"id,omitempty"`
- // Limit - Indicates the size of the subnet.
+ // Limit - READ-ONLY; Indicates the size of the subnet.
Limit *float64 `json:"limit,omitempty"`
- // Name - The name containing common and localized value for usage.
+ // Name - READ-ONLY; The name containing common and localized value for usage.
Name *VirtualNetworkUsageName `json:"name,omitempty"`
- // Unit - Usage units. Returns 'Count'
+ // Unit - READ-ONLY; Usage units. Returns 'Count'
Unit *string `json:"unit,omitempty"`
}
// VirtualNetworkUsageName usage strings container.
type VirtualNetworkUsageName struct {
- // LocalizedValue - Localized subnet size and usage string.
+ // LocalizedValue - READ-ONLY; Localized subnet size and usage string.
LocalizedValue *string `json:"localizedValue,omitempty"`
- // Value - Subnet size and usage string.
+ // Value - READ-ONLY; Subnet size and usage string.
Value *string `json:"value,omitempty"`
}
@@ -16783,7 +16577,7 @@ func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error {
type VpnClientRevokedCertificatePropertiesFormat struct {
// Thumbprint - The revoked VPN client certificate thumbprint.
Thumbprint *string `json:"thumbprint,omitempty"`
- // ProvisioningState - The provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -16872,7 +16666,7 @@ func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error {
type VpnClientRootCertificatePropertiesFormat struct {
// PublicCertData - The certificate public data.
PublicCertData *string `json:"publicCertData,omitempty"`
- // ProvisioningState - The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
+ // ProvisioningState - READ-ONLY; The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -16893,9 +16687,9 @@ type Watcher struct {
*WatcherPropertiesFormat `json:"properties,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
@@ -16915,12 +16709,6 @@ func (w Watcher) MarshalJSON() ([]byte, error) {
if w.ID != nil {
objectMap["id"] = w.ID
}
- if w.Name != nil {
- objectMap["name"] = w.Name
- }
- if w.Type != nil {
- objectMap["type"] = w.Type
- }
if w.Location != nil {
objectMap["location"] = w.Location
}
@@ -17016,7 +16804,7 @@ type WatcherListResult struct {
// WatcherPropertiesFormat the network watcher properties.
type WatcherPropertiesFormat struct {
- // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'
+ // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
}
@@ -17030,7 +16818,7 @@ type WatchersCheckConnectivityFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersCheckConnectivityFuture) Result(client WatchersClient) (ci ConnectivityInformation, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Polling failure")
return
@@ -17059,7 +16847,7 @@ type WatchersDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersDeleteFuture) Result(client WatchersClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -17082,7 +16870,7 @@ type WatchersGetAzureReachabilityReportFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersGetAzureReachabilityReportFuture) Result(client WatchersClient) (arr AzureReachabilityReport, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", future.Response(), "Polling failure")
return
@@ -17111,7 +16899,7 @@ type WatchersGetFlowLogStatusFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersGetFlowLogStatusFuture) Result(client WatchersClient) (fli FlowLogInformation, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure")
return
@@ -17140,7 +16928,7 @@ type WatchersGetNextHopFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersGetNextHopFuture) Result(client WatchersClient) (nhr NextHopResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure")
return
@@ -17169,7 +16957,7 @@ type WatchersGetTroubleshootingFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersGetTroubleshootingFuture) Result(client WatchersClient) (tr TroubleshootingResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure")
return
@@ -17198,7 +16986,7 @@ type WatchersGetTroubleshootingResultFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersGetTroubleshootingResultFuture) Result(client WatchersClient) (tr TroubleshootingResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure")
return
@@ -17227,7 +17015,7 @@ type WatchersGetVMSecurityRulesFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersGetVMSecurityRulesFuture) Result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure")
return
@@ -17256,7 +17044,7 @@ type WatchersListAvailableProvidersFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersListAvailableProvidersFuture) Result(client WatchersClient) (apl AvailableProvidersList, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", future.Response(), "Polling failure")
return
@@ -17285,7 +17073,7 @@ type WatchersSetFlowLogConfigurationFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersSetFlowLogConfigurationFuture) Result(client WatchersClient) (fli FlowLogInformation, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure")
return
@@ -17314,7 +17102,7 @@ type WatchersVerifyIPFlowFuture struct {
// If the operation has not completed it will return an error.
func (future *WatchersVerifyIPFlowFuture) Result(client WatchersClient) (vifr VerificationIPFlowResult, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure")
return
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/packetcaptures.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/packetcaptures.go
index 8ebf0faac..002dc7062 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/packetcaptures.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/packetcaptures.go
@@ -96,6 +96,9 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG
"api-version": APIVersion,
}
+ parameters.Name = nil
+ parameters.ID = nil
+ parameters.Type = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/routefilterrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/routefilterrules.go
index 2f3dde7ac..e4739d3d0 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/routefilterrules.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/routefilterrules.go
@@ -96,6 +96,7 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context,
"api-version": APIVersion,
}
+ routeFilterRuleParameters.Etag = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
@@ -450,6 +451,8 @@ func (client RouteFilterRulesClient) UpdatePreparer(ctx context.Context, resourc
"api-version": APIVersion,
}
+ routeFilterRuleParameters.Name = nil
+ routeFilterRuleParameters.Etag = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/routefilters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/routefilters.go
index 0f31a280c..bab56eb8e 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/routefilters.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/routefilters.go
@@ -84,6 +84,7 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res
"api-version": APIVersion,
}
+ routeFilterParameters.Etag = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
@@ -544,6 +545,9 @@ func (client RouteFiltersClient) UpdatePreparer(ctx context.Context, resourceGro
"api-version": APIVersion,
}
+ routeFilterParameters.Name = nil
+ routeFilterParameters.Etag = nil
+ routeFilterParameters.Type = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/virtualnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/virtualnetworkgateways.go
index a59457f57..0aaf1466d 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/virtualnetworkgateways.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/virtualnetworkgateways.go
@@ -277,7 +277,7 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(res
err = autorest.Respond(
resp,
client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -290,13 +290,13 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(res
// resourceGroupName - the name of the resource group.
// virtualNetworkGatewayName - the name of the virtual network gateway.
// parameters - parameters supplied to the generate virtual network gateway VPN client package operation.
-func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGenerateVpnProfileFuture, err error) {
+func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result String, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GenerateVpnProfile")
defer func() {
sc := -1
- if result.Response() != nil {
- sc = result.Response().StatusCode
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
@@ -307,12 +307,18 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Contex
return
}
- result, err = client.GenerateVpnProfileSender(req)
+ resp, err := client.GenerateVpnProfileSender(req)
if err != nil {
- err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", result.Response(), "Failure sending request")
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", resp, "Failure sending request")
return
}
+ result, err = client.GenerateVpnProfileResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", resp, "Failure responding to request")
+ }
+
return
}
@@ -341,15 +347,9 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(ctx contex
// GenerateVpnProfileSender sends the GenerateVpnProfile request. The method will close the
// http.Response Body if it receives an error.
-func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Request) (future VirtualNetworkGatewaysGenerateVpnProfileFuture, err error) {
- var resp *http.Response
- resp, err = autorest.SendWithSender(client, req,
+func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- future.Future, err = azure.NewFutureFromResponse(resp)
- return
}
// GenerateVpnProfileResponder handles the response to the GenerateVpnProfile request. The method always
@@ -359,7 +359,7 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfileResponder(resp *htt
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
+ autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/models.go
index f03339e39..99fc94173 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/models.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/models.go
@@ -214,17 +214,17 @@ func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult
// Location location information.
type Location struct {
- // ID - The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus.
+ // ID - READ-ONLY; The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus.
ID *string `json:"id,omitempty"`
- // SubscriptionID - The subscription ID.
+ // SubscriptionID - READ-ONLY; The subscription ID.
SubscriptionID *string `json:"subscriptionId,omitempty"`
- // Name - The location name.
+ // Name - READ-ONLY; The location name.
Name *string `json:"name,omitempty"`
- // DisplayName - The display name of the location.
+ // DisplayName - READ-ONLY; The display name of the location.
DisplayName *string `json:"displayName,omitempty"`
- // Latitude - The latitude of the location.
+ // Latitude - READ-ONLY; The latitude of the location.
Latitude *string `json:"latitude,omitempty"`
- // Longitude - The longitude of the location.
+ // Longitude - READ-ONLY; The longitude of the location.
Longitude *string `json:"longitude,omitempty"`
}
@@ -404,24 +404,24 @@ func NewOperationListResultPage(getNextPage func(context.Context, OperationListR
// Policies subscription policies.
type Policies struct {
- // LocationPlacementID - The subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions.
+ // LocationPlacementID - READ-ONLY; The subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions.
LocationPlacementID *string `json:"locationPlacementId,omitempty"`
- // QuotaID - The subscription quota ID.
+ // QuotaID - READ-ONLY; The subscription quota ID.
QuotaID *string `json:"quotaId,omitempty"`
- // SpendingLimit - The subscription spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff'
+ // SpendingLimit - READ-ONLY; The subscription spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff'
SpendingLimit SpendingLimit `json:"spendingLimit,omitempty"`
}
// Subscription subscription information.
type Subscription struct {
autorest.Response `json:"-"`
- // ID - The fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000.
+ // ID - READ-ONLY; The fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000.
ID *string `json:"id,omitempty"`
- // SubscriptionID - The subscription ID.
+ // SubscriptionID - READ-ONLY; The subscription ID.
SubscriptionID *string `json:"subscriptionId,omitempty"`
- // DisplayName - The subscription display name.
+ // DisplayName - READ-ONLY; The subscription display name.
DisplayName *string `json:"displayName,omitempty"`
- // State - The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted'
+ // State - READ-ONLY; The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted'
State State `json:"state,omitempty"`
// SubscriptionPolicies - The subscription policies.
SubscriptionPolicies *Policies `json:"subscriptionPolicies,omitempty"`
@@ -431,9 +431,9 @@ type Subscription struct {
// TenantIDDescription tenant Id information.
type TenantIDDescription struct {
- // ID - The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000.
+ // ID - READ-ONLY; The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000.
ID *string `json:"id,omitempty"`
- // TenantID - The tenant ID. For example, 00000000-0000-0000-0000-000000000000.
+ // TenantID - READ-ONLY; The tenant ID. For example, 00000000-0000-0000-0000-000000000000.
TenantID *string `json:"tenantId,omitempty"`
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources/groups.go
index b1e44f0c3..fc92b65fb 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources/groups.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources/groups.go
@@ -181,6 +181,7 @@ func (client GroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceG
"api-version": APIVersion,
}
+ parameters.ID = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources/models.go
index 75f79f053..7c771c488 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources/models.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources/models.go
@@ -116,7 +116,7 @@ type CreateOrUpdateByIDFuture struct {
// If the operation has not completed it will return an error.
func (future *CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
return
@@ -145,7 +145,7 @@ type CreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *CreateOrUpdateFuture) Result(client Client) (gr GenericResource, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -179,7 +179,7 @@ type DeleteByIDFuture struct {
// If the operation has not completed it will return an error.
func (future *DeleteByIDFuture) Result(client Client) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", future.Response(), "Polling failure")
return
@@ -201,7 +201,7 @@ type DeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *DeleteFuture) Result(client Client) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -242,7 +242,7 @@ type DeploymentExportResult struct {
// DeploymentExtended deployment information.
type DeploymentExtended struct {
autorest.Response `json:"-"`
- // ID - The ID of the deployment.
+ // ID - READ-ONLY; The ID of the deployment.
ID *string `json:"id,omitempty"`
// Name - The name of the deployment.
Name *string `json:"name,omitempty"`
@@ -261,7 +261,7 @@ type DeploymentListResult struct {
autorest.Response `json:"-"`
// Value - An array of deployments.
Value *[]DeploymentExtended `json:"value,omitempty"`
- // NextLink - The URL to use for getting the next set of results.
+ // NextLink - READ-ONLY; The URL to use for getting the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -405,9 +405,9 @@ func NewDeploymentListResultPage(getNextPage func(context.Context, DeploymentLis
// DeploymentOperation deployment operation information.
type DeploymentOperation struct {
autorest.Response `json:"-"`
- // ID - Full deployment operation ID.
+ // ID - READ-ONLY; Full deployment operation ID.
ID *string `json:"id,omitempty"`
- // OperationID - Deployment operation ID.
+ // OperationID - READ-ONLY; Deployment operation ID.
OperationID *string `json:"operationId,omitempty"`
// Properties - Deployment properties.
Properties *DeploymentOperationProperties `json:"properties,omitempty"`
@@ -415,21 +415,21 @@ type DeploymentOperation struct {
// DeploymentOperationProperties deployment operation properties.
type DeploymentOperationProperties struct {
- // ProvisioningState - The state of the provisioning.
+ // ProvisioningState - READ-ONLY; The state of the provisioning.
ProvisioningState *string `json:"provisioningState,omitempty"`
- // Timestamp - The date and time of the operation.
+ // Timestamp - READ-ONLY; The date and time of the operation.
Timestamp *date.Time `json:"timestamp,omitempty"`
- // ServiceRequestID - Deployment operation service request id.
+ // ServiceRequestID - READ-ONLY; Deployment operation service request id.
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
- // StatusCode - Operation status code.
+ // StatusCode - READ-ONLY; Operation status code.
StatusCode *string `json:"statusCode,omitempty"`
- // StatusMessage - Operation status message.
+ // StatusMessage - READ-ONLY; Operation status message.
StatusMessage interface{} `json:"statusMessage,omitempty"`
- // TargetResource - The target resource.
+ // TargetResource - READ-ONLY; The target resource.
TargetResource *TargetResource `json:"targetResource,omitempty"`
- // Request - The HTTP request message.
+ // Request - READ-ONLY; The HTTP request message.
Request *HTTPMessage `json:"request,omitempty"`
- // Response - The HTTP response message.
+ // Response - READ-ONLY; The HTTP response message.
Response *HTTPMessage `json:"response,omitempty"`
}
@@ -438,7 +438,7 @@ type DeploymentOperationsListResult struct {
autorest.Response `json:"-"`
// Value - An array of deployment operations.
Value *[]DeploymentOperation `json:"value,omitempty"`
- // NextLink - The URL to use for getting the next set of results.
+ // NextLink - READ-ONLY; The URL to use for getting the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -600,11 +600,11 @@ type DeploymentProperties struct {
// DeploymentPropertiesExtended deployment properties with additional details.
type DeploymentPropertiesExtended struct {
- // ProvisioningState - The state of the provisioning.
+ // ProvisioningState - READ-ONLY; The state of the provisioning.
ProvisioningState *string `json:"provisioningState,omitempty"`
- // CorrelationID - The correlation ID of the deployment.
+ // CorrelationID - READ-ONLY; The correlation ID of the deployment.
CorrelationID *string `json:"correlationId,omitempty"`
- // Timestamp - The timestamp of the template deployment.
+ // Timestamp - READ-ONLY; The timestamp of the template deployment.
Timestamp *date.Time `json:"timestamp,omitempty"`
// Outputs - Key/value pairs that represent deployment output.
Outputs interface{} `json:"outputs,omitempty"`
@@ -638,7 +638,7 @@ type DeploymentsCreateOrUpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (de DeploymentExtended, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -667,7 +667,7 @@ type DeploymentsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *DeploymentsDeleteFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -712,11 +712,11 @@ type GenericResource struct {
Sku *Sku `json:"sku,omitempty"`
// Identity - The identity of the resource.
Identity *Identity `json:"identity,omitempty"`
- // ID - Resource ID
+ // ID - READ-ONLY; Resource ID
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -745,15 +745,6 @@ func (gr GenericResource) MarshalJSON() ([]byte, error) {
if gr.Identity != nil {
objectMap["identity"] = gr.Identity
}
- if gr.ID != nil {
- objectMap["id"] = gr.ID
- }
- if gr.Name != nil {
- objectMap["name"] = gr.Name
- }
- if gr.Type != nil {
- objectMap["type"] = gr.Type
- }
if gr.Location != nil {
objectMap["location"] = gr.Location
}
@@ -776,7 +767,7 @@ type GenericResourceFilter struct {
// Group resource group information.
type Group struct {
autorest.Response `json:"-"`
- // ID - The ID of the resource group.
+ // ID - READ-ONLY; The ID of the resource group.
ID *string `json:"id,omitempty"`
// Name - The name of the resource group.
Name *string `json:"name,omitempty"`
@@ -792,9 +783,6 @@ type Group struct {
// MarshalJSON is the custom marshaler for Group.
func (g Group) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if g.ID != nil {
- objectMap["id"] = g.ID
- }
if g.Name != nil {
objectMap["name"] = g.Name
}
@@ -835,7 +823,7 @@ type GroupListResult struct {
autorest.Response `json:"-"`
// Value - An array of resource groups.
Value *[]Group `json:"value,omitempty"`
- // NextLink - The URL to use for getting the next set of results.
+ // NextLink - READ-ONLY; The URL to use for getting the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -1007,7 +995,7 @@ func (gp GroupPatchable) MarshalJSON() ([]byte, error) {
// GroupProperties the resource group properties.
type GroupProperties struct {
- // ProvisioningState - The provisioning state.
+ // ProvisioningState - READ-ONLY; The provisioning state.
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -1020,7 +1008,7 @@ type GroupsDeleteFuture struct {
// If the operation has not completed it will return an error.
func (future *GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", future.Response(), "Polling failure")
return
@@ -1041,9 +1029,9 @@ type HTTPMessage struct {
// Identity identity for the resource.
type Identity struct {
- // PrincipalID - The principal ID of resource identity.
+ // PrincipalID - READ-ONLY; The principal ID of resource identity.
PrincipalID *string `json:"principalId,omitempty"`
- // TenantID - The tenant ID of resource.
+ // TenantID - READ-ONLY; The tenant ID of resource.
TenantID *string `json:"tenantId,omitempty"`
// Type - The identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None'
Type ResourceIdentityType `json:"type,omitempty"`
@@ -1054,7 +1042,7 @@ type ListResult struct {
autorest.Response `json:"-"`
// Value - An array of resources.
Value *[]GenericResource `json:"value,omitempty"`
- // NextLink - The URL to use for getting the next set of results.
+ // NextLink - READ-ONLY; The URL to use for getting the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -1197,13 +1185,13 @@ func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult
// ManagementErrorWithDetails the detailed error message of resource management.
type ManagementErrorWithDetails struct {
- // Code - The error code returned when exporting the template.
+ // Code - READ-ONLY; The error code returned when exporting the template.
Code *string `json:"code,omitempty"`
- // Message - The error message describing the export error.
+ // Message - READ-ONLY; The error message describing the export error.
Message *string `json:"message,omitempty"`
- // Target - The target of the error.
+ // Target - READ-ONLY; The target of the error.
Target *string `json:"target,omitempty"`
- // Details - Validation error.
+ // Details - READ-ONLY; Validation error.
Details *[]ManagementErrorWithDetails `json:"details,omitempty"`
}
@@ -1225,7 +1213,7 @@ type MoveResourcesFuture struct {
// If the operation has not completed it will return an error.
func (future *MoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", future.Response(), "Polling failure")
return
@@ -1248,7 +1236,7 @@ type OnErrorDeployment struct {
// OnErrorDeploymentExtended deployment on error behavior with additional details.
type OnErrorDeploymentExtended struct {
- // ProvisioningState - The state of the provisioning for the on error deployment.
+ // ProvisioningState - READ-ONLY; The state of the provisioning for the on error deployment.
ProvisioningState *string `json:"provisioningState,omitempty"`
// Type - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment'
Type OnErrorDeploymentType `json:"type,omitempty"`
@@ -1281,13 +1269,13 @@ type Plan struct {
// Provider resource provider information.
type Provider struct {
autorest.Response `json:"-"`
- // ID - The provider ID.
+ // ID - READ-ONLY; The provider ID.
ID *string `json:"id,omitempty"`
// Namespace - The namespace of the resource provider.
Namespace *string `json:"namespace,omitempty"`
- // RegistrationState - The registration state of the provider.
+ // RegistrationState - READ-ONLY; The registration state of the provider.
RegistrationState *string `json:"registrationState,omitempty"`
- // ResourceTypes - The collection of provider resource types.
+ // ResourceTypes - READ-ONLY; The collection of provider resource types.
ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"`
}
@@ -1296,7 +1284,7 @@ type ProviderListResult struct {
autorest.Response `json:"-"`
// Value - An array of resource providers.
Value *[]Provider `json:"value,omitempty"`
- // NextLink - The URL to use for getting the next set of results.
+ // NextLink - READ-ONLY; The URL to use for getting the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -1488,11 +1476,11 @@ func (prt ProviderResourceType) MarshalJSON() ([]byte, error) {
// Resource resource.
type Resource struct {
- // ID - Resource ID
+ // ID - READ-ONLY; Resource ID
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -1503,15 +1491,6 @@ type Resource struct {
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if r.ID != nil {
- objectMap["id"] = r.ID
- }
- if r.Name != nil {
- objectMap["name"] = r.Name
- }
- if r.Type != nil {
- objectMap["type"] = r.Type
- }
if r.Location != nil {
objectMap["location"] = r.Location
}
@@ -1554,7 +1533,7 @@ type TagCount struct {
// TagDetails tag details.
type TagDetails struct {
autorest.Response `json:"-"`
- // ID - The tag ID.
+ // ID - READ-ONLY; The tag ID.
ID *string `json:"id,omitempty"`
// TagName - The tag name.
TagName *string `json:"tagName,omitempty"`
@@ -1569,7 +1548,7 @@ type TagsListResult struct {
autorest.Response `json:"-"`
// Value - An array of tags.
Value *[]TagDetails `json:"value,omitempty"`
- // NextLink - The URL to use for getting the next set of results.
+ // NextLink - READ-ONLY; The URL to use for getting the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -1713,7 +1692,7 @@ func NewTagsListResultPage(getNextPage func(context.Context, TagsListResult) (Ta
// TagValue tag information.
type TagValue struct {
autorest.Response `json:"-"`
- // ID - The tag ID.
+ // ID - READ-ONLY; The tag ID.
ID *string `json:"id,omitempty"`
// TagValue - The tag value.
TagValue *string `json:"tagValue,omitempty"`
@@ -1748,7 +1727,7 @@ type UpdateByIDFuture struct {
// If the operation has not completed it will return an error.
func (future *UpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", future.Response(), "Polling failure")
return
@@ -1776,7 +1755,7 @@ type UpdateFuture struct {
// If the operation has not completed it will return an error.
func (future *UpdateFuture) Result(client Client) (gr GenericResource, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", future.Response(), "Polling failure")
return
@@ -1805,7 +1784,7 @@ type ValidateMoveResourcesFuture struct {
// If the operation has not completed it will return an error.
func (future *ValidateMoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", future.Response(), "Polling failure")
return
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go
index 88435befb..5efc2901a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go
@@ -18,6 +18,7 @@ package storage
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
+ "context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
@@ -379,19 +380,19 @@ func PossibleUsageUnitValues() []UsageUnit {
// Account the storage account.
type Account struct {
autorest.Response `json:"-"`
- // Sku - Gets the SKU.
+ // Sku - READ-ONLY; Gets the SKU.
Sku *Sku `json:"sku,omitempty"`
- // Kind - Gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'
+ // Kind - READ-ONLY; Gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'
Kind Kind `json:"kind,omitempty"`
// Identity - The identity of the resource.
Identity *Identity `json:"identity,omitempty"`
// AccountProperties - Properties of the storage account.
*AccountProperties `json:"properties,omitempty"`
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -402,27 +403,12 @@ type Account struct {
// MarshalJSON is the custom marshaler for Account.
func (a Account) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if a.Sku != nil {
- objectMap["sku"] = a.Sku
- }
- if a.Kind != "" {
- objectMap["kind"] = a.Kind
- }
if a.Identity != nil {
objectMap["identity"] = a.Identity
}
if a.AccountProperties != nil {
objectMap["properties"] = a.AccountProperties
}
- if a.ID != nil {
- objectMap["id"] = a.ID
- }
- if a.Name != nil {
- objectMap["name"] = a.Name
- }
- if a.Type != nil {
- objectMap["type"] = a.Type
- }
if a.Location != nil {
objectMap["location"] = a.Location
}
@@ -648,57 +634,57 @@ func (acp *AccountCreateParameters) UnmarshalJSON(body []byte) error {
// AccountKey an access key for the storage account.
type AccountKey struct {
- // KeyName - Name of the key.
+ // KeyName - READ-ONLY; Name of the key.
KeyName *string `json:"keyName,omitempty"`
- // Value - Base 64-encoded value of the key.
+ // Value - READ-ONLY; Base 64-encoded value of the key.
Value *string `json:"value,omitempty"`
- // Permissions - Permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'
+ // Permissions - READ-ONLY; Permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'
Permissions KeyPermission `json:"permissions,omitempty"`
}
// AccountListKeysResult the response from the ListKeys operation.
type AccountListKeysResult struct {
autorest.Response `json:"-"`
- // Keys - Gets the list of storage account keys and their properties for the specified storage account.
+ // Keys - READ-ONLY; Gets the list of storage account keys and their properties for the specified storage account.
Keys *[]AccountKey `json:"keys,omitempty"`
}
// AccountListResult the response from the List Storage Accounts operation.
type AccountListResult struct {
autorest.Response `json:"-"`
- // Value - Gets the list of storage accounts and their properties.
+ // Value - READ-ONLY; Gets the list of storage accounts and their properties.
Value *[]Account `json:"value,omitempty"`
}
// AccountProperties properties of the storage account.
type AccountProperties struct {
- // ProvisioningState - Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'
+ // ProvisioningState - READ-ONLY; Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
- // PrimaryEndpoints - Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint.
+ // PrimaryEndpoints - READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint.
PrimaryEndpoints *Endpoints `json:"primaryEndpoints,omitempty"`
- // PrimaryLocation - Gets the location of the primary data center for the storage account.
+ // PrimaryLocation - READ-ONLY; Gets the location of the primary data center for the storage account.
PrimaryLocation *string `json:"primaryLocation,omitempty"`
- // StatusOfPrimary - Gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'Available', 'Unavailable'
+ // StatusOfPrimary - READ-ONLY; Gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'Available', 'Unavailable'
StatusOfPrimary AccountStatus `json:"statusOfPrimary,omitempty"`
- // LastGeoFailoverTime - Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS.
+ // LastGeoFailoverTime - READ-ONLY; Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS.
LastGeoFailoverTime *date.Time `json:"lastGeoFailoverTime,omitempty"`
- // SecondaryLocation - Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS.
+ // SecondaryLocation - READ-ONLY; Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS.
SecondaryLocation *string `json:"secondaryLocation,omitempty"`
- // StatusOfSecondary - Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'Available', 'Unavailable'
+ // StatusOfSecondary - READ-ONLY; Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'Available', 'Unavailable'
StatusOfSecondary AccountStatus `json:"statusOfSecondary,omitempty"`
- // CreationTime - Gets the creation date and time of the storage account in UTC.
+ // CreationTime - READ-ONLY; Gets the creation date and time of the storage account in UTC.
CreationTime *date.Time `json:"creationTime,omitempty"`
- // CustomDomain - Gets the custom domain the user assigned to this storage account.
+ // CustomDomain - READ-ONLY; Gets the custom domain the user assigned to this storage account.
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
- // SecondaryEndpoints - Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS.
+ // SecondaryEndpoints - READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS.
SecondaryEndpoints *Endpoints `json:"secondaryEndpoints,omitempty"`
- // Encryption - Gets the encryption settings on the account. If unspecified, the account is unencrypted.
+ // Encryption - READ-ONLY; Gets the encryption settings on the account. If unspecified, the account is unencrypted.
Encryption *Encryption `json:"encryption,omitempty"`
- // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'
+ // AccessTier - READ-ONLY; Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'
AccessTier AccessTier `json:"accessTier,omitempty"`
// EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true.
EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"`
- // NetworkRuleSet - Network rule set
+ // NetworkRuleSet - READ-ONLY; Network rule set
NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"`
}
@@ -766,7 +752,7 @@ type AccountsCreateFuture struct {
// If the operation has not completed it will return an error.
func (future *AccountsCreateFuture) Result(client AccountsClient) (a Account, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", future.Response(), "Polling failure")
return
@@ -884,11 +870,11 @@ func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error {
// CheckNameAvailabilityResult the CheckNameAvailability operation response.
type CheckNameAvailabilityResult struct {
autorest.Response `json:"-"`
- // NameAvailable - Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used.
+ // NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used.
NameAvailable *bool `json:"nameAvailable,omitempty"`
- // Reason - Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'
+ // Reason - READ-ONLY; Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'
Reason Reason `json:"reason,omitempty"`
- // Message - Gets an error message explaining the Reason value in more detail.
+ // Message - READ-ONLY; Gets an error message explaining the Reason value in more detail.
Message *string `json:"message,omitempty"`
}
@@ -922,7 +908,7 @@ type Encryption struct {
type EncryptionService struct {
// Enabled - A boolean indicating whether or not the service encrypts the data as it is stored.
Enabled *bool `json:"enabled,omitempty"`
- // LastEnabledTime - Gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate.
+ // LastEnabledTime - READ-ONLY; Gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate.
LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"`
}
@@ -932,29 +918,29 @@ type EncryptionServices struct {
Blob *EncryptionService `json:"blob,omitempty"`
// File - The encryption function of the file storage service.
File *EncryptionService `json:"file,omitempty"`
- // Table - The encryption function of the table storage service.
+ // Table - READ-ONLY; The encryption function of the table storage service.
Table *EncryptionService `json:"table,omitempty"`
- // Queue - The encryption function of the queue storage service.
+ // Queue - READ-ONLY; The encryption function of the queue storage service.
Queue *EncryptionService `json:"queue,omitempty"`
}
// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, or table object.
type Endpoints struct {
- // Blob - Gets the blob endpoint.
+ // Blob - READ-ONLY; Gets the blob endpoint.
Blob *string `json:"blob,omitempty"`
- // Queue - Gets the queue endpoint.
+ // Queue - READ-ONLY; Gets the queue endpoint.
Queue *string `json:"queue,omitempty"`
- // Table - Gets the table endpoint.
+ // Table - READ-ONLY; Gets the table endpoint.
Table *string `json:"table,omitempty"`
- // File - Gets the file endpoint.
+ // File - READ-ONLY; Gets the file endpoint.
File *string `json:"file,omitempty"`
}
// Identity identity for the resource.
type Identity struct {
- // PrincipalID - The principal ID of resource identity.
+ // PrincipalID - READ-ONLY; The principal ID of resource identity.
PrincipalID *string `json:"principalId,omitempty"`
- // TenantID - The tenant ID of resource.
+ // TenantID - READ-ONLY; The tenant ID of resource.
TenantID *string `json:"tenantId,omitempty"`
// Type - The identity type.
Type *string `json:"type,omitempty"`
@@ -981,14 +967,14 @@ type KeyVaultProperties struct {
// ListAccountSasResponse the List SAS credentials operation response.
type ListAccountSasResponse struct {
autorest.Response `json:"-"`
- // AccountSasToken - List SAS credentials of storage account.
+ // AccountSasToken - READ-ONLY; List SAS credentials of storage account.
AccountSasToken *string `json:"accountSasToken,omitempty"`
}
// ListServiceSasResponse the List service SAS credentials operation response.
type ListServiceSasResponse struct {
autorest.Response `json:"-"`
- // ServiceSasToken - List service SAS credentials of specific resource.
+ // ServiceSasToken - READ-ONLY; List service SAS credentials of specific resource.
ServiceSasToken *string `json:"serviceSasToken,omitempty"`
}
@@ -1133,11 +1119,11 @@ type OperationProperties struct {
// Resource describes a storage resource.
type Resource struct {
- // ID - Resource Id
+ // ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
- // Name - Resource name
+ // Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
- // Type - Resource type
+ // Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
@@ -1148,15 +1134,6 @@ type Resource struct {
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if r.ID != nil {
- objectMap["id"] = r.ID
- }
- if r.Name != nil {
- objectMap["name"] = r.Name
- }
- if r.Type != nil {
- objectMap["type"] = r.Type
- }
if r.Location != nil {
objectMap["location"] = r.Location
}
@@ -1168,9 +1145,9 @@ func (r Resource) MarshalJSON() ([]byte, error) {
// Restriction the restriction because of which SKU cannot be used.
type Restriction struct {
- // Type - The type of restrictions. As of now only possible value for this is location.
+ // Type - READ-ONLY; The type of restrictions. As of now only possible value for this is location.
Type *string `json:"type,omitempty"`
- // Values - The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.
+ // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.
Values *[]string `json:"values,omitempty"`
// ReasonCode - The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaID', 'NotAvailableForSubscription'
ReasonCode ReasonCode `json:"reasonCode,omitempty"`
@@ -1226,15 +1203,15 @@ type ServiceSpecification struct {
type Sku struct {
// Name - Gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'StandardLRS', 'StandardGRS', 'StandardRAGRS', 'StandardZRS', 'PremiumLRS'
Name SkuName `json:"name,omitempty"`
- // Tier - Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'
+ // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'
Tier SkuTier `json:"tier,omitempty"`
- // ResourceType - The type of the resource, usually it is 'storageAccounts'.
+ // ResourceType - READ-ONLY; The type of the resource, usually it is 'storageAccounts'.
ResourceType *string `json:"resourceType,omitempty"`
- // Kind - Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'
+ // Kind - READ-ONLY; Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'
Kind Kind `json:"kind,omitempty"`
- // Locations - The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.).
+ // Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.).
Locations *[]string `json:"locations,omitempty"`
- // Capabilities - The capability information in the specified sku, including file encryption, network acls, change notification, etc.
+ // Capabilities - READ-ONLY; The capability information in the specified sku, including file encryption, network acls, change notification, etc.
Capabilities *[]SKUCapability `json:"capabilities,omitempty"`
// Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
Restrictions *[]Restriction `json:"restrictions,omitempty"`
@@ -1243,28 +1220,28 @@ type Sku struct {
// SKUCapability the capability information in the specified sku, including file encryption, network acls,
// change notification, etc.
type SKUCapability struct {
- // Name - The name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc.
+ // Name - READ-ONLY; The name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc.
Name *string `json:"name,omitempty"`
- // Value - A string value to indicate states of given capability. Possibly 'true' or 'false'.
+ // Value - READ-ONLY; A string value to indicate states of given capability. Possibly 'true' or 'false'.
Value *string `json:"value,omitempty"`
}
// SkuListResult the response from the List Storage SKUs operation.
type SkuListResult struct {
autorest.Response `json:"-"`
- // Value - Get the list result of storage SKUs and their properties.
+ // Value - READ-ONLY; Get the list result of storage SKUs and their properties.
Value *[]Sku `json:"value,omitempty"`
}
// Usage describes Storage Resource Usage.
type Usage struct {
- // Unit - Gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'
+ // Unit - READ-ONLY; Gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'
Unit UsageUnit `json:"unit,omitempty"`
- // CurrentValue - Gets the current count of the allocated resources in the subscription.
+ // CurrentValue - READ-ONLY; Gets the current count of the allocated resources in the subscription.
CurrentValue *int32 `json:"currentValue,omitempty"`
- // Limit - Gets the maximum count of the resources that can be allocated in the subscription.
+ // Limit - READ-ONLY; Gets the maximum count of the resources that can be allocated in the subscription.
Limit *int32 `json:"limit,omitempty"`
- // Name - Gets the name of the type of usage.
+ // Name - READ-ONLY; Gets the name of the type of usage.
Name *UsageName `json:"name,omitempty"`
}
@@ -1277,9 +1254,9 @@ type UsageListResult struct {
// UsageName the usage names that can be used; currently limited to StorageAccount.
type UsageName struct {
- // Value - Gets a string describing the resource name.
+ // Value - READ-ONLY; Gets a string describing the resource name.
Value *string `json:"value,omitempty"`
- // LocalizedValue - Gets a localized string describing the resource name.
+ // LocalizedValue - READ-ONLY; Gets a localized string describing the resource name.
LocalizedValue *string `json:"localizedValue,omitempty"`
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go
index 427558b5d..389d5d8fd 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go
@@ -367,11 +367,14 @@ func newSASClient(accountName, baseURL string, sasToken url.Values) Client {
accountName: accountName,
baseURL: baseURL,
accountSASToken: sasToken,
+ useHTTPS: defaultUseHTTPS,
}
c.userAgent = c.getDefaultUserAgent()
// Get API version and protocol from token
c.apiVersion = sasToken.Get("sv")
- c.useHTTPS = sasToken.Get("spr") == "https"
+ if spr := sasToken.Get("spr"); spr != "" {
+ c.useHTTPS = spr == "https"
+ }
return c
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go
index fbbcb93ba..385253527 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go
@@ -27,7 +27,7 @@ import (
"strings"
"time"
- "github.com/satori/go.uuid"
+ uuid "github.com/satori/go.uuid"
)
// Annotating as secure for gas scanning
@@ -257,6 +257,9 @@ func (e *Entity) MarshalJSON() ([]byte, error) {
case int64:
completeMap[typeKey] = OdataInt64
completeMap[k] = fmt.Sprintf("%v", v)
+ case float32, float64:
+ completeMap[typeKey] = OdataDouble
+ completeMap[k] = fmt.Sprintf("%v", v)
default:
completeMap[k] = v
}
@@ -264,7 +267,8 @@ func (e *Entity) MarshalJSON() ([]byte, error) {
if !(completeMap[k] == OdataBinary ||
completeMap[k] == OdataDateTime ||
completeMap[k] == OdataGUID ||
- completeMap[k] == OdataInt64) {
+ completeMap[k] == OdataInt64 ||
+ completeMap[k] == OdataDouble) {
return nil, fmt.Errorf("Odata.type annotation %v value is not valid", k)
}
valueKey := strings.TrimSuffix(k, OdataTypeSuffix)
@@ -339,6 +343,12 @@ func (e *Entity) UnmarshalJSON(data []byte) error {
return fmt.Errorf(errorTemplate, err)
}
props[valueKey] = i
+ case OdataDouble:
+ f, err := strconv.ParseFloat(str, 64)
+ if err != nil {
+ return fmt.Errorf(errorTemplate, err)
+ }
+ props[valueKey] = f
default:
return fmt.Errorf(errorTemplate, fmt.Sprintf("%v is not supported", v))
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/odata.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/odata.go
index 800adf129..0690e85ad 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/storage/odata.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/odata.go
@@ -26,6 +26,7 @@ const (
OdataBinary = "Edm.Binary"
OdataDateTime = "Edm.DateTime"
+ OdataDouble = "Edm.Double"
OdataGUID = "Edm.Guid"
OdataInt64 = "Edm.Int64"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go
index a2159e296..5b05e3e2a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go
@@ -25,8 +25,6 @@ import (
"net/textproto"
"sort"
"strings"
-
- "github.com/marstr/guid"
)
// Operation type. Insert, Delete, Replace etc.
@@ -132,8 +130,7 @@ func (t *TableBatch) MergeEntity(entity *Entity) {
// As per document https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/performing-entity-group-transactions
func (t *TableBatch) ExecuteBatch() error {
- // Using `github.com/marstr/guid` is in response to issue #947 (https://github.com/Azure/azure-sdk-for-go/issues/947).
- id, err := guid.NewGUIDs(guid.CreationStrategyVersion1)
+ id, err := newUUID()
if err != nil {
return err
}
@@ -145,7 +142,7 @@ func (t *TableBatch) ExecuteBatch() error {
return err
}
- id, err = guid.NewGUIDs(guid.CreationStrategyVersion1)
+ id, err = newUUID()
if err != nil {
return err
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go
index e8a5dcf8c..677394790 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go
@@ -17,6 +17,7 @@ package storage
import (
"bytes"
"crypto/hmac"
+ "crypto/rand"
"crypto/sha256"
"encoding/base64"
"encoding/xml"
@@ -29,6 +30,8 @@ import (
"strconv"
"strings"
"time"
+
+ uuid "github.com/satori/go.uuid"
)
var (
@@ -242,3 +245,16 @@ func getMetadataFromHeaders(header http.Header) map[string]string {
return metadata
}
+
+// newUUID returns a new uuid using RFC 4122 algorithm.
+func newUUID() (uuid.UUID, error) {
+ u := [16]byte{}
+ // Set all bits to randomly (or pseudo-randomly) chosen values.
+ _, err := rand.Read(u[:])
+ if err != nil {
+ return uuid.UUID{}, err
+ }
+ u[8] = (u[8]&(0xff>>2) | (0x02 << 6)) // u.setVariant(ReservedRFC4122)
+ u[6] = (u[6] & 0xF) | (uuid.V4 << 4) // u.setVersion(V4)
+ return uuid.FromBytes(u[:])
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go
index d4f364abd..fa206bf21 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go
@@ -18,4 +18,4 @@ package version
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// Number contains the semantic version of this SDK.
-const Number = "v27.3.0"
+const Number = "v30.0.0"
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go
index bee5e61dd..8c83a917f 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go
@@ -19,10 +19,6 @@ import (
"net/url"
)
-const (
- activeDirectoryAPIVersion = "1.0"
-)
-
// OAuthConfig represents the endpoints needed
// in OAuth operations
type OAuthConfig struct {
@@ -46,11 +42,25 @@ func validateStringParam(param, name string) error {
// NewOAuthConfig returns an OAuthConfig with tenant specific urls
func NewOAuthConfig(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, error) {
+ apiVer := "1.0"
+ return NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID, &apiVer)
+}
+
+// NewOAuthConfigWithAPIVersion returns an OAuthConfig with tenant specific urls.
+// If apiVersion is not nil the "api-version" query parameter will be appended to the endpoint URLs with the specified value.
+func NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID string, apiVersion *string) (*OAuthConfig, error) {
if err := validateStringParam(activeDirectoryEndpoint, "activeDirectoryEndpoint"); err != nil {
return nil, err
}
+ api := ""
// it's legal for tenantID to be empty so don't validate it
- const activeDirectoryEndpointTemplate = "%s/oauth2/%s?api-version=%s"
+ if apiVersion != nil {
+ if err := validateStringParam(*apiVersion, "apiVersion"); err != nil {
+ return nil, err
+ }
+ api = fmt.Sprintf("?api-version=%s", *apiVersion)
+ }
+ const activeDirectoryEndpointTemplate = "%s/oauth2/%s%s"
u, err := url.Parse(activeDirectoryEndpoint)
if err != nil {
return nil, err
@@ -59,15 +69,15 @@ func NewOAuthConfig(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, err
if err != nil {
return nil, err
}
- authorizeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "authorize", activeDirectoryAPIVersion))
+ authorizeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "authorize", api))
if err != nil {
return nil, err
}
- tokenURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "token", activeDirectoryAPIVersion))
+ tokenURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "token", api))
if err != nil {
return nil, err
}
- deviceCodeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "devicecode", activeDirectoryAPIVersion))
+ deviceCodeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "devicecode", api))
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go b/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
index 0e5ad14d3..834401e00 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
@@ -38,7 +38,7 @@ func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) {
return sf(r)
}
-// SendDecorator takes and possibily decorates, by wrapping, a Sender. Decorators may affect the
+// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the
// http.Request and pass it along or, first, pass the http.Request along then react to the
// http.Response result.
type SendDecorator func(Sender) Sender
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go
index eec4dced7..effa87ab2 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go
@@ -29,12 +29,12 @@ import (
"net"
"net/http"
"net/url"
- "strconv"
"strings"
"sync"
"time"
"github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/tracing"
"github.com/dgrijalva/jwt-go"
)
@@ -96,18 +96,27 @@ type RefresherWithContext interface {
type TokenRefreshCallback func(Token) error
// Token encapsulates the access token used to authorize Azure requests.
+// https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#service-to-service-access-token-response
type Token struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
- ExpiresIn string `json:"expires_in"`
- ExpiresOn string `json:"expires_on"`
- NotBefore string `json:"not_before"`
+ ExpiresIn json.Number `json:"expires_in"`
+ ExpiresOn json.Number `json:"expires_on"`
+ NotBefore json.Number `json:"not_before"`
Resource string `json:"resource"`
Type string `json:"token_type"`
}
+func newToken() Token {
+ return Token{
+ ExpiresIn: "0",
+ ExpiresOn: "0",
+ NotBefore: "0",
+ }
+}
+
// IsZero returns true if the token object is zero-initialized.
func (t Token) IsZero() bool {
return t == Token{}
@@ -115,12 +124,12 @@ func (t Token) IsZero() bool {
// Expires returns the time.Time when the Token expires.
func (t Token) Expires() time.Time {
- s, err := strconv.Atoi(t.ExpiresOn)
+ s, err := t.ExpiresOn.Float64()
if err != nil {
s = -3600
}
- expiration := date.NewUnixTimeFromSeconds(float64(s))
+ expiration := date.NewUnixTimeFromSeconds(s)
return time.Time(expiration).UTC()
}
@@ -217,6 +226,8 @@ func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalTo
token := jwt.New(jwt.SigningMethodRS256)
token.Header["x5t"] = thumbprint
+ x5c := []string{base64.StdEncoding.EncodeToString(secret.Certificate.Raw)}
+ token.Header["x5c"] = x5c
token.Claims = jwt.MapClaims{
"aud": spt.inner.OauthConfig.TokenEndpoint.String(),
"iss": spt.inner.ClientID,
@@ -374,8 +385,13 @@ func (spt *ServicePrincipalToken) UnmarshalJSON(data []byte) error {
if err != nil {
return err
}
- spt.refreshLock = &sync.RWMutex{}
- spt.sender = &http.Client{}
+ // Don't override the refreshLock or the sender if those have been already set.
+ if spt.refreshLock == nil {
+ spt.refreshLock = &sync.RWMutex{}
+ }
+ if spt.sender == nil {
+ spt.sender = &http.Client{Transport: tracing.Transport}
+ }
return nil
}
@@ -413,6 +429,7 @@ func NewServicePrincipalTokenWithSecret(oauthConfig OAuthConfig, id string, reso
}
spt := &ServicePrincipalToken{
inner: servicePrincipalToken{
+ Token: newToken(),
OauthConfig: oauthConfig,
Secret: secret,
ClientID: id,
@@ -421,7 +438,7 @@ func NewServicePrincipalTokenWithSecret(oauthConfig OAuthConfig, id string, reso
RefreshWithin: defaultRefresh,
},
refreshLock: &sync.RWMutex{},
- sender: &http.Client{},
+ sender: &http.Client{Transport: tracing.Transport},
refreshCallbacks: callbacks,
}
return spt, nil
@@ -652,6 +669,7 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI
spt := &ServicePrincipalToken{
inner: servicePrincipalToken{
+ Token: newToken(),
OauthConfig: OAuthConfig{
TokenEndpoint: *msiEndpointURL,
},
@@ -661,7 +679,7 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI
RefreshWithin: defaultRefresh,
},
refreshLock: &sync.RWMutex{},
- sender: &http.Client{},
+ sender: &http.Client{Transport: tracing.Transport},
refreshCallbacks: callbacks,
MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts,
}
@@ -778,6 +796,7 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource
if err != nil {
return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err)
}
+ req.Header.Add("User-Agent", UserAgent())
req = req.WithContext(ctx)
if !isIMDS(spt.inner.OauthConfig.TokenEndpoint) {
v := url.Values{}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/version.go b/vendor/github.com/Azure/go-autorest/autorest/adal/version.go
new file mode 100644
index 000000000..c867b3484
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/autorest/adal/version.go
@@ -0,0 +1,45 @@
+package adal
+
+import (
+ "fmt"
+ "runtime"
+)
+
+// Copyright 2017 Microsoft Corporation
+//
+// 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.
+
+const number = "v1.0.0"
+
+var (
+ ua = fmt.Sprintf("Go/%s (%s-%s) go-autorest/adal/%s",
+ runtime.Version(),
+ runtime.GOARCH,
+ runtime.GOOS,
+ number,
+ )
+)
+
+// UserAgent returns a string containing the Go version, system architecture and OS, and the adal version.
+func UserAgent() string {
+ return ua
+}
+
+// AddToUserAgent adds an extension to the current user agent
+func AddToUserAgent(extension string) error {
+ if extension != "" {
+ ua = fmt.Sprintf("%s %s", ua, extension)
+ return nil
+ }
+ return fmt.Errorf("Extension was empty, User Agent remained as '%s'", ua)
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization.go b/vendor/github.com/Azure/go-autorest/autorest/authorization.go
index 77eff45bd..2e24b4b39 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/authorization.go
@@ -15,12 +15,14 @@ package autorest
// limitations under the License.
import (
+ "encoding/base64"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/Azure/go-autorest/autorest/adal"
+ "github.com/Azure/go-autorest/tracing"
)
const (
@@ -30,6 +32,8 @@ const (
apiKeyAuthorizerHeader = "Ocp-Apim-Subscription-Key"
bingAPISdkHeader = "X-BingApis-SDK-Client"
golangBingAPISdkHeaderValue = "Go-SDK"
+ authorization = "Authorization"
+ basic = "Basic"
)
// Authorizer is the interface that provides a PrepareDecorator used to supply request
@@ -68,7 +72,7 @@ func NewAPIKeyAuthorizer(headers map[string]interface{}, queryParameters map[str
return &APIKeyAuthorizer{headers: headers, queryParameters: queryParameters}
}
-// WithAuthorization returns a PrepareDecorator that adds an HTTP headers and Query Paramaters
+// WithAuthorization returns a PrepareDecorator that adds an HTTP headers and Query Parameters.
func (aka *APIKeyAuthorizer) WithAuthorization() PrepareDecorator {
return func(p Preparer) Preparer {
return DecoratePreparer(p, WithHeaders(aka.headers), WithQueryParameters(aka.queryParameters))
@@ -147,7 +151,7 @@ type BearerAuthorizerCallback struct {
// is invoked when the HTTP request is submitted.
func NewBearerAuthorizerCallback(sender Sender, callback BearerAuthorizerCallbackFunc) *BearerAuthorizerCallback {
if sender == nil {
- sender = &http.Client{}
+ sender = &http.Client{Transport: tracing.Transport}
}
return &BearerAuthorizerCallback{sender: sender, callback: callback}
}
@@ -257,3 +261,27 @@ func (egta EventGridKeyAuthorizer) WithAuthorization() PrepareDecorator {
}
return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization()
}
+
+// BasicAuthorizer implements basic HTTP authorization by adding the Authorization HTTP header
+// with the value "Basic " where is a base64-encoded username:password tuple.
+type BasicAuthorizer struct {
+ userName string
+ password string
+}
+
+// NewBasicAuthorizer creates a new BasicAuthorizer with the specified username and password.
+func NewBasicAuthorizer(userName, password string) *BasicAuthorizer {
+ return &BasicAuthorizer{
+ userName: userName,
+ password: password,
+ }
+}
+
+// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose
+// value is "Basic " followed by the base64-encoded username:password tuple.
+func (ba *BasicAuthorizer) WithAuthorization() PrepareDecorator {
+ headers := make(map[string]interface{})
+ headers[authorization] = basic + " " + base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", ba.userName, ba.password)))
+
+ return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization()
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go
index cda1e180a..02d011961 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go
@@ -26,6 +26,7 @@ import (
"time"
"github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/tracing"
)
const (
@@ -44,24 +45,14 @@ var pollingCodes = [...]int{http.StatusNoContent, http.StatusAccepted, http.Stat
// Future provides a mechanism to access the status and results of an asynchronous request.
// Since futures are stateful they should be passed by value to avoid race conditions.
type Future struct {
- req *http.Request // legacy
- pt pollingTracker
-}
-
-// NewFuture returns a new Future object initialized with the specified request.
-// Deprecated: Please use NewFutureFromResponse instead.
-func NewFuture(req *http.Request) Future {
- return Future{req: req}
+ pt pollingTracker
}
// NewFutureFromResponse returns a new Future object initialized
// with the initial response from an asynchronous operation.
func NewFutureFromResponse(resp *http.Response) (Future, error) {
pt, err := createPollingTracker(resp)
- if err != nil {
- return Future{}, err
- }
- return Future{pt: pt}, nil
+ return Future{pt: pt}, err
}
// Response returns the last HTTP response.
@@ -88,29 +79,25 @@ func (f Future) PollingMethod() PollingMethodType {
return f.pt.pollingMethod()
}
-// Done queries the service to see if the operation has completed.
-func (f *Future) Done(sender autorest.Sender) (bool, error) {
- // support for legacy Future implementation
- if f.req != nil {
- resp, err := sender.Do(f.req)
- if err != nil {
- return false, err
+// DoneWithContext queries the service to see if the operation has completed.
+func (f *Future) DoneWithContext(ctx context.Context, sender autorest.Sender) (done bool, err error) {
+ ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.DoneWithContext")
+ defer func() {
+ sc := -1
+ resp := f.Response()
+ if resp != nil {
+ sc = resp.StatusCode
}
- pt, err := createPollingTracker(resp)
- if err != nil {
- return false, err
- }
- f.pt = pt
- f.req = nil
- }
- // end legacy
+ tracing.EndSpan(ctx, sc, err)
+ }()
+
if f.pt == nil {
return false, autorest.NewError("Future", "Done", "future is not initialized")
}
if f.pt.hasTerminated() {
return true, f.pt.pollingError()
}
- if err := f.pt.pollForStatus(sender); err != nil {
+ if err := f.pt.pollForStatus(ctx, sender); err != nil {
return false, err
}
if err := f.pt.checkForErrors(); err != nil {
@@ -119,7 +106,10 @@ func (f *Future) Done(sender autorest.Sender) (bool, error) {
if err := f.pt.updatePollingState(f.pt.provisioningStateApplicable()); err != nil {
return false, err
}
- if err := f.pt.updateHeaders(); err != nil {
+ if err := f.pt.initPollingMethod(); err != nil {
+ return false, err
+ }
+ if err := f.pt.updatePollingMethod(); err != nil {
return false, err
}
return f.pt.hasTerminated(), f.pt.pollingError()
@@ -151,24 +141,35 @@ func (f Future) GetPollingDelay() (time.Duration, bool) {
return d, true
}
-// WaitForCompletion will return when one of the following conditions is met: the long
-// running operation has completed, the provided context is cancelled, or the client's
-// polling duration has been exceeded. It will retry failed polling attempts based on
-// the retry value defined in the client up to the maximum retry attempts.
-// Deprecated: Please use WaitForCompletionRef() instead.
-func (f Future) WaitForCompletion(ctx context.Context, client autorest.Client) error {
- return f.WaitForCompletionRef(ctx, client)
-}
-
// WaitForCompletionRef will return when one of the following conditions is met: the long
// running operation has completed, the provided context is cancelled, or the client's
// polling duration has been exceeded. It will retry failed polling attempts based on
// the retry value defined in the client up to the maximum retry attempts.
-func (f *Future) WaitForCompletionRef(ctx context.Context, client autorest.Client) error {
- ctx, cancel := context.WithTimeout(ctx, client.PollingDuration)
- defer cancel()
- done, err := f.Done(client)
- for attempts := 0; !done; done, err = f.Done(client) {
+// If no deadline is specified in the context then the client.PollingDuration will be
+// used to determine if a default deadline should be used.
+// If PollingDuration is greater than zero the value will be used as the context's timeout.
+// If PollingDuration is zero then no default deadline will be used.
+func (f *Future) WaitForCompletionRef(ctx context.Context, client autorest.Client) (err error) {
+ ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.WaitForCompletionRef")
+ defer func() {
+ sc := -1
+ resp := f.Response()
+ if resp != nil {
+ sc = resp.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ cancelCtx := ctx
+ // if the provided context already has a deadline don't override it
+ _, hasDeadline := ctx.Deadline()
+ if d := client.PollingDuration; !hasDeadline && d != 0 {
+ var cancel context.CancelFunc
+ cancelCtx, cancel = context.WithTimeout(ctx, d)
+ defer cancel()
+ }
+
+ done, err := f.DoneWithContext(ctx, client)
+ for attempts := 0; !done; done, err = f.DoneWithContext(ctx, client) {
if attempts >= client.RetryAttempts {
return autorest.NewErrorWithError(err, "Future", "WaitForCompletion", f.pt.latestResponse(), "the number of retries has been exceeded")
}
@@ -192,12 +193,12 @@ func (f *Future) WaitForCompletionRef(ctx context.Context, client autorest.Clien
attempts++
}
// wait until the delay elapses or the context is cancelled
- delayElapsed := autorest.DelayForBackoff(delay, delayAttempt, ctx.Done())
+ delayElapsed := autorest.DelayForBackoff(delay, delayAttempt, cancelCtx.Done())
if !delayElapsed {
- return autorest.NewErrorWithError(ctx.Err(), "Future", "WaitForCompletion", f.pt.latestResponse(), "context has been cancelled")
+ return autorest.NewErrorWithError(cancelCtx.Err(), "Future", "WaitForCompletion", f.pt.latestResponse(), "context has been cancelled")
}
}
- return err
+ return
}
// MarshalJSON implements the json.Marshaler interface.
@@ -264,7 +265,7 @@ type pollingTracker interface {
// these methods can differ per tracker
// checks the response headers and status code to determine the polling mechanism
- updateHeaders() error
+ updatePollingMethod() error
// checks the response for tracker-specific error conditions
checkForErrors() error
@@ -274,11 +275,15 @@ type pollingTracker interface {
// methods common to all trackers
+ // initializes a tracker's polling URL and method, called for each iteration.
+ // these values can be overridden by each polling tracker as required.
+ initPollingMethod() error
+
// initializes the tracker's internal state, call this when the tracker is created
initializeState() error
// makes an HTTP request to check the status of the LRO
- pollForStatus(sender autorest.Sender) error
+ pollForStatus(ctx context.Context, sender autorest.Sender) error
// updates internal tracker state, call this after each call to pollForStatus
updatePollingState(provStateApl bool) error
@@ -348,6 +353,10 @@ func (pt *pollingTrackerBase) initializeState() error {
case http.StatusOK:
if ps := pt.getProvisioningState(); ps != nil {
pt.State = *ps
+ if pt.hasFailed() {
+ pt.updateErrorFromResponse()
+ return pt.pollingError()
+ }
} else {
pt.State = operationSucceeded
}
@@ -364,8 +373,9 @@ func (pt *pollingTrackerBase) initializeState() error {
default:
pt.State = operationFailed
pt.updateErrorFromResponse()
+ return pt.pollingError()
}
- return nil
+ return pt.initPollingMethod()
}
func (pt pollingTrackerBase) getProvisioningState() *string {
@@ -387,6 +397,10 @@ func (pt *pollingTrackerBase) updateRawBody() error {
if err != nil {
return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to read response body")
}
+ // observed in 204 responses over HTTP/2.0; the content length is -1 but body is empty
+ if len(b) == 0 {
+ return nil
+ }
// put the body back so it's available to other callers
pt.resp.Body = ioutil.NopCloser(bytes.NewReader(b))
if err = json.Unmarshal(b, &pt.rawBody); err != nil {
@@ -396,15 +410,13 @@ func (pt *pollingTrackerBase) updateRawBody() error {
return nil
}
-func (pt *pollingTrackerBase) pollForStatus(sender autorest.Sender) error {
+func (pt *pollingTrackerBase) pollForStatus(ctx context.Context, sender autorest.Sender) error {
req, err := http.NewRequest(http.MethodGet, pt.URI, nil)
if err != nil {
return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to create HTTP request")
}
- // attach the context from the original request if available (it will be absent for deserialized futures)
- if pt.resp != nil {
- req = req.WithContext(pt.resp.Request.Context())
- }
+
+ req = req.WithContext(ctx)
pt.resp, err = sender.Do(req)
if err != nil {
return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to send HTTP request")
@@ -416,12 +428,14 @@ func (pt *pollingTrackerBase) pollForStatus(sender autorest.Sender) error {
} else {
// check response body for error content
pt.updateErrorFromResponse()
+ err = pt.pollingError()
}
return err
}
// attempts to unmarshal a ServiceError type from the response body.
// if that fails then make a best attempt at creating something meaningful.
+// NOTE: this assumes that the async operation has failed.
func (pt *pollingTrackerBase) updateErrorFromResponse() {
var err error
if pt.resp.ContentLength != 0 {
@@ -431,8 +445,7 @@ func (pt *pollingTrackerBase) updateErrorFromResponse() {
re := respErr{}
defer pt.resp.Body.Close()
var b []byte
- b, err = ioutil.ReadAll(pt.resp.Body)
- if err != nil {
+ if b, err = ioutil.ReadAll(pt.resp.Body); err != nil || len(b) == 0 {
goto Default
}
if err = json.Unmarshal(b, &re); err != nil {
@@ -445,20 +458,29 @@ func (pt *pollingTrackerBase) updateErrorFromResponse() {
goto Default
}
}
- if re.ServiceError != nil {
+ // the unmarshaller will ensure re.ServiceError is non-nil
+ // even if there was no content unmarshalled so check the code.
+ if re.ServiceError.Code != "" {
pt.Err = re.ServiceError
return
}
}
Default:
se := &ServiceError{
- Code: fmt.Sprintf("HTTP status code %v", pt.resp.StatusCode),
- Message: pt.resp.Status,
+ Code: pt.pollingStatus(),
+ Message: "The async operation failed.",
}
if err != nil {
se.InnerError = make(map[string]interface{})
se.InnerError["unmarshalError"] = err.Error()
}
+ // stick the response body into the error object in hopes
+ // it contains something useful to help diagnose the failure.
+ if len(pt.rawBody) > 0 {
+ se.AdditionalInfo = []map[string]interface{}{
+ pt.rawBody,
+ }
+ }
pt.Err = se
}
@@ -538,13 +560,33 @@ func (pt pollingTrackerBase) baseCheckForErrors() error {
return nil
}
+// default initialization of polling URL/method. each verb tracker will update this as required.
+func (pt *pollingTrackerBase) initPollingMethod() error {
+ if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil {
+ return err
+ } else if ao != "" {
+ pt.URI = ao
+ pt.Pm = PollingAsyncOperation
+ return nil
+ }
+ if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
+ return err
+ } else if lh != "" {
+ pt.URI = lh
+ pt.Pm = PollingLocation
+ return nil
+ }
+ // it's ok if we didn't find a polling header, this will be handled elsewhere
+ return nil
+}
+
// DELETE
type pollingTrackerDelete struct {
pollingTrackerBase
}
-func (pt *pollingTrackerDelete) updateHeaders() error {
+func (pt *pollingTrackerDelete) updatePollingMethod() error {
// for 201 the Location header is required
if pt.resp.StatusCode == http.StatusCreated {
if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
@@ -600,7 +642,7 @@ type pollingTrackerPatch struct {
pollingTrackerBase
}
-func (pt *pollingTrackerPatch) updateHeaders() error {
+func (pt *pollingTrackerPatch) updatePollingMethod() error {
// by default we can use the original URL for polling and final GET
if pt.URI == "" {
pt.URI = pt.resp.Request.URL.String()
@@ -621,7 +663,7 @@ func (pt *pollingTrackerPatch) updateHeaders() error {
}
}
// for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
- // note the absense of the "final GET" mechanism for PATCH
+ // note the absence of the "final GET" mechanism for PATCH
if pt.resp.StatusCode == http.StatusAccepted {
ao, err := getURLFromAsyncOpHeader(pt.resp)
if err != nil {
@@ -658,7 +700,7 @@ type pollingTrackerPost struct {
pollingTrackerBase
}
-func (pt *pollingTrackerPost) updateHeaders() error {
+func (pt *pollingTrackerPost) updatePollingMethod() error {
// 201 requires Location header
if pt.resp.StatusCode == http.StatusCreated {
if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
@@ -714,7 +756,7 @@ type pollingTrackerPut struct {
pollingTrackerBase
}
-func (pt *pollingTrackerPut) updateHeaders() error {
+func (pt *pollingTrackerPut) updatePollingMethod() error {
// by default we can use the original URL for polling and final GET
if pt.URI == "" {
pt.URI = pt.resp.Request.URL.String()
@@ -752,8 +794,6 @@ func (pt *pollingTrackerPut) updateHeaders() error {
pt.URI = lh
pt.Pm = PollingLocation
}
- // when both headers are returned we use the value in the Location header for the final GET
- pt.FinalGetURI = lh
}
// make sure a polling URL was found
if pt.URI == "" {
@@ -808,7 +848,7 @@ func createPollingTracker(resp *http.Response) (pollingTracker, error) {
// this initializes the polling header values, we do this during creation in case the
// initial response send us invalid values; this way the API call will return a non-nil
// error (not doing this means the error shows up in Future.Done)
- return pt, pt.updateHeaders()
+ return pt, pt.updatePollingMethod()
}
// gets the polling URL from the Azure-AsyncOperation header.
@@ -843,43 +883,6 @@ func isValidURL(s string) bool {
return err == nil && u.IsAbs()
}
-// DoPollForAsynchronous returns a SendDecorator that polls if the http.Response is for an Azure
-// long-running operation. It will delay between requests for the duration specified in the
-// RetryAfter header or, if the header is absent, the passed delay. Polling may be canceled via
-// the context associated with the http.Request.
-// Deprecated: Prefer using Futures to allow for non-blocking async operations.
-func DoPollForAsynchronous(delay time.Duration) autorest.SendDecorator {
- return func(s autorest.Sender) autorest.Sender {
- return autorest.SenderFunc(func(r *http.Request) (*http.Response, error) {
- resp, err := s.Do(r)
- if err != nil {
- return resp, err
- }
- if !autorest.ResponseHasStatusCode(resp, pollingCodes[:]...) {
- return resp, nil
- }
- future, err := NewFutureFromResponse(resp)
- if err != nil {
- return resp, err
- }
- // retry until either the LRO completes or we receive an error
- var done bool
- for done, err = future.Done(s); !done && err == nil; done, err = future.Done(s) {
- // check for Retry-After delay, if not present use the specified polling delay
- if pd, ok := future.GetPollingDelay(); ok {
- delay = pd
- }
- // wait until the delay elapses or the context is cancelled
- if delayElapsed := autorest.DelayForBackoff(delay, 0, r.Context().Done()); !delayElapsed {
- return future.Response(),
- autorest.NewErrorWithError(r.Context().Err(), "azure", "DoPollForAsynchronous", future.Response(), "context has been cancelled")
- }
- }
- return future.Response(), err
- })
- }
-}
-
// PollingMethodType defines a type used for enumerating polling mechanisms.
type PollingMethodType string
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
index a702ffe75..3a0a439ff 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
@@ -44,11 +44,12 @@ const (
// ServiceError encapsulates the error response from an Azure service.
// It adhears to the OData v4 specification for error responses.
type ServiceError struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Target *string `json:"target"`
- Details []map[string]interface{} `json:"details"`
- InnerError map[string]interface{} `json:"innererror"`
+ Code string `json:"code"`
+ Message string `json:"message"`
+ Target *string `json:"target"`
+ Details []map[string]interface{} `json:"details"`
+ InnerError map[string]interface{} `json:"innererror"`
+ AdditionalInfo []map[string]interface{} `json:"additionalInfo"`
}
func (se ServiceError) Error() string {
@@ -74,6 +75,14 @@ func (se ServiceError) Error() string {
result += fmt.Sprintf(" InnerError=%v", string(d))
}
+ if se.AdditionalInfo != nil {
+ d, err := json.Marshal(se.AdditionalInfo)
+ if err != nil {
+ result += fmt.Sprintf(" AdditionalInfo=%v", se.AdditionalInfo)
+ }
+ result += fmt.Sprintf(" AdditionalInfo=%v", string(d))
+ }
+
return result
}
@@ -86,44 +95,47 @@ func (se *ServiceError) UnmarshalJSON(b []byte) error {
// http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091
type serviceError1 struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Target *string `json:"target"`
- Details []map[string]interface{} `json:"details"`
- InnerError map[string]interface{} `json:"innererror"`
+ Code string `json:"code"`
+ Message string `json:"message"`
+ Target *string `json:"target"`
+ Details []map[string]interface{} `json:"details"`
+ InnerError map[string]interface{} `json:"innererror"`
+ AdditionalInfo []map[string]interface{} `json:"additionalInfo"`
}
type serviceError2 struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Target *string `json:"target"`
- Details map[string]interface{} `json:"details"`
- InnerError map[string]interface{} `json:"innererror"`
+ Code string `json:"code"`
+ Message string `json:"message"`
+ Target *string `json:"target"`
+ Details map[string]interface{} `json:"details"`
+ InnerError map[string]interface{} `json:"innererror"`
+ AdditionalInfo []map[string]interface{} `json:"additionalInfo"`
}
se1 := serviceError1{}
err := json.Unmarshal(b, &se1)
if err == nil {
- se.populate(se1.Code, se1.Message, se1.Target, se1.Details, se1.InnerError)
+ se.populate(se1.Code, se1.Message, se1.Target, se1.Details, se1.InnerError, se1.AdditionalInfo)
return nil
}
se2 := serviceError2{}
err = json.Unmarshal(b, &se2)
if err == nil {
- se.populate(se2.Code, se2.Message, se2.Target, nil, se2.InnerError)
+ se.populate(se2.Code, se2.Message, se2.Target, nil, se2.InnerError, se2.AdditionalInfo)
se.Details = append(se.Details, se2.Details)
return nil
}
return err
}
-func (se *ServiceError) populate(code, message string, target *string, details []map[string]interface{}, inner map[string]interface{}) {
+func (se *ServiceError) populate(code, message string, target *string, details []map[string]interface{}, inner map[string]interface{}, additional []map[string]interface{}) {
se.Code = code
se.Message = message
se.Target = target
se.Details = details
se.InnerError = inner
+ se.AdditionalInfo = additional
}
// RequestError describes an error response returned by Azure service.
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
index 7e41f7fd9..cdde41418 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
@@ -22,9 +22,14 @@ import (
"strings"
)
-// EnvironmentFilepathName captures the name of the environment variable containing the path to the file
-// to be used while populating the Azure Environment.
-const EnvironmentFilepathName = "AZURE_ENVIRONMENT_FILEPATH"
+const (
+ // EnvironmentFilepathName captures the name of the environment variable containing the path to the file
+ // to be used while populating the Azure Environment.
+ EnvironmentFilepathName = "AZURE_ENVIRONMENT_FILEPATH"
+
+ // NotAvailable is used for endpoints and resource IDs that are not available for a given cloud.
+ NotAvailable = "N/A"
+)
var environments = map[string]Environment{
"AZURECHINACLOUD": ChinaCloud,
@@ -33,28 +38,39 @@ var environments = map[string]Environment{
"AZUREUSGOVERNMENTCLOUD": USGovernmentCloud,
}
+// ResourceIdentifier contains a set of Azure resource IDs.
+type ResourceIdentifier struct {
+ Graph string `json:"graph"`
+ KeyVault string `json:"keyVault"`
+ Datalake string `json:"datalake"`
+ Batch string `json:"batch"`
+ OperationalInsights string `json:"operationalInsights"`
+}
+
// Environment represents a set of endpoints for each of Azure's Clouds.
type Environment struct {
- Name string `json:"name"`
- ManagementPortalURL string `json:"managementPortalURL"`
- PublishSettingsURL string `json:"publishSettingsURL"`
- ServiceManagementEndpoint string `json:"serviceManagementEndpoint"`
- ResourceManagerEndpoint string `json:"resourceManagerEndpoint"`
- ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"`
- GalleryEndpoint string `json:"galleryEndpoint"`
- KeyVaultEndpoint string `json:"keyVaultEndpoint"`
- GraphEndpoint string `json:"graphEndpoint"`
- ServiceBusEndpoint string `json:"serviceBusEndpoint"`
- BatchManagementEndpoint string `json:"batchManagementEndpoint"`
- StorageEndpointSuffix string `json:"storageEndpointSuffix"`
- SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"`
- TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"`
- KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"`
- ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"`
- ServiceManagementVMDNSSuffix string `json:"serviceManagementVMDNSSuffix"`
- ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix"`
- ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"`
- TokenAudience string `json:"tokenAudience"`
+ Name string `json:"name"`
+ ManagementPortalURL string `json:"managementPortalURL"`
+ PublishSettingsURL string `json:"publishSettingsURL"`
+ ServiceManagementEndpoint string `json:"serviceManagementEndpoint"`
+ ResourceManagerEndpoint string `json:"resourceManagerEndpoint"`
+ ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"`
+ GalleryEndpoint string `json:"galleryEndpoint"`
+ KeyVaultEndpoint string `json:"keyVaultEndpoint"`
+ GraphEndpoint string `json:"graphEndpoint"`
+ ServiceBusEndpoint string `json:"serviceBusEndpoint"`
+ BatchManagementEndpoint string `json:"batchManagementEndpoint"`
+ StorageEndpointSuffix string `json:"storageEndpointSuffix"`
+ SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"`
+ TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"`
+ KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"`
+ ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"`
+ ServiceManagementVMDNSSuffix string `json:"serviceManagementVMDNSSuffix"`
+ ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix"`
+ ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"`
+ CosmosDBDNSSuffix string `json:"cosmosDBDNSSuffix"`
+ TokenAudience string `json:"tokenAudience"`
+ ResourceIdentifiers ResourceIdentifier `json:"resourceIdentifiers"`
}
var (
@@ -79,7 +95,15 @@ var (
ServiceManagementVMDNSSuffix: "cloudapp.net",
ResourceManagerVMDNSSuffix: "cloudapp.azure.com",
ContainerRegistryDNSSuffix: "azurecr.io",
+ CosmosDBDNSSuffix: "documents.azure.com",
TokenAudience: "https://management.azure.com/",
+ ResourceIdentifiers: ResourceIdentifier{
+ Graph: "https://graph.windows.net/",
+ KeyVault: "https://vault.azure.net",
+ Datalake: "https://datalake.azure.net/",
+ Batch: "https://batch.core.windows.net/",
+ OperationalInsights: "https://api.loganalytics.io",
+ },
}
// USGovernmentCloud is the cloud environment for the US Government
@@ -102,8 +126,16 @@ var (
ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net",
ServiceManagementVMDNSSuffix: "usgovcloudapp.net",
ResourceManagerVMDNSSuffix: "cloudapp.windowsazure.us",
- ContainerRegistryDNSSuffix: "azurecr.io",
+ ContainerRegistryDNSSuffix: "azurecr.us",
+ CosmosDBDNSSuffix: "documents.azure.us",
TokenAudience: "https://management.usgovcloudapi.net/",
+ ResourceIdentifiers: ResourceIdentifier{
+ Graph: "https://graph.windows.net/",
+ KeyVault: "https://vault.usgovcloudapi.net",
+ Datalake: NotAvailable,
+ Batch: "https://batch.core.usgovcloudapi.net/",
+ OperationalInsights: "https://api.loganalytics.us",
+ },
}
// ChinaCloud is the cloud environment operated in China
@@ -126,8 +158,16 @@ var (
ServiceBusEndpointSuffix: "servicebus.chinacloudapi.cn",
ServiceManagementVMDNSSuffix: "chinacloudapp.cn",
ResourceManagerVMDNSSuffix: "cloudapp.azure.cn",
- ContainerRegistryDNSSuffix: "azurecr.io",
+ ContainerRegistryDNSSuffix: "azurecr.cn",
+ CosmosDBDNSSuffix: "documents.azure.cn",
TokenAudience: "https://management.chinacloudapi.cn/",
+ ResourceIdentifiers: ResourceIdentifier{
+ Graph: "https://graph.chinacloudapi.cn/",
+ KeyVault: "https://vault.azure.cn",
+ Datalake: NotAvailable,
+ Batch: "https://batch.chinacloudapi.cn/",
+ OperationalInsights: NotAvailable,
+ },
}
// GermanCloud is the cloud environment operated in Germany
@@ -150,8 +190,16 @@ var (
ServiceBusEndpointSuffix: "servicebus.cloudapi.de",
ServiceManagementVMDNSSuffix: "azurecloudapp.de",
ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de",
- ContainerRegistryDNSSuffix: "azurecr.io",
+ ContainerRegistryDNSSuffix: NotAvailable,
+ CosmosDBDNSSuffix: "documents.microsoftazure.de",
TokenAudience: "https://management.microsoftazure.de/",
+ ResourceIdentifiers: ResourceIdentifier{
+ Graph: "https://graph.cloudapi.de/",
+ KeyVault: "https://vault.microsoftazure.de",
+ Datalake: NotAvailable,
+ Batch: "https://batch.cloudapi.de/",
+ OperationalInsights: NotAvailable,
+ },
}
)
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
index bd34f0ed5..86ce9f2b5 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
@@ -140,8 +140,8 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError
}
// poll for registered provisioning state
- now := time.Now()
- for err == nil && time.Since(now) < client.PollingDuration {
+ registrationStartTime := time.Now()
+ for err == nil && (client.PollingDuration == 0 || (client.PollingDuration != 0 && time.Since(registrationStartTime) < client.PollingDuration)) {
// taken from the resources SDK
// https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L45
preparer := autorest.CreatePreparer(
@@ -183,7 +183,7 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError
return originalReq.Context().Err()
}
}
- if !(time.Since(now) < client.PollingDuration) {
+ if client.PollingDuration != 0 && !(time.Since(registrationStartTime) < client.PollingDuration) {
return errors.New("polling for resource provider registration has exceeded the polling duration")
}
return err
diff --git a/vendor/github.com/Azure/go-autorest/autorest/client.go b/vendor/github.com/Azure/go-autorest/autorest/client.go
index 4e92dcad0..cfc7ed757 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/client.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/client.go
@@ -16,14 +16,18 @@ package autorest
import (
"bytes"
+ "crypto/tls"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
- "runtime"
+ "strings"
"time"
+
+ "github.com/Azure/go-autorest/logger"
+ "github.com/Azure/go-autorest/tracing"
)
const (
@@ -41,15 +45,6 @@ const (
)
var (
- // defaultUserAgent builds a string containing the Go version, system archityecture and OS,
- // and the go-autorest version.
- defaultUserAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s",
- runtime.Version(),
- runtime.GOARCH,
- runtime.GOOS,
- Version(),
- )
-
// StatusCodesForRetry are a defined group of status code for which the client will retry
StatusCodesForRetry = []int{
http.StatusRequestTimeout, // 408
@@ -153,6 +148,7 @@ type Client struct {
PollingDelay time.Duration
// PollingDuration sets the maximum polling time after which an error is returned.
+ // Setting this to zero will use the provided context to control the duration.
PollingDuration time.Duration
// RetryAttempts sets the default number of retry attempts for client.
@@ -174,14 +170,32 @@ type Client struct {
// NewClientWithUserAgent returns an instance of a Client with the UserAgent set to the passed
// string.
func NewClientWithUserAgent(ua string) Client {
+ return newClient(ua, tls.RenegotiateNever)
+}
+
+// ClientOptions contains various Client configuration options.
+type ClientOptions struct {
+ // UserAgent is an optional user-agent string to append to the default user agent.
+ UserAgent string
+
+ // Renegotiation is an optional setting to control client-side TLS renegotiation.
+ Renegotiation tls.RenegotiationSupport
+}
+
+// NewClientWithOptions returns an instance of a Client with the specified values.
+func NewClientWithOptions(options ClientOptions) Client {
+ return newClient(options.UserAgent, options.Renegotiation)
+}
+
+func newClient(ua string, renegotiation tls.RenegotiationSupport) Client {
c := Client{
PollingDelay: DefaultPollingDelay,
PollingDuration: DefaultPollingDuration,
RetryAttempts: DefaultRetryAttempts,
RetryDuration: DefaultRetryDuration,
- UserAgent: defaultUserAgent,
+ UserAgent: UserAgent(),
}
- c.Sender = c.sender()
+ c.Sender = c.sender(renegotiation)
c.AddToUserAgent(ua)
return c
}
@@ -216,18 +230,48 @@ func (c Client) Do(r *http.Request) (*http.Response, error) {
}
return resp, NewErrorWithError(err, "autorest/Client", "Do", nil, "Preparing request failed")
}
-
- resp, err := SendWithSender(c.sender(), r)
+ logger.Instance.WriteRequest(r, logger.Filter{
+ Header: func(k string, v []string) (bool, []string) {
+ // remove the auth token from the log
+ if strings.EqualFold(k, "Authorization") || strings.EqualFold(k, "Ocp-Apim-Subscription-Key") {
+ v = []string{"**REDACTED**"}
+ }
+ return true, v
+ },
+ })
+ resp, err := SendWithSender(c.sender(tls.RenegotiateNever), r)
+ logger.Instance.WriteResponse(resp, logger.Filter{})
Respond(resp, c.ByInspecting())
return resp, err
}
// sender returns the Sender to which to send requests.
-func (c Client) sender() Sender {
+func (c Client) sender(renengotiation tls.RenegotiationSupport) Sender {
if c.Sender == nil {
+ // Use behaviour compatible with DefaultTransport, but require TLS minimum version.
+ var defaultTransport = http.DefaultTransport.(*http.Transport)
+ transport := tracing.Transport
+ // for non-default values of TLS renegotiation create a new tracing transport.
+ // updating tracing.Transport affects all clients which is not what we want.
+ if renengotiation != tls.RenegotiateNever {
+ transport = tracing.NewTransport()
+ }
+ transport.Base = &http.Transport{
+ Proxy: defaultTransport.Proxy,
+ DialContext: defaultTransport.DialContext,
+ MaxIdleConns: defaultTransport.MaxIdleConns,
+ IdleConnTimeout: defaultTransport.IdleConnTimeout,
+ TLSHandshakeTimeout: defaultTransport.TLSHandshakeTimeout,
+ ExpectContinueTimeout: defaultTransport.ExpectContinueTimeout,
+ TLSClientConfig: &tls.Config{
+ MinVersion: tls.VersionTLS12,
+ Renegotiation: renengotiation,
+ },
+ }
j, _ := cookiejar.New(nil)
- return &http.Client{Jar: j}
+ return &http.Client{Jar: j, Transport: transport}
}
+
return c.Sender
}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/sender.go b/vendor/github.com/Azure/go-autorest/autorest/sender.go
index cacbd8157..6665d7c00 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/sender.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/sender.go
@@ -21,6 +21,8 @@ import (
"net/http"
"strconv"
"time"
+
+ "github.com/Azure/go-autorest/tracing"
)
// Sender is the interface that wraps the Do method to send HTTP requests.
@@ -38,7 +40,7 @@ func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) {
return sf(r)
}
-// SendDecorator takes and possibily decorates, by wrapping, a Sender. Decorators may affect the
+// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the
// http.Request and pass it along or, first, pass the http.Request along then react to the
// http.Response result.
type SendDecorator func(Sender) Sender
@@ -68,7 +70,7 @@ func DecorateSender(s Sender, decorators ...SendDecorator) Sender {
//
// Send will not poll or retry requests.
func Send(r *http.Request, decorators ...SendDecorator) (*http.Response, error) {
- return SendWithSender(&http.Client{}, r, decorators...)
+ return SendWithSender(&http.Client{Transport: tracing.Transport}, r, decorators...)
}
// SendWithSender sends the passed http.Request, through the provided Sender, returning the
@@ -216,8 +218,7 @@ func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) Se
return SenderFunc(func(r *http.Request) (resp *http.Response, err error) {
rr := NewRetriableRequest(r)
// Increment to add the first call (attempts denotes number of retries)
- attempts++
- for attempt := 0; attempt < attempts; {
+ for attempt := 0; attempt < attempts+1; {
err = rr.Prepare()
if err != nil {
return resp, err
@@ -234,7 +235,7 @@ func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) Se
}
delayed := DelayWithRetryAfter(resp, r.Context().Done())
if !delayed && !DelayForBackoff(backoff, attempt, r.Context().Done()) {
- return nil, r.Context().Err()
+ return resp, r.Context().Err()
}
// don't count a 429 against the number of attempts
// so that we continue to retry until it succeeds
diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility.go b/vendor/github.com/Azure/go-autorest/autorest/utility.go
index bfddd90b5..08cf11c11 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/utility.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/utility.go
@@ -157,7 +157,7 @@ func AsStringSlice(s interface{}) ([]string, error) {
}
// String method converts interface v to string. If interface is a list, it
-// joins list elements using the seperator. Note that only sep[0] will be used for
+// joins list elements using the separator. Note that only sep[0] will be used for
// joining if any separator is specified.
func String(v interface{}, sep ...string) string {
if len(sep) == 0 {
diff --git a/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go b/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go
index ae987f8fa..65899b69b 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go
@@ -398,11 +398,3 @@ func toInt64(v interface{}) (int64, bool) {
}
return 0, false
}
-
-// NewErrorWithValidationError appends package type and method name in
-// validation error.
-//
-// Deprecated: Please use validation.NewError() instead.
-func NewErrorWithValidationError(err error, packageType, method string) error {
- return NewError(packageType, method, err.Error())
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go
index e32cd68fe..0c8d9d224 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/version.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/version.go
@@ -14,7 +14,28 @@ package autorest
// See the License for the specific language governing permissions and
// limitations under the License.
+import (
+ "fmt"
+ "runtime"
+)
+
+const number = "v12.0.0"
+
+var (
+ userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s",
+ runtime.Version(),
+ runtime.GOARCH,
+ runtime.GOOS,
+ number,
+ )
+)
+
+// UserAgent returns a string containing the Go version, system architecture and OS, and the go-autorest version.
+func UserAgent() string {
+ return userAgent
+}
+
// Version returns the semantic version (see http://semver.org).
func Version() string {
- return "v10.12.0"
+ return number
}
diff --git a/vendor/github.com/Azure/go-autorest/logger/logger.go b/vendor/github.com/Azure/go-autorest/logger/logger.go
new file mode 100644
index 000000000..da09f394c
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/logger/logger.go
@@ -0,0 +1,328 @@
+package logger
+
+// Copyright 2017 Microsoft Corporation
+//
+// 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.
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "sync"
+ "time"
+)
+
+// LevelType tells a logger the minimum level to log. When code reports a log entry,
+// the LogLevel indicates the level of the log entry. The logger only records entries
+// whose level is at least the level it was told to log. See the Log* constants.
+// For example, if a logger is configured with LogError, then LogError, LogPanic,
+// and LogFatal entries will be logged; lower level entries are ignored.
+type LevelType uint32
+
+const (
+ // LogNone tells a logger not to log any entries passed to it.
+ LogNone LevelType = iota
+
+ // LogFatal tells a logger to log all LogFatal entries passed to it.
+ LogFatal
+
+ // LogPanic tells a logger to log all LogPanic and LogFatal entries passed to it.
+ LogPanic
+
+ // LogError tells a logger to log all LogError, LogPanic and LogFatal entries passed to it.
+ LogError
+
+ // LogWarning tells a logger to log all LogWarning, LogError, LogPanic and LogFatal entries passed to it.
+ LogWarning
+
+ // LogInfo tells a logger to log all LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it.
+ LogInfo
+
+ // LogDebug tells a logger to log all LogDebug, LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it.
+ LogDebug
+)
+
+const (
+ logNone = "NONE"
+ logFatal = "FATAL"
+ logPanic = "PANIC"
+ logError = "ERROR"
+ logWarning = "WARNING"
+ logInfo = "INFO"
+ logDebug = "DEBUG"
+ logUnknown = "UNKNOWN"
+)
+
+// ParseLevel converts the specified string into the corresponding LevelType.
+func ParseLevel(s string) (lt LevelType, err error) {
+ switch strings.ToUpper(s) {
+ case logFatal:
+ lt = LogFatal
+ case logPanic:
+ lt = LogPanic
+ case logError:
+ lt = LogError
+ case logWarning:
+ lt = LogWarning
+ case logInfo:
+ lt = LogInfo
+ case logDebug:
+ lt = LogDebug
+ default:
+ err = fmt.Errorf("bad log level '%s'", s)
+ }
+ return
+}
+
+// String implements the stringer interface for LevelType.
+func (lt LevelType) String() string {
+ switch lt {
+ case LogNone:
+ return logNone
+ case LogFatal:
+ return logFatal
+ case LogPanic:
+ return logPanic
+ case LogError:
+ return logError
+ case LogWarning:
+ return logWarning
+ case LogInfo:
+ return logInfo
+ case LogDebug:
+ return logDebug
+ default:
+ return logUnknown
+ }
+}
+
+// Filter defines functions for filtering HTTP request/response content.
+type Filter struct {
+ // URL returns a potentially modified string representation of a request URL.
+ URL func(u *url.URL) string
+
+ // Header returns a potentially modified set of values for the specified key.
+ // To completely exclude the header key/values return false.
+ Header func(key string, val []string) (bool, []string)
+
+ // Body returns a potentially modified request/response body.
+ Body func(b []byte) []byte
+}
+
+func (f Filter) processURL(u *url.URL) string {
+ if f.URL == nil {
+ return u.String()
+ }
+ return f.URL(u)
+}
+
+func (f Filter) processHeader(k string, val []string) (bool, []string) {
+ if f.Header == nil {
+ return true, val
+ }
+ return f.Header(k, val)
+}
+
+func (f Filter) processBody(b []byte) []byte {
+ if f.Body == nil {
+ return b
+ }
+ return f.Body(b)
+}
+
+// Writer defines methods for writing to a logging facility.
+type Writer interface {
+ // Writeln writes the specified message with the standard log entry header and new-line character.
+ Writeln(level LevelType, message string)
+
+ // Writef writes the specified format specifier with the standard log entry header and no new-line character.
+ Writef(level LevelType, format string, a ...interface{})
+
+ // WriteRequest writes the specified HTTP request to the logger if the log level is greater than
+ // or equal to LogInfo. The request body, if set, is logged at level LogDebug or higher.
+ // Custom filters can be specified to exclude URL, header, and/or body content from the log.
+ // By default no request content is excluded.
+ WriteRequest(req *http.Request, filter Filter)
+
+ // WriteResponse writes the specified HTTP response to the logger if the log level is greater than
+ // or equal to LogInfo. The response body, if set, is logged at level LogDebug or higher.
+ // Custom filters can be specified to exclude URL, header, and/or body content from the log.
+ // By default no response content is excluded.
+ WriteResponse(resp *http.Response, filter Filter)
+}
+
+// Instance is the default log writer initialized during package init.
+// This can be replaced with a custom implementation as required.
+var Instance Writer
+
+// default log level
+var logLevel = LogNone
+
+// Level returns the value specified in AZURE_GO_AUTOREST_LOG_LEVEL.
+// If no value was specified the default value is LogNone.
+// Custom loggers can call this to retrieve the configured log level.
+func Level() LevelType {
+ return logLevel
+}
+
+func init() {
+ // separated for testing purposes
+ initDefaultLogger()
+}
+
+func initDefaultLogger() {
+ // init with nilLogger so callers don't have to do a nil check on Default
+ Instance = nilLogger{}
+ llStr := strings.ToLower(os.Getenv("AZURE_GO_SDK_LOG_LEVEL"))
+ if llStr == "" {
+ return
+ }
+ var err error
+ logLevel, err = ParseLevel(llStr)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "go-autorest: failed to parse log level: %s\n", err.Error())
+ return
+ }
+ if logLevel == LogNone {
+ return
+ }
+ // default to stderr
+ dest := os.Stderr
+ lfStr := os.Getenv("AZURE_GO_SDK_LOG_FILE")
+ if strings.EqualFold(lfStr, "stdout") {
+ dest = os.Stdout
+ } else if lfStr != "" {
+ lf, err := os.Create(lfStr)
+ if err == nil {
+ dest = lf
+ } else {
+ fmt.Fprintf(os.Stderr, "go-autorest: failed to create log file, using stderr: %s\n", err.Error())
+ }
+ }
+ Instance = fileLogger{
+ logLevel: logLevel,
+ mu: &sync.Mutex{},
+ logFile: dest,
+ }
+}
+
+// the nil logger does nothing
+type nilLogger struct{}
+
+func (nilLogger) Writeln(LevelType, string) {}
+
+func (nilLogger) Writef(LevelType, string, ...interface{}) {}
+
+func (nilLogger) WriteRequest(*http.Request, Filter) {}
+
+func (nilLogger) WriteResponse(*http.Response, Filter) {}
+
+// A File is used instead of a Logger so the stream can be flushed after every write.
+type fileLogger struct {
+ logLevel LevelType
+ mu *sync.Mutex // for synchronizing writes to logFile
+ logFile *os.File
+}
+
+func (fl fileLogger) Writeln(level LevelType, message string) {
+ fl.Writef(level, "%s\n", message)
+}
+
+func (fl fileLogger) Writef(level LevelType, format string, a ...interface{}) {
+ if fl.logLevel >= level {
+ fl.mu.Lock()
+ defer fl.mu.Unlock()
+ fmt.Fprintf(fl.logFile, "%s %s", entryHeader(level), fmt.Sprintf(format, a...))
+ fl.logFile.Sync()
+ }
+}
+
+func (fl fileLogger) WriteRequest(req *http.Request, filter Filter) {
+ if req == nil || fl.logLevel < LogInfo {
+ return
+ }
+ b := &bytes.Buffer{}
+ fmt.Fprintf(b, "%s REQUEST: %s %s\n", entryHeader(LogInfo), req.Method, filter.processURL(req.URL))
+ // dump headers
+ for k, v := range req.Header {
+ if ok, mv := filter.processHeader(k, v); ok {
+ fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ","))
+ }
+ }
+ if fl.shouldLogBody(req.Header, req.Body) {
+ // dump body
+ body, err := ioutil.ReadAll(req.Body)
+ if err == nil {
+ fmt.Fprintln(b, string(filter.processBody(body)))
+ if nc, ok := req.Body.(io.Seeker); ok {
+ // rewind to the beginning
+ nc.Seek(0, io.SeekStart)
+ } else {
+ // recreate the body
+ req.Body = ioutil.NopCloser(bytes.NewReader(body))
+ }
+ } else {
+ fmt.Fprintf(b, "failed to read body: %v\n", err)
+ }
+ }
+ fl.mu.Lock()
+ defer fl.mu.Unlock()
+ fmt.Fprint(fl.logFile, b.String())
+ fl.logFile.Sync()
+}
+
+func (fl fileLogger) WriteResponse(resp *http.Response, filter Filter) {
+ if resp == nil || fl.logLevel < LogInfo {
+ return
+ }
+ b := &bytes.Buffer{}
+ fmt.Fprintf(b, "%s RESPONSE: %d %s\n", entryHeader(LogInfo), resp.StatusCode, filter.processURL(resp.Request.URL))
+ // dump headers
+ for k, v := range resp.Header {
+ if ok, mv := filter.processHeader(k, v); ok {
+ fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ","))
+ }
+ }
+ if fl.shouldLogBody(resp.Header, resp.Body) {
+ // dump body
+ defer resp.Body.Close()
+ body, err := ioutil.ReadAll(resp.Body)
+ if err == nil {
+ fmt.Fprintln(b, string(filter.processBody(body)))
+ resp.Body = ioutil.NopCloser(bytes.NewReader(body))
+ } else {
+ fmt.Fprintf(b, "failed to read body: %v\n", err)
+ }
+ }
+ fl.mu.Lock()
+ defer fl.mu.Unlock()
+ fmt.Fprint(fl.logFile, b.String())
+ fl.logFile.Sync()
+}
+
+// returns true if the provided body should be included in the log
+func (fl fileLogger) shouldLogBody(header http.Header, body io.ReadCloser) bool {
+ ct := header.Get("Content-Type")
+ return fl.logLevel >= LogDebug && body != nil && !strings.Contains(ct, "application/octet-stream")
+}
+
+// creates standard header for log entries, it contains a timestamp and the log level
+func entryHeader(level LevelType) string {
+ // this format provides a fixed number of digits so the size of the timestamp is constant
+ return fmt.Sprintf("(%s) %s:", time.Now().Format("2006-01-02T15:04:05.0000000Z07:00"), level.String())
+}
diff --git a/vendor/github.com/Azure/go-autorest/tracing/LICENSE b/vendor/github.com/Azure/go-autorest/tracing/LICENSE
deleted file mode 100644
index b9d6a27ea..000000000
--- a/vendor/github.com/Azure/go-autorest/tracing/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- Copyright 2015 Microsoft Corporation
-
- 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.
diff --git a/vendor/github.com/Azure/go-autorest/tracing/go.mod b/vendor/github.com/Azure/go-autorest/tracing/go.mod
deleted file mode 100644
index b066b3e6e..000000000
--- a/vendor/github.com/Azure/go-autorest/tracing/go.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-module github.com/Azure/go-autorest/tracing
-
-go 1.12
-
-require (
- contrib.go.opencensus.io/exporter/ocagent v0.4.12
- go.opencensus.io v0.20.2
-)
diff --git a/vendor/github.com/Azure/go-autorest/tracing/go.sum b/vendor/github.com/Azure/go-autorest/tracing/go.sum
deleted file mode 100644
index 4e5548c91..000000000
--- a/vendor/github.com/Azure/go-autorest/tracing/go.sum
+++ /dev/null
@@ -1,130 +0,0 @@
-cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc=
-contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
-github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
-github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4=
-github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
-github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
-github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
-github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
-github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
-github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
-github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
-github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
-github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
-github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
-github.com/grpc-ecosystem/grpc-gateway v1.8.5 h1:2+KSC78XiO6Qy0hIjfc1OD9H+hsaJdJlb8Kqsd41CTE=
-github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
-github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
-github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
-github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
-github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
-github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
-github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
-github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
-github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
-go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk=
-go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
-golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
-golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8=
-google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
-google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk=
-google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
-google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM=
-google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
-gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
-gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
-gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/github.com/marstr/guid/.travis.yml b/vendor/github.com/marstr/guid/.travis.yml
deleted file mode 100644
index 35158ec53..000000000
--- a/vendor/github.com/marstr/guid/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-sudo: false
-
-language: go
-
-go:
- - 1.7
- - 1.8
-
-install:
- - go get -u github.com/golang/lint/golint
- - go get -u github.com/HewlettPackard/gas
-
-script:
- - golint --set_exit_status
- - go vet
- - go test -v -cover -race
- - go test -bench .
- - gas ./...
\ No newline at end of file
diff --git a/vendor/github.com/marstr/guid/LICENSE.txt b/vendor/github.com/marstr/guid/LICENSE.txt
deleted file mode 100644
index e18a0841a..000000000
--- a/vendor/github.com/marstr/guid/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2016 Martin Strobel
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/marstr/guid/README.md b/vendor/github.com/marstr/guid/README.md
deleted file mode 100644
index 355fad16d..000000000
--- a/vendor/github.com/marstr/guid/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-[![Build Status](https://travis-ci.org/marstr/guid.svg?branch=master)](https://travis-ci.org/marstr/guid)
-[![GoDoc](https://godoc.org/github.com/marstr/guid?status.svg)](https://godoc.org/github.com/marstr/guid)
-[![Go Report Card](https://goreportcard.com/badge/github.com/marstr/guid)](https://goreportcard.com/report/github.com/marstr/guid)
-
-# Guid
-Globally unique identifiers offer a quick means of generating non-colliding values across a distributed system. For this implemenation, [RFC 4122](http://ietf.org/rfc/rfc4122.txt) governs the desired behavior.
-
-## What's in a name?
-You have likely already noticed that RFC and some implementations refer to these structures as UUIDs (Universally Unique Identifiers), where as this project is annotated as GUIDs (Globally Unique Identifiers). The name Guid was selected to make clear this project's ties to the [.NET struct Guid.](https://msdn.microsoft.com/en-us/library/system.guid(v=vs.110).aspx) The most obvious relationship is the desire to have the same format specifiers available in this library's Format and Parse methods as .NET would have in its ToString and Parse methods.
-
-# Installation
-- Ensure you have the [Go Programming Language](https://golang.org/) installed on your system.
-- Run the command: `go get -u github.com/marstr/guid`
-
-# Contribution
-Contributions are welcome! Feel free to send Pull Requests. Continuous Integration will ensure that you have conformed to Go conventions. Please remember to add tests for your changes.
-
-# Versioning
-This library will adhere to the
-[Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html) specification. It may be worth noting this should allow for tools like [glide](https://glide.readthedocs.io/en/latest/) to pull in this library with ease.
-
-The Release Notes portion of this file will be updated to reflect the most recent major/minor updates, with the option to tag particular bug-fixes as well. Updates to the Release Notes for patches should be addative, where as major/minor updates should replace the previous version. If one desires to see the release notes for an older version, checkout that version of code and open this file.
-
-# Release Notes 1.1.*
-
-## v1.1.0
-Adding support for JSON marshaling and unmarshaling.
diff --git a/vendor/github.com/marstr/guid/guid.go b/vendor/github.com/marstr/guid/guid.go
deleted file mode 100644
index 51b038b75..000000000
--- a/vendor/github.com/marstr/guid/guid.go
+++ /dev/null
@@ -1,301 +0,0 @@
-package guid
-
-import (
- "bytes"
- "crypto/rand"
- "errors"
- "fmt"
- "net"
- "strings"
- "sync"
- "time"
-)
-
-// GUID is a unique identifier designed to virtually guarantee non-conflict between values generated
-// across a distributed system.
-type GUID struct {
- timeHighAndVersion uint16
- timeMid uint16
- timeLow uint32
- clockSeqHighAndReserved uint8
- clockSeqLow uint8
- node [6]byte
-}
-
-// Format enumerates the values that are supported by Parse and Format
-type Format string
-
-// These constants define the possible string formats available via this implementation of Guid.
-const (
- FormatB Format = "B" // {00000000-0000-0000-0000-000000000000}
- FormatD Format = "D" // 00000000-0000-0000-0000-000000000000
- FormatN Format = "N" // 00000000000000000000000000000000
- FormatP Format = "P" // (00000000-0000-0000-0000-000000000000)
- FormatX Format = "X" // {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
- FormatDefault Format = FormatD
-)
-
-// CreationStrategy enumerates the values that are supported for populating the bits of a new Guid.
-type CreationStrategy string
-
-// These constants define the possible creation strategies available via this implementation of Guid.
-const (
- CreationStrategyVersion1 CreationStrategy = "version1"
- CreationStrategyVersion2 CreationStrategy = "version2"
- CreationStrategyVersion3 CreationStrategy = "version3"
- CreationStrategyVersion4 CreationStrategy = "version4"
- CreationStrategyVersion5 CreationStrategy = "version5"
-)
-
-var emptyGUID GUID
-
-// NewGUID generates and returns a new globally unique identifier
-func NewGUID() GUID {
- result, err := version4()
- if err != nil {
- panic(err) //Version 4 (pseudo-random GUID) doesn't use anything that could fail.
- }
- return result
-}
-
-var knownStrategies = map[CreationStrategy]func() (GUID, error){
- CreationStrategyVersion1: version1,
- CreationStrategyVersion4: version4,
-}
-
-// NewGUIDs generates and returns a new globally unique identifier that conforms to the given strategy.
-func NewGUIDs(strategy CreationStrategy) (GUID, error) {
- if creator, present := knownStrategies[strategy]; present {
- result, err := creator()
- return result, err
- }
- return emptyGUID, errors.New("Unsupported CreationStrategy")
-}
-
-// Empty returns a copy of the default and empty GUID.
-func Empty() GUID {
- return emptyGUID
-}
-
-var knownFormats = map[Format]string{
- FormatN: "%08x%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x",
- FormatD: "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- FormatB: "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- FormatP: "(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
- FormatX: "{0x%08x,0x%04x,0x%04x,{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x}}",
-}
-
-// MarshalJSON writes a GUID as a JSON string.
-func (guid GUID) MarshalJSON() (marshaled []byte, err error) {
- buf := bytes.Buffer{}
-
- _, err = buf.WriteRune('"')
- buf.WriteString(guid.String())
- buf.WriteRune('"')
-
- marshaled = buf.Bytes()
- return
-}
-
-// Parse instantiates a GUID from a text representation of the same GUID.
-// This is the inverse of function family String()
-func Parse(value string) (GUID, error) {
- var guid GUID
- for _, fullFormat := range knownFormats {
- parity, err := fmt.Sscanf(
- value,
- fullFormat,
- &guid.timeLow,
- &guid.timeMid,
- &guid.timeHighAndVersion,
- &guid.clockSeqHighAndReserved,
- &guid.clockSeqLow,
- &guid.node[0],
- &guid.node[1],
- &guid.node[2],
- &guid.node[3],
- &guid.node[4],
- &guid.node[5])
- if parity == 11 && err == nil {
- return guid, err
- }
- }
- return emptyGUID, fmt.Errorf("\"%s\" is not in a recognized format", value)
-}
-
-// String returns a text representation of a GUID in the default format.
-func (guid GUID) String() string {
- return guid.Stringf(FormatDefault)
-}
-
-// Stringf returns a text representation of a GUID that conforms to the specified format.
-// If an unrecognized format is provided, the empty string is returned.
-func (guid GUID) Stringf(format Format) string {
- if format == "" {
- format = FormatDefault
- }
- fullFormat, present := knownFormats[format]
- if !present {
- return ""
- }
- return fmt.Sprintf(
- fullFormat,
- guid.timeLow,
- guid.timeMid,
- guid.timeHighAndVersion,
- guid.clockSeqHighAndReserved,
- guid.clockSeqLow,
- guid.node[0],
- guid.node[1],
- guid.node[2],
- guid.node[3],
- guid.node[4],
- guid.node[5])
-}
-
-// UnmarshalJSON parses a GUID from a JSON string token.
-func (guid *GUID) UnmarshalJSON(marshaled []byte) (err error) {
- if len(marshaled) < 2 {
- err = errors.New("JSON GUID must be surrounded by quotes")
- return
- }
- stripped := marshaled[1 : len(marshaled)-1]
- *guid, err = Parse(string(stripped))
- return
-}
-
-// Version reads a GUID to parse which mechanism of generating GUIDS was employed.
-// Values returned here are documented in rfc4122.txt.
-func (guid GUID) Version() uint {
- return uint(guid.timeHighAndVersion >> 12)
-}
-
-var unixToGregorianOffset = time.Date(1970, 01, 01, 0, 0, 00, 0, time.UTC).Sub(time.Date(1582, 10, 15, 0, 0, 0, 0, time.UTC))
-
-// getRFC4122Time returns a 60-bit count of 100-nanosecond intervals since 00:00:00.00 October 15th, 1582
-func getRFC4122Time() int64 {
- currentTime := time.Now().UTC().Add(unixToGregorianOffset).UnixNano()
- currentTime /= 100
- return currentTime & 0x0FFFFFFFFFFFFFFF
-}
-
-var clockSeqVal uint16
-var clockSeqKey sync.Mutex
-
-func getClockSequence() (uint16, error) {
- clockSeqKey.Lock()
- defer clockSeqKey.Unlock()
-
- if 0 == clockSeqVal {
- var temp [2]byte
- if parity, err := rand.Read(temp[:]); !(2 == parity && nil == err) {
- return 0, err
- }
- clockSeqVal = uint16(temp[0])<<8 | uint16(temp[1])
- }
- clockSeqVal++
- return clockSeqVal, nil
-}
-
-func getMACAddress() (mac [6]byte, err error) {
- var hostNICs []net.Interface
-
- hostNICs, err = net.Interfaces()
- if err != nil {
- return
- }
-
- for _, nic := range hostNICs {
- var parity int
-
- parity, err = fmt.Sscanf(
- strings.ToLower(nic.HardwareAddr.String()),
- "%02x:%02x:%02x:%02x:%02x:%02x",
- &mac[0],
- &mac[1],
- &mac[2],
- &mac[3],
- &mac[4],
- &mac[5])
-
- if parity == len(mac) {
- return
- }
- }
-
- err = fmt.Errorf("No suitable address found")
-
- return
-}
-
-func version1() (result GUID, err error) {
- var localMAC [6]byte
- var clockSeq uint16
-
- currentTime := getRFC4122Time()
-
- result.timeLow = uint32(currentTime)
- result.timeMid = uint16(currentTime >> 32)
- result.timeHighAndVersion = uint16(currentTime >> 48)
- if err = result.setVersion(1); err != nil {
- return emptyGUID, err
- }
-
- if localMAC, err = getMACAddress(); nil != err {
- if parity, err := rand.Read(localMAC[:]); !(len(localMAC) != parity && err == nil) {
- return emptyGUID, err
- }
- localMAC[0] |= 0x1
- }
- copy(result.node[:], localMAC[:])
-
- if clockSeq, err = getClockSequence(); nil != err {
- return emptyGUID, err
- }
-
- result.clockSeqLow = uint8(clockSeq)
- result.clockSeqHighAndReserved = uint8(clockSeq >> 8)
-
- result.setReservedBits()
-
- return
-}
-
-func version4() (GUID, error) {
- var retval GUID
- var bits [10]byte
-
- if parity, err := rand.Read(bits[:]); !(len(bits) == parity && err == nil) {
- return emptyGUID, err
- }
- retval.timeHighAndVersion |= uint16(bits[0]) | uint16(bits[1])<<8
- retval.timeMid |= uint16(bits[2]) | uint16(bits[3])<<8
- retval.timeLow |= uint32(bits[4]) | uint32(bits[5])<<8 | uint32(bits[6])<<16 | uint32(bits[7])<<24
- retval.clockSeqHighAndReserved = uint8(bits[8])
- retval.clockSeqLow = uint8(bits[9])
-
- //Randomly set clock-sequence, reserved, and node
- if written, err := rand.Read(retval.node[:]); !(nil == err && written == len(retval.node)) {
- retval = emptyGUID
- return retval, err
- }
-
- if err := retval.setVersion(4); nil != err {
- return emptyGUID, err
- }
- retval.setReservedBits()
-
- return retval, nil
-}
-
-func (guid *GUID) setVersion(version uint16) error {
- if version > 5 || version == 0 {
- return fmt.Errorf("While setting GUID version, unsupported version: %d", version)
- }
- guid.timeHighAndVersion = (guid.timeHighAndVersion & 0x0fff) | version<<12
- return nil
-}
-
-func (guid *GUID) setReservedBits() {
- guid.clockSeqHighAndReserved = (guid.clockSeqHighAndReserved & 0x3f) | 0x80
-}
diff --git a/vendor/go.opencensus.io/Makefile b/vendor/go.opencensus.io/Makefile
index e2f2ed59e..457866cb1 100644
--- a/vendor/go.opencensus.io/Makefile
+++ b/vendor/go.opencensus.io/Makefile
@@ -15,6 +15,7 @@ EMBEDMD=embedmd
# TODO decide if we need to change these names.
TRACE_ID_LINT_EXCEPTION="type name will be used as trace.TraceID by other packages"
TRACE_OPTION_LINT_EXCEPTION="type name will be used as trace.TraceOptions by other packages"
+README_FILES := $(shell find . -name '*README.md' | sort | tr '\n' ' ')
.DEFAULT_GOAL := fmt-lint-vet-embedmd-test
@@ -79,7 +80,7 @@ vet:
.PHONY: embedmd
embedmd:
- @EMBEDMDOUT=`$(EMBEDMD) -d README.md 2>&1`; \
+ @EMBEDMDOUT=`$(EMBEDMD) -d $(README_FILES) 2>&1`; \
if [ "$$EMBEDMDOUT" ]; then \
echo "$(EMBEDMD) FAILED => embedmd the following files:\n"; \
echo "$$EMBEDMDOUT\n"; \
diff --git a/vendor/go.opencensus.io/go.mod b/vendor/go.opencensus.io/go.mod
index cc9febc02..8b7d38e91 100644
--- a/vendor/go.opencensus.io/go.mod
+++ b/vendor/go.opencensus.io/go.mod
@@ -1,13 +1,10 @@
module go.opencensus.io
require (
- github.com/apache/thrift v0.12.0
github.com/golang/protobuf v1.2.0
github.com/google/go-cmp v0.2.0
github.com/hashicorp/golang-lru v0.5.0
- github.com/openzipkin/zipkin-go v0.1.6
- github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
golang.org/x/net v0.0.0-20190311183353-d8887717615a
- google.golang.org/api v0.3.1
+ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 // indirect
google.golang.org/grpc v1.19.0
)
diff --git a/vendor/go.opencensus.io/go.sum b/vendor/go.opencensus.io/go.sum
index 954fadf79..cbb37036d 100644
--- a/vendor/go.opencensus.io/go.sum
+++ b/vendor/go.opencensus.io/go.sum
@@ -1,127 +1,50 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
-github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/apache/thrift v0.12.0 h1:pODnxUFNcjP9UTLZGTdeh+j16A8lJbRvD3rOtrk/7bs=
-github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
-github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
-github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
-github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
-github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=
-github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
-github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
-github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
+github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
-github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
-github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
-github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
-github.com/openzipkin/zipkin-go v0.1.6 h1:yXiysv1CSK7Q5yjGy1710zZGnsbMUIjluWBxtLXHPBo=
-github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
-github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
-github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA=
-github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f h1:BVwpUVJDADN2ufcGik7W992pyps0wZ888b/y9GXcLTU=
-github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU=
-github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 h1:/K3IL0Z1quvmJ7X0A1AwNEK7CRkVK3YwfOU/QAL4WGg=
-github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
-github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY=
-golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
-golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8=
-google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
+google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
-gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
-gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/go.opencensus.io/metric/metricdata/exemplar.go b/vendor/go.opencensus.io/metric/metricdata/exemplar.go
index cdbeef058..12695ce2d 100644
--- a/vendor/go.opencensus.io/metric/metricdata/exemplar.go
+++ b/vendor/go.opencensus.io/metric/metricdata/exemplar.go
@@ -18,6 +18,11 @@ import (
"time"
)
+// Exemplars keys.
+const (
+ AttachmentKeySpanContext = "SpanContext"
+)
+
// Exemplar is an example data point associated with each bucket of a
// distribution type aggregation.
//
diff --git a/vendor/go.opencensus.io/metric/metricdata/label.go b/vendor/go.opencensus.io/metric/metricdata/label.go
index 87c55b9c8..aadae41e6 100644
--- a/vendor/go.opencensus.io/metric/metricdata/label.go
+++ b/vendor/go.opencensus.io/metric/metricdata/label.go
@@ -14,6 +14,13 @@
package metricdata
+// LabelKey represents key of a label. It has optional
+// description attribute.
+type LabelKey struct {
+ Key string
+ Description string
+}
+
// LabelValue represents the value of a label.
// The zero value represents a missing label value, which may be treated
// differently to an empty string value by some back ends.
diff --git a/vendor/go.opencensus.io/metric/metricdata/metric.go b/vendor/go.opencensus.io/metric/metricdata/metric.go
index 6ccdec583..8293712c7 100644
--- a/vendor/go.opencensus.io/metric/metricdata/metric.go
+++ b/vendor/go.opencensus.io/metric/metricdata/metric.go
@@ -22,11 +22,11 @@ import (
// Descriptor holds metadata about a metric.
type Descriptor struct {
- Name string // full name of the metric
- Description string // human-readable description
- Unit Unit // units for the measure
- Type Type // type of measure
- LabelKeys []string // label keys
+ Name string // full name of the metric
+ Description string // human-readable description
+ Unit Unit // units for the measure
+ Type Type // type of measure
+ LabelKeys []LabelKey // label keys
}
// Metric represents a quantity measured against a resource with different
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go b/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go
index e9991fe0f..0ae569182 100644
--- a/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go
@@ -22,9 +22,11 @@ import (
"sync/atomic"
"time"
+ "go.opencensus.io/metric/metricdata"
ocstats "go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
+ "go.opencensus.io/trace"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/stats"
@@ -141,27 +143,31 @@ func handleRPCEnd(ctx context.Context, s *stats.End) {
}
latencyMillis := float64(elapsedTime) / float64(time.Millisecond)
+ attachments := getSpanCtxAttachment(ctx)
if s.Client {
- ocstats.RecordWithTags(ctx,
- []tag.Mutator{
+ ocstats.RecordWithOptions(ctx,
+ ocstats.WithTags(
tag.Upsert(KeyClientMethod, methodName(d.method)),
- tag.Upsert(KeyClientStatus, st),
- },
- ClientSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
- ClientSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
- ClientReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
- ClientReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
- ClientRoundtripLatency.M(latencyMillis))
+ tag.Upsert(KeyClientStatus, st)),
+ ocstats.WithAttachments(attachments),
+ ocstats.WithMeasurements(
+ ClientSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
+ ClientSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
+ ClientReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
+ ClientReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
+ ClientRoundtripLatency.M(latencyMillis)))
} else {
- ocstats.RecordWithTags(ctx,
- []tag.Mutator{
+ ocstats.RecordWithOptions(ctx,
+ ocstats.WithTags(
tag.Upsert(KeyServerStatus, st),
- },
- ServerSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
- ServerSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
- ServerReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
- ServerReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
- ServerLatency.M(latencyMillis))
+ ),
+ ocstats.WithAttachments(attachments),
+ ocstats.WithMeasurements(
+ ServerSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
+ ServerSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
+ ServerReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
+ ServerReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
+ ServerLatency.M(latencyMillis)))
}
}
@@ -206,3 +212,16 @@ func statusCodeToString(s *status.Status) string {
return "CODE_" + strconv.FormatInt(int64(c), 10)
}
}
+
+func getSpanCtxAttachment(ctx context.Context) metricdata.Attachments {
+ attachments := map[string]interface{}{}
+ span := trace.FromContext(ctx)
+ if span == nil {
+ return attachments
+ }
+ spanCtx := span.SpanContext()
+ if spanCtx.IsSampled() {
+ attachments[metricdata.AttachmentKeySpanContext] = spanCtx
+ }
+ return attachments
+}
diff --git a/vendor/go.opencensus.io/plugin/ochttp/server.go b/vendor/go.opencensus.io/plugin/ochttp/server.go
index 5fe15e89f..4f6404fa7 100644
--- a/vendor/go.opencensus.io/plugin/ochttp/server.go
+++ b/vendor/go.opencensus.io/plugin/ochttp/server.go
@@ -124,6 +124,12 @@ func (h *Handler) startTrace(w http.ResponseWriter, r *http.Request) (*http.Requ
}
}
span.AddAttributes(requestAttrs(r)...)
+ if r.Body == nil {
+ // TODO: Handle cases where ContentLength is not set.
+ } else if r.ContentLength > 0 {
+ span.AddMessageReceiveEvent(0, /* TODO: messageID */
+ int64(r.ContentLength), -1)
+ }
return r.WithContext(ctx), span.End
}
@@ -201,6 +207,9 @@ func (t *trackingResponseWriter) Header() http.Header {
func (t *trackingResponseWriter) Write(data []byte) (int, error) {
n, err := t.writer.Write(data)
t.respSize += int64(n)
+ // Add message event for request bytes sent.
+ span := trace.FromContext(t.ctx)
+ span.AddMessageSendEvent(0 /* TODO: messageID */, int64(n), -1)
return n, err
}
diff --git a/vendor/go.opencensus.io/stats/record.go b/vendor/go.opencensus.io/stats/record.go
index d2af0a60d..ad4691184 100644
--- a/vendor/go.opencensus.io/stats/record.go
+++ b/vendor/go.opencensus.io/stats/record.go
@@ -18,6 +18,7 @@ package stats
import (
"context"
+ "go.opencensus.io/metric/metricdata"
"go.opencensus.io/stats/internal"
"go.opencensus.io/tag"
)
@@ -30,28 +31,48 @@ func init() {
}
}
+type recordOptions struct {
+ attachments metricdata.Attachments
+ mutators []tag.Mutator
+ measurements []Measurement
+}
+
+// WithAttachments applies provided exemplar attachments.
+func WithAttachments(attachments metricdata.Attachments) Options {
+ return func(ro *recordOptions) {
+ ro.attachments = attachments
+ }
+}
+
+// WithTags applies provided tag mutators.
+func WithTags(mutators ...tag.Mutator) Options {
+ return func(ro *recordOptions) {
+ ro.mutators = mutators
+ }
+}
+
+// WithMeasurements applies provided measurements.
+func WithMeasurements(measurements ...Measurement) Options {
+ return func(ro *recordOptions) {
+ ro.measurements = measurements
+ }
+}
+
+// Options apply changes to recordOptions.
+type Options func(*recordOptions)
+
+func createRecordOption(ros ...Options) *recordOptions {
+ o := &recordOptions{}
+ for _, ro := range ros {
+ ro(o)
+ }
+ return o
+}
+
// Record records one or multiple measurements with the same context at once.
// If there are any tags in the context, measurements will be tagged with them.
func Record(ctx context.Context, ms ...Measurement) {
- recorder := internal.DefaultRecorder
- if recorder == nil {
- return
- }
- if len(ms) == 0 {
- return
- }
- record := false
- for _, m := range ms {
- if m.desc.subscribed() {
- record = true
- break
- }
- }
- if !record {
- return
- }
- // TODO(songy23): fix attachments.
- recorder(tag.FromContext(ctx), ms, map[string]interface{}{})
+ RecordWithOptions(ctx, WithMeasurements(ms...))
}
// RecordWithTags records one or multiple measurements at once.
@@ -60,10 +81,37 @@ func Record(ctx context.Context, ms ...Measurement) {
// RecordWithTags is useful if you want to record with tag mutations but don't want
// to propagate the mutations in the context.
func RecordWithTags(ctx context.Context, mutators []tag.Mutator, ms ...Measurement) error {
- ctx, err := tag.New(ctx, mutators...)
- if err != nil {
- return err
+ return RecordWithOptions(ctx, WithTags(mutators...), WithMeasurements(ms...))
+}
+
+// RecordWithOptions records measurements from the given options (if any) against context
+// and tags and attachments in the options (if any).
+// If there are any tags in the context, measurements will be tagged with them.
+func RecordWithOptions(ctx context.Context, ros ...Options) error {
+ o := createRecordOption(ros...)
+ if len(o.measurements) == 0 {
+ return nil
}
- Record(ctx, ms...)
+ recorder := internal.DefaultRecorder
+ if recorder == nil {
+ return nil
+ }
+ record := false
+ for _, m := range o.measurements {
+ if m.desc.subscribed() {
+ record = true
+ break
+ }
+ }
+ if !record {
+ return nil
+ }
+ if len(o.mutators) > 0 {
+ var err error
+ if ctx, err = tag.New(ctx, o.mutators...); err != nil {
+ return err
+ }
+ }
+ recorder(tag.FromContext(ctx), o.measurements, o.attachments)
return nil
}
diff --git a/vendor/go.opencensus.io/stats/view/view_to_metric.go b/vendor/go.opencensus.io/stats/view/view_to_metric.go
index 284299faf..010f81bab 100644
--- a/vendor/go.opencensus.io/stats/view/view_to_metric.go
+++ b/vendor/go.opencensus.io/stats/view/view_to_metric.go
@@ -73,10 +73,10 @@ func getType(v *View) metricdata.Type {
}
}
-func getLableKeys(v *View) []string {
- labelKeys := []string{}
+func getLableKeys(v *View) []metricdata.LabelKey {
+ labelKeys := []metricdata.LabelKey{}
for _, k := range v.TagKeys {
- labelKeys = append(labelKeys, k.Name())
+ labelKeys = append(labelKeys, metricdata.LabelKey{Key: k.Name()})
}
return labelKeys
}
@@ -91,10 +91,19 @@ func viewToMetricDescriptor(v *View) *metricdata.Descriptor {
}
}
-func toLabelValues(row *Row) []metricdata.LabelValue {
+func toLabelValues(row *Row, expectedKeys []metricdata.LabelKey) []metricdata.LabelValue {
labelValues := []metricdata.LabelValue{}
+ tagMap := make(map[string]string)
for _, tag := range row.Tags {
- labelValues = append(labelValues, metricdata.NewLabelValue(tag.Value))
+ tagMap[tag.Key.Name()] = tag.Value
+ }
+
+ for _, key := range expectedKeys {
+ if val, ok := tagMap[key.Key]; ok {
+ labelValues = append(labelValues, metricdata.NewLabelValue(val))
+ } else {
+ labelValues = append(labelValues, metricdata.LabelValue{})
+ }
}
return labelValues
}
@@ -102,7 +111,7 @@ func toLabelValues(row *Row) []metricdata.LabelValue {
func rowToTimeseries(v *viewInternal, row *Row, now time.Time, startTime time.Time) *metricdata.TimeSeries {
return &metricdata.TimeSeries{
Points: []metricdata.Point{row.Data.toPoint(v.metricDescriptor.Type, now)},
- LabelValues: toLabelValues(row),
+ LabelValues: toLabelValues(row, v.metricDescriptor.LabelKeys),
StartTime: startTime,
}
}
diff --git a/vendor/go.opencensus.io/stats/view/worker.go b/vendor/go.opencensus.io/stats/view/worker.go
index 37279b39e..2f3c018af 100644
--- a/vendor/go.opencensus.io/stats/view/worker.go
+++ b/vendor/go.opencensus.io/stats/view/worker.go
@@ -236,6 +236,8 @@ func (w *worker) reportView(v *viewInternal, now time.Time) {
}
func (w *worker) reportUsage(now time.Time) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
for _, v := range w.views {
w.reportView(v, now)
}
diff --git a/vendor/go.opencensus.io/stats/view/worker_commands.go b/vendor/go.opencensus.io/stats/view/worker_commands.go
index ba6203a50..0267e179a 100644
--- a/vendor/go.opencensus.io/stats/view/worker_commands.go
+++ b/vendor/go.opencensus.io/stats/view/worker_commands.go
@@ -121,6 +121,8 @@ type retrieveDataResp struct {
}
func (cmd *retrieveDataReq) handleCommand(w *worker) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
vi, ok := w.views[cmd.v]
if !ok {
cmd.c <- &retrieveDataResp{
@@ -153,6 +155,8 @@ type recordReq struct {
}
func (cmd *recordReq) handleCommand(w *worker) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
for _, m := range cmd.ms {
if (m == stats.Measurement{}) { // not registered
continue
diff --git a/vendor/go.opencensus.io/tag/map.go b/vendor/go.opencensus.io/tag/map.go
index 5b72ba6ad..0272ef85a 100644
--- a/vendor/go.opencensus.io/tag/map.go
+++ b/vendor/go.opencensus.io/tag/map.go
@@ -28,10 +28,15 @@ type Tag struct {
Value string
}
+type tagContent struct {
+ value string
+ m metadatas
+}
+
// Map is a map of tags. Use New to create a context containing
// a new Map.
type Map struct {
- m map[Key]string
+ m map[Key]tagContent
}
// Value returns the value for the key if a value for the key exists.
@@ -40,7 +45,7 @@ func (m *Map) Value(k Key) (string, bool) {
return "", false
}
v, ok := m.m[k]
- return v, ok
+ return v.value, ok
}
func (m *Map) String() string {
@@ -62,21 +67,21 @@ func (m *Map) String() string {
return buffer.String()
}
-func (m *Map) insert(k Key, v string) {
+func (m *Map) insert(k Key, v string, md metadatas) {
if _, ok := m.m[k]; ok {
return
}
- m.m[k] = v
+ m.m[k] = tagContent{value: v, m: md}
}
-func (m *Map) update(k Key, v string) {
+func (m *Map) update(k Key, v string, md metadatas) {
if _, ok := m.m[k]; ok {
- m.m[k] = v
+ m.m[k] = tagContent{value: v, m: md}
}
}
-func (m *Map) upsert(k Key, v string) {
- m.m[k] = v
+func (m *Map) upsert(k Key, v string, md metadatas) {
+ m.m[k] = tagContent{value: v, m: md}
}
func (m *Map) delete(k Key) {
@@ -84,7 +89,7 @@ func (m *Map) delete(k Key) {
}
func newMap() *Map {
- return &Map{m: make(map[Key]string)}
+ return &Map{m: make(map[Key]tagContent)}
}
// Mutator modifies a tag map.
@@ -95,13 +100,17 @@ type Mutator interface {
// Insert returns a mutator that inserts a
// value associated with k. If k already exists in the tag map,
// mutator doesn't update the value.
-func Insert(k Key, v string) Mutator {
+// Metadata applies metadata to the tag. It is optional.
+// Metadatas are applied in the order in which it is provided.
+// If more than one metadata updates the same attribute then
+// the update from the last metadata prevails.
+func Insert(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
- m.insert(k, v)
+ m.insert(k, v, createMetadatas(mds...))
return m, nil
},
}
@@ -110,13 +119,17 @@ func Insert(k Key, v string) Mutator {
// Update returns a mutator that updates the
// value of the tag associated with k with v. If k doesn't
// exists in the tag map, the mutator doesn't insert the value.
-func Update(k Key, v string) Mutator {
+// Metadata applies metadata to the tag. It is optional.
+// Metadatas are applied in the order in which it is provided.
+// If more than one metadata updates the same attribute then
+// the update from the last metadata prevails.
+func Update(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
- m.update(k, v)
+ m.update(k, v, createMetadatas(mds...))
return m, nil
},
}
@@ -126,18 +139,37 @@ func Update(k Key, v string) Mutator {
// value of the tag associated with k with v. It inserts the
// value if k doesn't exist already. It mutates the value
// if k already exists.
-func Upsert(k Key, v string) Mutator {
+// Metadata applies metadata to the tag. It is optional.
+// Metadatas are applied in the order in which it is provided.
+// If more than one metadata updates the same attribute then
+// the update from the last metadata prevails.
+func Upsert(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
- m.upsert(k, v)
+ m.upsert(k, v, createMetadatas(mds...))
return m, nil
},
}
}
+func createMetadatas(mds ...Metadata) metadatas {
+ var metas metadatas
+ if len(mds) > 0 {
+ for _, md := range mds {
+ if md != nil {
+ md(&metas)
+ }
+ }
+ } else {
+ WithTTL(TTLUnlimitedPropagation)(&metas)
+ }
+ return metas
+
+}
+
// Delete returns a mutator that deletes
// the value associated with k.
func Delete(k Key) Mutator {
@@ -160,10 +192,10 @@ func New(ctx context.Context, mutator ...Mutator) (context.Context, error) {
if !checkKeyName(k.Name()) {
return ctx, fmt.Errorf("key:%q: %v", k, errInvalidKeyName)
}
- if !checkValue(v) {
+ if !checkValue(v.value) {
return ctx, fmt.Errorf("key:%q value:%q: %v", k.Name(), v, errInvalidValue)
}
- m.insert(k, v)
+ m.insert(k, v.value, v.m)
}
}
var err error
diff --git a/vendor/go.opencensus.io/tag/map_codec.go b/vendor/go.opencensus.io/tag/map_codec.go
index e88e72777..f8b582761 100644
--- a/vendor/go.opencensus.io/tag/map_codec.go
+++ b/vendor/go.opencensus.io/tag/map_codec.go
@@ -170,9 +170,11 @@ func Encode(m *Map) []byte {
}
eg.writeByte(byte(tagsVersionID))
for k, v := range m.m {
- eg.writeByte(byte(keyTypeString))
- eg.writeStringWithVarintLen(k.name)
- eg.writeBytesWithVarintLen([]byte(v))
+ if v.m.ttl.ttl == valueTTLUnlimitedPropagation {
+ eg.writeByte(byte(keyTypeString))
+ eg.writeStringWithVarintLen(k.name)
+ eg.writeBytesWithVarintLen([]byte(v.value))
+ }
}
return eg.bytes()
}
@@ -190,7 +192,7 @@ func Decode(bytes []byte) (*Map, error) {
// DecodeEach decodes the given serialized tag map, calling handler for each
// tag key and value decoded.
-func DecodeEach(bytes []byte, fn func(key Key, val string)) error {
+func DecodeEach(bytes []byte, fn func(key Key, val string, md metadatas)) error {
eg := &encoderGRPC{
buf: bytes,
}
@@ -228,7 +230,7 @@ func DecodeEach(bytes []byte, fn func(key Key, val string)) error {
if !checkValue(val) {
return errInvalidValue
}
- fn(key, val)
+ fn(key, val, createMetadatas(WithTTL(TTLUnlimitedPropagation)))
if err != nil {
return err
}
diff --git a/vendor/go.opencensus.io/tag/metadata.go b/vendor/go.opencensus.io/tag/metadata.go
new file mode 100644
index 000000000..6571a583e
--- /dev/null
+++ b/vendor/go.opencensus.io/tag/metadata.go
@@ -0,0 +1,52 @@
+// Copyright 2019, OpenCensus Authors
+//
+// 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.
+//
+
+package tag
+
+const (
+ // valueTTLNoPropagation prevents tag from propagating.
+ valueTTLNoPropagation = 0
+
+ // valueTTLUnlimitedPropagation allows tag to propagate without any limits on number of hops.
+ valueTTLUnlimitedPropagation = -1
+)
+
+// TTL is metadata that specifies number of hops a tag can propagate.
+// Details about TTL metadata is specified at https://github.com/census-instrumentation/opencensus-specs/blob/master/tags/TagMap.md#tagmetadata
+type TTL struct {
+ ttl int
+}
+
+var (
+ // TTLUnlimitedPropagation is TTL metadata that allows tag to propagate without any limits on number of hops.
+ TTLUnlimitedPropagation = TTL{ttl: valueTTLUnlimitedPropagation}
+
+ // TTLNoPropagation is TTL metadata that prevents tag from propagating.
+ TTLNoPropagation = TTL{ttl: valueTTLNoPropagation}
+)
+
+type metadatas struct {
+ ttl TTL
+}
+
+// Metadata applies metadatas specified by the function.
+type Metadata func(*metadatas)
+
+// WithTTL applies metadata with provided ttl.
+func WithTTL(ttl TTL) Metadata {
+ return func(m *metadatas) {
+ m.ttl = ttl
+ }
+}
diff --git a/vendor/go.opencensus.io/tag/profile_19.go b/vendor/go.opencensus.io/tag/profile_19.go
index f81cd0b4a..b34d95e34 100644
--- a/vendor/go.opencensus.io/tag/profile_19.go
+++ b/vendor/go.opencensus.io/tag/profile_19.go
@@ -25,7 +25,7 @@ func do(ctx context.Context, f func(ctx context.Context)) {
m := FromContext(ctx)
keyvals := make([]string, 0, 2*len(m.m))
for k, v := range m.m {
- keyvals = append(keyvals, k.Name(), v)
+ keyvals = append(keyvals, k.Name(), v.value)
}
pprof.Do(ctx, pprof.Labels(keyvals...), f)
}
diff --git a/vendor/google.golang.org/api/compute/v1/compute-api.json b/vendor/google.golang.org/api/compute/v1/compute-api.json
index 34c253a2d..9de328d09 100644
--- a/vendor/google.golang.org/api/compute/v1/compute-api.json
+++ b/vendor/google.golang.org/api/compute/v1/compute-api.json
@@ -29,7 +29,7 @@
"description": "Creates and runs virtual machines on Google Cloud Platform.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/compute/docs/reference/latest/",
- "etag": "\"VPK3KBfpaEgZ16pozGOoMYfKc0U/tWhhqPM3LuAtFmJlbBMA8m8TfaA\"",
+ "etag": "\"VPK3KBfpaEgZ16pozGOoMYfKc0U/L7OHwc6Gh2BR8n3__eQkZu5iQsE\"",
"icons": {
"x16": "https://www.google.com/images/icons/product/compute_engine-16.png",
"x32": "https://www.google.com/images/icons/product/compute_engine-32.png"
@@ -18314,7 +18314,7 @@
}
}
},
- "revision": "20190320",
+ "revision": "20190403",
"rootUrl": "https://www.googleapis.com/",
"schemas": {
"AcceleratorConfig": {
@@ -20758,7 +20758,7 @@
"properties": {
"condition": {
"$ref": "Expr",
- "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently."
+ "description": "The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently."
},
"members": {
"description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` .\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n\n\n* `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.",
@@ -22641,7 +22641,7 @@
"id": "FixedOrPercent",
"properties": {
"calculated": {
- "description": "[Output Only] Absolute value of VM instances calculated based on the specific mode.\n\n \n- If the value is fixed, then the caculated value is equal to the fixed value. \n- If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.",
+ "description": "[Output Only] Absolute value of VM instances calculated based on the specific mode.\n\n \n- If the value is fixed, then the calculated value is equal to the fixed value. \n- If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.",
"format": "int32",
"type": "integer"
},
@@ -23415,7 +23415,7 @@
"type": "integer"
},
"type": {
- "description": "Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If not specified, the default is TCP. Exactly one of the protocol-specific health check field must be specified, which must match type field.",
+ "description": "Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS or HTTP2. If not specified, the default is TCP. Exactly one of the protocol-specific health check field must be specified, which must match type field.",
"enum": [
"HTTP",
"HTTP2",
@@ -24993,7 +24993,7 @@
"description": "The update policy for this managed instance group."
},
"versions": {
- "description": "Specifies the instance templates used by this managed instance group to create instances.\n\nEach version is defined by an instanceTemplate. Every template can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.",
+ "description": "Specifies the instance templates used by this managed instance group to create instances.\n\nEach version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.",
"items": {
"$ref": "InstanceGroupManagerVersion"
},
@@ -25348,6 +25348,7 @@
"id": "InstanceGroupManagerVersion",
"properties": {
"instanceTemplate": {
+ "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached.",
"type": "string"
},
"name": {
@@ -29595,7 +29596,7 @@
"type": "object"
},
"NodeGroup": {
- "description": "A NodeGroup resource. (== resource_for beta.nodeGroups ==) (== resource_for v1.nodeGroups ==)",
+ "description": "A NodeGroup resource. To create a node group, you must first create a node templates. To learn more about node groups and sole-tenant nodes, read the Sole-tenant nodes documentation. (== resource_for beta.nodeGroups ==) (== resource_for v1.nodeGroups ==)",
"id": "NodeGroup",
"properties": {
"creationTimestamp": {
@@ -30156,7 +30157,7 @@
"type": "object"
},
"NodeTemplate": {
- "description": "A Node Template resource.",
+ "description": "A Node Template resource. To learn more about node templates and sole-tenant nodes, read the Sole-tenant nodes documentation. (== resource_for beta.nodeTemplates ==) (== resource_for v1.nodeTemplates ==)",
"id": "NodeTemplate",
"properties": {
"creationTimestamp": {
@@ -38914,7 +38915,7 @@
"type": "object"
},
"Zone": {
- "description": "A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones ==)",
+ "description": "A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones ==) Next ID: 17",
"id": "Zone",
"properties": {
"availableCpuPlatforms": {
diff --git a/vendor/google.golang.org/api/compute/v1/compute-gen.go b/vendor/google.golang.org/api/compute/v1/compute-gen.go
index ae45594c5..a8d3b1a64 100644
--- a/vendor/google.golang.org/api/compute/v1/compute-gen.go
+++ b/vendor/google.golang.org/api/compute/v1/compute-gen.go
@@ -4518,7 +4518,7 @@ func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
// Binding: Associates `members` with a `role`.
type Binding struct {
// Condition: The condition that is associated with this binding. NOTE:
- // an unsatisfied condition will not allow user access via current
+ // An unsatisfied condition will not allow user access via current
// binding. Different bindings, including their conditions, are examined
// independently.
Condition *Expr `json:"condition,omitempty"`
@@ -7316,7 +7316,7 @@ type FixedOrPercent struct {
// based on the specific mode.
//
//
- // - If the value is fixed, then the caculated value is equal to the
+ // - If the value is fixed, then the calculated value is equal to the
// fixed value.
// - If the value is a percent, then the calculated value is percent/100
// * targetSize. For example, the calculated value of a 80% of a managed
@@ -8506,10 +8506,10 @@ type HealthCheck struct {
// greater value than checkIntervalSec.
TimeoutSec int64 `json:"timeoutSec,omitempty"`
- // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
- // HTTPS. If not specified, the default is TCP. Exactly one of the
- // protocol-specific health check field must be specified, which must
- // match type field.
+ // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP,
+ // HTTPS or HTTP2. If not specified, the default is TCP. Exactly one of
+ // the protocol-specific health check field must be specified, which
+ // must match type field.
//
// Possible values:
// "HTTP"
@@ -10597,12 +10597,12 @@ type InstanceGroupManager struct {
// Versions: Specifies the instance templates used by this managed
// instance group to create instances.
//
- // Each version is defined by an instanceTemplate. Every template can
- // appear at most once per instance group. This field overrides the
- // top-level instanceTemplate field. Read more about the relationships
- // between these fields. Exactly one version must leave the targetSize
- // field unset. That version will be applied to all remaining instances.
- // For more information, read about canary updates.
+ // Each version is defined by an instanceTemplate and a name. Every
+ // version can appear at most once per instance group. This field
+ // overrides the top-level instanceTemplate field. Read more about the
+ // relationships between these fields. Exactly one version must leave
+ // the targetSize field unset. That version will be applied to all
+ // remaining instances. For more information, read about canary updates.
Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
// Zone: [Output Only] The URL of the zone where the managed instance
@@ -11172,6 +11172,10 @@ func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
}
type InstanceGroupManagerVersion struct {
+ // InstanceTemplate: The URL of the instance template that is specified
+ // for this managed instance group. The group uses this template to
+ // create new instances in the managed instance group until the
+ // `targetSize` for this version is reached.
InstanceTemplate string `json:"instanceTemplate,omitempty"`
// Name: Name of the version. Unique among all versions in the scope of
@@ -17500,8 +17504,10 @@ func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
-// NodeGroup: A NodeGroup resource. (== resource_for beta.nodeGroups ==)
-// (== resource_for v1.nodeGroups ==)
+// NodeGroup: A NodeGroup resource. To create a node group, you must
+// first create a node templates. To learn more about node groups and
+// sole-tenant nodes, read the Sole-tenant nodes documentation. (==
+// resource_for beta.nodeGroups ==) (== resource_for v1.nodeGroups ==)
type NodeGroup struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@@ -18302,7 +18308,10 @@ func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
-// NodeTemplate: A Node Template resource.
+// NodeTemplate: A Node Template resource. To learn more about node
+// templates and sole-tenant nodes, read the Sole-tenant nodes
+// documentation. (== resource_for beta.nodeTemplates ==) (==
+// resource_for v1.nodeTemplates ==)
type NodeTemplate struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@@ -31065,7 +31074,7 @@ func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
}
// Zone: A Zone resource. (== resource_for beta.zones ==) (==
-// resource_for v1.zones ==)
+// resource_for v1.zones ==) Next ID: 17
type Zone struct {
// AvailableCpuPlatforms: [Output Only] Available cpu/platform
// selections for the zone.
diff --git a/vendor/google.golang.org/api/storage/v1/storage-api.json b/vendor/google.golang.org/api/storage/v1/storage-api.json
index 0342a63b4..e771f9b13 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-api.json
+++ b/vendor/google.golang.org/api/storage/v1/storage-api.json
@@ -26,7 +26,7 @@
"description": "Stores and retrieves potentially large, immutable data objects.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/storage/docs/json_api/",
- "etag": "\"J3WqvAcMk4eQjJXvfSI4Yr8VouA/5J1bGH010PqoE1O9vmClDRlYmZI\"",
+ "etag": "\"VPK3KBfpaEgZ16pozGOoMYfKc0U/0oTiRxFg5a8IRGYou40wPCps2h4\"",
"icons": {
"x16": "https://www.google.com/images/icons/product/cloud_storage-16.png",
"x32": "https://www.google.com/images/icons/product/cloud_storage-32.png"
@@ -2727,6 +2727,185 @@
},
"projects": {
"resources": {
+ "hmacKeys": {
+ "methods": {
+ "create": {
+ "description": "Creates a new HMAC key for the specified service account.",
+ "httpMethod": "POST",
+ "id": "storage.projects.hmacKeys.create",
+ "parameterOrder": [
+ "projectId",
+ "serviceAccountEmail"
+ ],
+ "parameters": {
+ "projectId": {
+ "description": "Project ID owning the service account.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "serviceAccountEmail": {
+ "description": "Email address of the service account.",
+ "location": "query",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{projectId}/hmacKeys",
+ "response": {
+ "$ref": "HmacKey"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "delete": {
+ "description": "Deletes an HMAC key.",
+ "httpMethod": "DELETE",
+ "id": "storage.projects.hmacKeys.delete",
+ "parameterOrder": [
+ "projectId",
+ "accessId"
+ ],
+ "parameters": {
+ "accessId": {
+ "description": "Name of the HMAC key to be deleted.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Project ID owning the requested key",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{projectId}/hmacKeys/{accessId}",
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "description": "Retrieves an HMAC key's metadata",
+ "httpMethod": "GET",
+ "id": "storage.projects.hmacKeys.get",
+ "parameterOrder": [
+ "projectId",
+ "accessId"
+ ],
+ "parameters": {
+ "accessId": {
+ "description": "Name of the HMAC key.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Project ID owning the service account of the requested key.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{projectId}/hmacKeys/{accessId}",
+ "response": {
+ "$ref": "HmacKeyMetadata"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.read_only"
+ ]
+ },
+ "list": {
+ "description": "Retrieves a list of HMAC keys matching the criteria.",
+ "httpMethod": "GET",
+ "id": "storage.projects.hmacKeys.list",
+ "parameterOrder": [
+ "projectId"
+ ],
+ "parameters": {
+ "maxResults": {
+ "default": "1000",
+ "description": "Maximum number of items plus prefixes to return in a single page of responses. Because duplicate prefixes are omitted, fewer total results may be returned than requested. The service uses this parameter or 1,000 items, whichever is smaller.",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "pageToken": {
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Name of the project in which to look for HMAC keys.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "serviceAccountEmail": {
+ "description": "If present, only keys for the given service account are returned.",
+ "location": "query",
+ "type": "string"
+ },
+ "showDeletedKeys": {
+ "description": "Whether or not to show keys in the DELETED state.",
+ "location": "query",
+ "type": "boolean"
+ }
+ },
+ "path": "projects/{projectId}/hmacKeys",
+ "response": {
+ "$ref": "HmacKeysMetadata"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only"
+ ]
+ },
+ "update": {
+ "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.",
+ "httpMethod": "PUT",
+ "id": "storage.projects.hmacKeys.update",
+ "parameterOrder": [
+ "projectId",
+ "accessId"
+ ],
+ "parameters": {
+ "accessId": {
+ "description": "Name of the HMAC key being updated.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Project ID owning the service account of the updated key.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{projectId}/hmacKeys/{accessId}",
+ "request": {
+ "$ref": "HmacKeyMetadata"
+ },
+ "response": {
+ "$ref": "HmacKeyMetadata"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ }
+ }
+ },
"serviceAccount": {
"methods": {
"get": {
@@ -2766,7 +2945,7 @@
}
}
},
- "revision": "20190129",
+ "revision": "20190326",
"rootUrl": "https://www.googleapis.com/",
"schemas": {
"Bucket": {
@@ -3324,6 +3503,97 @@
},
"type": "object"
},
+ "HmacKey": {
+ "description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.",
+ "id": "HmacKey",
+ "properties": {
+ "kind": {
+ "default": "storage#hmacKey",
+ "description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.",
+ "type": "string"
+ },
+ "metadata": {
+ "description": "Key metadata.",
+ "type": "any"
+ },
+ "secret": {
+ "description": "HMAC secret key material.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "HmacKeyMetadata": {
+ "description": "JSON template to produce a JSON-style HMAC Key metadata resource.",
+ "id": "HmacKeyMetadata",
+ "properties": {
+ "accessId": {
+ "description": "The ID of the HMAC Key.",
+ "type": "string"
+ },
+ "etag": {
+ "description": "HTTP 1.1 Entity tag for the access-control entry.",
+ "type": "string"
+ },
+ "id": {
+ "description": "The ID of the HMAC key, including the Project ID and the Access ID.",
+ "type": "string"
+ },
+ "kind": {
+ "default": "storage#hmacKeyMetadata",
+ "description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Project ID owning the service account to which the key authenticates.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "The link to this resource.",
+ "type": "string"
+ },
+ "serviceAccountEmail": {
+ "description": "The email address of the key's associated service account.",
+ "type": "string"
+ },
+ "state": {
+ "description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED.",
+ "type": "string"
+ },
+ "timeCreated": {
+ "description": "The creation time of the HMAC key in RFC 3339 format.",
+ "type": "string"
+ },
+ "updated": {
+ "description": "The last modification time of the HMAC key metadata in RFC 3339 format.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "HmacKeysMetadata": {
+ "description": "A list of hmacKeys.",
+ "id": "HmacKeysMetadata",
+ "properties": {
+ "items": {
+ "description": "The list of items.",
+ "items": {
+ "$ref": "HmacKeyMetadata"
+ },
+ "type": "array"
+ },
+ "kind": {
+ "default": "storage#hmacKeysMetadata",
+ "description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
"Notification": {
"description": "A subscription to receive Google PubSub notifications.",
"id": "Notification",
diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go
index 6b0f227b8..a29fdc1ef 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-gen.go
+++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go
@@ -238,6 +238,7 @@ type ObjectsService struct {
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
+ rs.HmacKeys = NewProjectsHmacKeysService(s)
rs.ServiceAccount = NewProjectsServiceAccountService(s)
return rs
}
@@ -245,9 +246,20 @@ func NewProjectsService(s *Service) *ProjectsService {
type ProjectsService struct {
s *Service
+ HmacKeys *ProjectsHmacKeysService
+
ServiceAccount *ProjectsServiceAccountService
}
+func NewProjectsHmacKeysService(s *Service) *ProjectsHmacKeysService {
+ rs := &ProjectsHmacKeysService{s: s}
+ return rs
+}
+
+type ProjectsHmacKeysService struct {
+ s *Service
+}
+
func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
rs := &ProjectsServiceAccountService{s: s}
return rs
@@ -1313,6 +1325,153 @@ func (s *Expr) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
+// HmacKey: JSON template to produce a JSON-style HMAC Key resource for
+// Create responses.
+type HmacKey struct {
+ // Kind: The kind of item this is. For HMAC keys, this is always
+ // storage#hmacKey.
+ Kind string `json:"kind,omitempty"`
+
+ // Metadata: Key metadata.
+ Metadata interface{} `json:"metadata,omitempty"`
+
+ // Secret: HMAC secret key material.
+ Secret string `json:"secret,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the
+ // server.
+ googleapi.ServerResponse `json:"-"`
+
+ // ForceSendFields is a list of field names (e.g. "Kind") to
+ // unconditionally include in API requests. By default, fields with
+ // empty values are omitted from API requests. However, any non-pointer,
+ // non-interface field appearing in ForceSendFields will be sent to the
+ // server regardless of whether the field is empty or not. This may be
+ // used to include empty fields in Patch requests.
+ ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Kind") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
+}
+
+func (s *HmacKey) MarshalJSON() ([]byte, error) {
+ type NoMethod HmacKey
+ raw := NoMethod(*s)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+}
+
+// HmacKeyMetadata: JSON template to produce a JSON-style HMAC Key
+// metadata resource.
+type HmacKeyMetadata struct {
+ // AccessId: The ID of the HMAC Key.
+ AccessId string `json:"accessId,omitempty"`
+
+ // Etag: HTTP 1.1 Entity tag for the access-control entry.
+ Etag string `json:"etag,omitempty"`
+
+ // Id: The ID of the HMAC key, including the Project ID and the Access
+ // ID.
+ Id string `json:"id,omitempty"`
+
+ // Kind: The kind of item this is. For HMAC Key metadata, this is always
+ // storage#hmacKeyMetadata.
+ Kind string `json:"kind,omitempty"`
+
+ // ProjectId: Project ID owning the service account to which the key
+ // authenticates.
+ ProjectId string `json:"projectId,omitempty"`
+
+ // SelfLink: The link to this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+
+ // ServiceAccountEmail: The email address of the key's associated
+ // service account.
+ ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
+
+ // State: The state of the key. Can be one of ACTIVE, INACTIVE, or
+ // DELETED.
+ State string `json:"state,omitempty"`
+
+ // TimeCreated: The creation time of the HMAC key in RFC 3339 format.
+ TimeCreated string `json:"timeCreated,omitempty"`
+
+ // Updated: The last modification time of the HMAC key metadata in RFC
+ // 3339 format.
+ Updated string `json:"updated,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the
+ // server.
+ googleapi.ServerResponse `json:"-"`
+
+ // ForceSendFields is a list of field names (e.g. "AccessId") to
+ // unconditionally include in API requests. By default, fields with
+ // empty values are omitted from API requests. However, any non-pointer,
+ // non-interface field appearing in ForceSendFields will be sent to the
+ // server regardless of whether the field is empty or not. This may be
+ // used to include empty fields in Patch requests.
+ ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "AccessId") to include in
+ // API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
+}
+
+func (s *HmacKeyMetadata) MarshalJSON() ([]byte, error) {
+ type NoMethod HmacKeyMetadata
+ raw := NoMethod(*s)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+}
+
+// HmacKeysMetadata: A list of hmacKeys.
+type HmacKeysMetadata struct {
+ // Items: The list of items.
+ Items []*HmacKeyMetadata `json:"items,omitempty"`
+
+ // Kind: The kind of item this is. For lists of hmacKeys, this is always
+ // storage#hmacKeysMetadata.
+ Kind string `json:"kind,omitempty"`
+
+ // NextPageToken: The continuation token, used to page through large
+ // result sets. Provide this value in a subsequent request to return the
+ // next page of results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the
+ // server.
+ googleapi.ServerResponse `json:"-"`
+
+ // ForceSendFields is a list of field names (e.g. "Items") to
+ // unconditionally include in API requests. By default, fields with
+ // empty values are omitted from API requests. However, any non-pointer,
+ // non-interface field appearing in ForceSendFields will be sent to the
+ // server regardless of whether the field is empty or not. This may be
+ // used to include empty fields in Patch requests.
+ ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Items") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
+}
+
+func (s *HmacKeysMetadata) MarshalJSON() ([]byte, error) {
+ type NoMethod HmacKeysMetadata
+ raw := NoMethod(*s)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+}
+
// Notification: A subscription to receive Google PubSub notifications.
type Notification struct {
// CustomAttributes: An optional list of additional attributes to attach
@@ -11429,6 +11588,776 @@ func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error)
}
+// method id "storage.projects.hmacKeys.create":
+
+type ProjectsHmacKeysCreateCall struct {
+ s *Service
+ projectId string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Create: Creates a new HMAC key for the specified service account.
+func (r *ProjectsHmacKeysService) Create(projectId string, serviceAccountEmail string) *ProjectsHmacKeysCreateCall {
+ c := &ProjectsHmacKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.projectId = projectId
+ c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *ProjectsHmacKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *ProjectsHmacKeysCreateCall) Context(ctx context.Context) *ProjectsHmacKeysCreateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ProjectsHmacKeysCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "projectId": c.projectId,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.projects.hmacKeys.create" call.
+// Exactly one of *HmacKey or error will be non-nil. Any non-2xx status
+// code is an error. Response headers are in either
+// *HmacKey.ServerResponse.Header or (if a response was returned at all)
+// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
+// check whether the returned error was because http.StatusNotModified
+// was returned.
+func (c *ProjectsHmacKeysCreateCall) Do(opts ...googleapi.CallOption) (*HmacKey, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, &googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, err
+ }
+ ret := &HmacKey{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+ // {
+ // "description": "Creates a new HMAC key for the specified service account.",
+ // "httpMethod": "POST",
+ // "id": "storage.projects.hmacKeys.create",
+ // "parameterOrder": [
+ // "projectId",
+ // "serviceAccountEmail"
+ // ],
+ // "parameters": {
+ // "projectId": {
+ // "description": "Project ID owning the service account.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "serviceAccountEmail": {
+ // "description": "Email address of the service account.",
+ // "location": "query",
+ // "required": true,
+ // "type": "string"
+ // }
+ // },
+ // "path": "projects/{projectId}/hmacKeys",
+ // "response": {
+ // "$ref": "HmacKey"
+ // },
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/devstorage.full_control"
+ // ]
+ // }
+
+}
+
+// method id "storage.projects.hmacKeys.delete":
+
+type ProjectsHmacKeysDeleteCall struct {
+ s *Service
+ projectId string
+ accessId string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes an HMAC key.
+func (r *ProjectsHmacKeysService) Delete(projectId string, accessId string) *ProjectsHmacKeysDeleteCall {
+ c := &ProjectsHmacKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.projectId = projectId
+ c.accessId = accessId
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *ProjectsHmacKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *ProjectsHmacKeysDeleteCall) Context(ctx context.Context) *ProjectsHmacKeysDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ProjectsHmacKeysDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "projectId": c.projectId,
+ "accessId": c.accessId,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.projects.hmacKeys.delete" call.
+func (c *ProjectsHmacKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if err != nil {
+ return err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return err
+ }
+ return nil
+ // {
+ // "description": "Deletes an HMAC key.",
+ // "httpMethod": "DELETE",
+ // "id": "storage.projects.hmacKeys.delete",
+ // "parameterOrder": [
+ // "projectId",
+ // "accessId"
+ // ],
+ // "parameters": {
+ // "accessId": {
+ // "description": "Name of the HMAC key to be deleted.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "projectId": {
+ // "description": "Project ID owning the requested key",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // }
+ // },
+ // "path": "projects/{projectId}/hmacKeys/{accessId}",
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/devstorage.full_control",
+ // "https://www.googleapis.com/auth/devstorage.read_write"
+ // ]
+ // }
+
+}
+
+// method id "storage.projects.hmacKeys.get":
+
+type ProjectsHmacKeysGetCall struct {
+ s *Service
+ projectId string
+ accessId string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Retrieves an HMAC key's metadata
+func (r *ProjectsHmacKeysService) Get(projectId string, accessId string) *ProjectsHmacKeysGetCall {
+ c := &ProjectsHmacKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.projectId = projectId
+ c.accessId = accessId
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *ProjectsHmacKeysGetCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets the optional parameter which makes the operation
+// fail if the object's ETag matches the given value. This is useful for
+// getting updates only after the object has changed since the last
+// request. Use googleapi.IsNotModified to check whether the response
+// error from Do is the result of In-None-Match.
+func (c *ProjectsHmacKeysGetCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *ProjectsHmacKeysGetCall) Context(ctx context.Context) *ProjectsHmacKeysGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ProjectsHmacKeysGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ if c.ifNoneMatch_ != "" {
+ reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
+ }
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("GET", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "projectId": c.projectId,
+ "accessId": c.accessId,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.projects.hmacKeys.get" call.
+// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx
+// status code is an error. Response headers are in either
+// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned
+// at all) in error.(*googleapi.Error).Header. Use
+// googleapi.IsNotModified to check whether the returned error was
+// because http.StatusNotModified was returned.
+func (c *ProjectsHmacKeysGetCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, &googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, err
+ }
+ ret := &HmacKeyMetadata{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+ // {
+ // "description": "Retrieves an HMAC key's metadata",
+ // "httpMethod": "GET",
+ // "id": "storage.projects.hmacKeys.get",
+ // "parameterOrder": [
+ // "projectId",
+ // "accessId"
+ // ],
+ // "parameters": {
+ // "accessId": {
+ // "description": "Name of the HMAC key.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "projectId": {
+ // "description": "Project ID owning the service account of the requested key.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // }
+ // },
+ // "path": "projects/{projectId}/hmacKeys/{accessId}",
+ // "response": {
+ // "$ref": "HmacKeyMetadata"
+ // },
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/cloud-platform.read-only",
+ // "https://www.googleapis.com/auth/devstorage.read_only"
+ // ]
+ // }
+
+}
+
+// method id "storage.projects.hmacKeys.list":
+
+type ProjectsHmacKeysListCall struct {
+ s *Service
+ projectId string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of HMAC keys matching the criteria.
+func (r *ProjectsHmacKeysService) List(projectId string) *ProjectsHmacKeysListCall {
+ c := &ProjectsHmacKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.projectId = projectId
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": Maximum number
+// of items plus prefixes to return in a single page of responses.
+// Because duplicate prefixes are omitted, fewer total results may be
+// returned than requested. The service uses this parameter or 1,000
+// items, whichever is smaller.
+func (c *ProjectsHmacKeysListCall) MaxResults(maxResults int64) *ProjectsHmacKeysListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": A
+// previously-returned page token representing part of the larger set of
+// results to view.
+func (c *ProjectsHmacKeysListCall) PageToken(pageToken string) *ProjectsHmacKeysListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ServiceAccountEmail sets the optional parameter
+// "serviceAccountEmail": If present, only keys for the given service
+// account are returned.
+func (c *ProjectsHmacKeysListCall) ServiceAccountEmail(serviceAccountEmail string) *ProjectsHmacKeysListCall {
+ c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
+ return c
+}
+
+// ShowDeletedKeys sets the optional parameter "showDeletedKeys":
+// Whether or not to show keys in the DELETED state.
+func (c *ProjectsHmacKeysListCall) ShowDeletedKeys(showDeletedKeys bool) *ProjectsHmacKeysListCall {
+ c.urlParams_.Set("showDeletedKeys", fmt.Sprint(showDeletedKeys))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *ProjectsHmacKeysListCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets the optional parameter which makes the operation
+// fail if the object's ETag matches the given value. This is useful for
+// getting updates only after the object has changed since the last
+// request. Use googleapi.IsNotModified to check whether the response
+// error from Do is the result of In-None-Match.
+func (c *ProjectsHmacKeysListCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *ProjectsHmacKeysListCall) Context(ctx context.Context) *ProjectsHmacKeysListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ProjectsHmacKeysListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ if c.ifNoneMatch_ != "" {
+ reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
+ }
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("GET", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "projectId": c.projectId,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.projects.hmacKeys.list" call.
+// Exactly one of *HmacKeysMetadata or error will be non-nil. Any
+// non-2xx status code is an error. Response headers are in either
+// *HmacKeysMetadata.ServerResponse.Header or (if a response was
+// returned at all) in error.(*googleapi.Error).Header. Use
+// googleapi.IsNotModified to check whether the returned error was
+// because http.StatusNotModified was returned.
+func (c *ProjectsHmacKeysListCall) Do(opts ...googleapi.CallOption) (*HmacKeysMetadata, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, &googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, err
+ }
+ ret := &HmacKeysMetadata{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+ // {
+ // "description": "Retrieves a list of HMAC keys matching the criteria.",
+ // "httpMethod": "GET",
+ // "id": "storage.projects.hmacKeys.list",
+ // "parameterOrder": [
+ // "projectId"
+ // ],
+ // "parameters": {
+ // "maxResults": {
+ // "default": "1000",
+ // "description": "Maximum number of items plus prefixes to return in a single page of responses. Because duplicate prefixes are omitted, fewer total results may be returned than requested. The service uses this parameter or 1,000 items, whichever is smaller.",
+ // "format": "uint32",
+ // "location": "query",
+ // "minimum": "0",
+ // "type": "integer"
+ // },
+ // "pageToken": {
+ // "description": "A previously-returned page token representing part of the larger set of results to view.",
+ // "location": "query",
+ // "type": "string"
+ // },
+ // "projectId": {
+ // "description": "Name of the project in which to look for HMAC keys.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "serviceAccountEmail": {
+ // "description": "If present, only keys for the given service account are returned.",
+ // "location": "query",
+ // "type": "string"
+ // },
+ // "showDeletedKeys": {
+ // "description": "Whether or not to show keys in the DELETED state.",
+ // "location": "query",
+ // "type": "boolean"
+ // }
+ // },
+ // "path": "projects/{projectId}/hmacKeys",
+ // "response": {
+ // "$ref": "HmacKeysMetadata"
+ // },
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/cloud-platform.read-only",
+ // "https://www.googleapis.com/auth/devstorage.full_control",
+ // "https://www.googleapis.com/auth/devstorage.read_only"
+ // ]
+ // }
+
+}
+
+// Pages invokes f for each page of results.
+// A non-nil error returned from f will halt the iteration.
+// The provided context supersedes any context provided to the Context method.
+func (c *ProjectsHmacKeysListCall) Pages(ctx context.Context, f func(*HmacKeysMetadata) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
+ for {
+ x, err := c.Do()
+ if err != nil {
+ return err
+ }
+ if err := f(x); err != nil {
+ return err
+ }
+ if x.NextPageToken == "" {
+ return nil
+ }
+ c.PageToken(x.NextPageToken)
+ }
+}
+
+// method id "storage.projects.hmacKeys.update":
+
+type ProjectsHmacKeysUpdateCall struct {
+ s *Service
+ projectId string
+ accessId string
+ hmackeymetadata *HmacKeyMetadata
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates the state of an HMAC key. See the HMAC Key resource
+// descriptor for valid states.
+func (r *ProjectsHmacKeysService) Update(projectId string, accessId string, hmackeymetadata *HmacKeyMetadata) *ProjectsHmacKeysUpdateCall {
+ c := &ProjectsHmacKeysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.projectId = projectId
+ c.accessId = accessId
+ c.hmackeymetadata = hmackeymetadata
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *ProjectsHmacKeysUpdateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *ProjectsHmacKeysUpdateCall) Context(ctx context.Context) *ProjectsHmacKeysUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ProjectsHmacKeysUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata)
+ if err != nil {
+ return nil, err
+ }
+ reqHeaders.Set("Content-Type", "application/json")
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PUT", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "projectId": c.projectId,
+ "accessId": c.accessId,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.projects.hmacKeys.update" call.
+// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx
+// status code is an error. Response headers are in either
+// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned
+// at all) in error.(*googleapi.Error).Header. Use
+// googleapi.IsNotModified to check whether the returned error was
+// because http.StatusNotModified was returned.
+func (c *ProjectsHmacKeysUpdateCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, &googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, err
+ }
+ ret := &HmacKeyMetadata{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+ // {
+ // "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.",
+ // "httpMethod": "PUT",
+ // "id": "storage.projects.hmacKeys.update",
+ // "parameterOrder": [
+ // "projectId",
+ // "accessId"
+ // ],
+ // "parameters": {
+ // "accessId": {
+ // "description": "Name of the HMAC key being updated.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "projectId": {
+ // "description": "Project ID owning the service account of the updated key.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // }
+ // },
+ // "path": "projects/{projectId}/hmacKeys/{accessId}",
+ // "request": {
+ // "$ref": "HmacKeyMetadata"
+ // },
+ // "response": {
+ // "$ref": "HmacKeyMetadata"
+ // },
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/devstorage.full_control"
+ // ]
+ // }
+
+}
+
// method id "storage.projects.serviceAccount.get":
type ProjectsServiceAccountGetCall struct {
diff --git a/vendor/google.golang.org/grpc/.travis.yml b/vendor/google.golang.org/grpc/.travis.yml
index 8f36b81aa..591343edf 100644
--- a/vendor/google.golang.org/grpc/.travis.yml
+++ b/vendor/google.golang.org/grpc/.travis.yml
@@ -2,7 +2,7 @@ language: go
matrix:
include:
- - go: 1.12beta2
+ - go: 1.12.x
env: GO111MODULE=on
- go: 1.11.x
env: VET=1 GO111MODULE=on
diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go
index 67518de9a..fafede238 100644
--- a/vendor/google.golang.org/grpc/balancer/balancer.go
+++ b/vendor/google.golang.org/grpc/balancer/balancer.go
@@ -171,9 +171,6 @@ type PickOptions struct {
// FullMethodName is the method name that NewClientStream() is called
// with. The canonical format is /service/Method.
FullMethodName string
- // Header contains the metadata from the RPC's client header. The metadata
- // should not be modified; make a copy first if needed.
- Header metadata.MD
}
// DoneInfo contains additional information for done.
@@ -186,6 +183,11 @@ type DoneInfo struct {
BytesSent bool
// BytesReceived indicates if any byte has been received from the server.
BytesReceived bool
+ // ServerLoad is the load received from server. It's usually sent as part of
+ // trailing metadata.
+ //
+ // The only supported type now is *orca_v1.LoadReport.
+ ServerLoad interface{}
}
var (
@@ -215,8 +217,10 @@ type Picker interface {
//
// If a SubConn is returned:
// - If it is READY, gRPC will send the RPC on it;
- // - If it is not ready, or becomes not ready after it's returned, gRPC will block
- // until UpdateBalancerState() is called and will call pick on the new picker.
+ // - If it is not ready, or becomes not ready after it's returned, gRPC will
+ // block until UpdateBalancerState() is called and will call pick on the
+ // new picker. The done function returned from Pick(), if not nil, will be
+ // called with nil error, no bytes sent and no bytes received.
//
// If the returned error is not nil:
// - If the error is ErrNoSubConnAvailable, gRPC will block until UpdateBalancerState()
@@ -249,18 +253,46 @@ type Balancer interface {
// that back to gRPC.
// Balancer should also generate and update Pickers when its internal state has
// been changed by the new state.
+ //
+ // Deprecated: if V2Balancer is implemented by the Balancer,
+ // UpdateSubConnState will be called instead.
HandleSubConnStateChange(sc SubConn, state connectivity.State)
// HandleResolvedAddrs is called by gRPC to send updated resolved addresses to
// balancers.
// Balancer can create new SubConn or remove SubConn with the addresses.
// An empty address slice and a non-nil error will be passed if the resolver returns
// non-nil error to gRPC.
+ //
+ // Deprecated: if V2Balancer is implemented by the Balancer,
+ // UpdateResolverState will be called instead.
HandleResolvedAddrs([]resolver.Address, error)
// Close closes the balancer. The balancer is not required to call
// ClientConn.RemoveSubConn for its existing SubConns.
Close()
}
+// SubConnState describes the state of a SubConn.
+type SubConnState struct {
+ ConnectivityState connectivity.State
+ // TODO: add last connection error
+}
+
+// V2Balancer is defined for documentation purposes. If a Balancer also
+// implements V2Balancer, its UpdateResolverState method will be called instead
+// of HandleResolvedAddrs and its UpdateSubConnState will be called instead of
+// HandleSubConnStateChange.
+type V2Balancer interface {
+ // UpdateResolverState is called by gRPC when the state of the resolver
+ // changes.
+ UpdateResolverState(resolver.State)
+ // UpdateSubConnState is called by gRPC when the state of a SubConn
+ // changes.
+ UpdateSubConnState(SubConn, SubConnState)
+ // Close closes the balancer. The balancer is not required to call
+ // ClientConn.RemoveSubConn for its existing SubConns.
+ Close()
+}
+
// ConnectivityStateEvaluator takes the connectivity states of multiple SubConns
// and returns one aggregated connectivity state.
//
diff --git a/vendor/google.golang.org/grpc/balancer/base/balancer.go b/vendor/google.golang.org/grpc/balancer/base/balancer.go
index 245785e7a..c5a51bd1d 100644
--- a/vendor/google.golang.org/grpc/balancer/base/balancer.go
+++ b/vendor/google.golang.org/grpc/balancer/base/balancer.go
@@ -67,14 +67,16 @@ type baseBalancer struct {
}
func (b *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) {
- if err != nil {
- grpclog.Infof("base.baseBalancer: HandleResolvedAddrs called with error %v", err)
- return
- }
- grpclog.Infoln("base.baseBalancer: got new resolved addresses: ", addrs)
+ panic("not implemented")
+}
+
+func (b *baseBalancer) UpdateResolverState(s resolver.State) {
+ // TODO: handle s.Err (log if not nil) once implemented.
+ // TODO: handle s.ServiceConfig?
+ grpclog.Infoln("base.baseBalancer: got new resolver state: ", s)
// addrsSet is the set converted from addrs, it's used for quick lookup of an address.
addrsSet := make(map[resolver.Address]struct{})
- for _, a := range addrs {
+ for _, a := range s.Addresses {
addrsSet[a] = struct{}{}
if _, ok := b.subConns[a]; !ok {
// a is a new address (not existing in b.subConns).
@@ -120,6 +122,11 @@ func (b *baseBalancer) regeneratePicker() {
}
func (b *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s connectivity.State) {
+ panic("not implemented")
+}
+
+func (b *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) {
+ s := state.ConnectivityState
grpclog.Infof("base.baseBalancer: handle SubConn state change: %p, %v", sc, s)
oldS, ok := b.scStates[sc]
if !ok {
diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go
index 7233ade29..bc965f0ac 100644
--- a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go
+++ b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go
@@ -82,20 +82,13 @@ func (b *scStateUpdateBuffer) get() <-chan *scStateUpdate {
return b.c
}
-// resolverUpdate contains the new resolved addresses or error if there's
-// any.
-type resolverUpdate struct {
- addrs []resolver.Address
- err error
-}
-
// ccBalancerWrapper is a wrapper on top of cc for balancers.
// It implements balancer.ClientConn interface.
type ccBalancerWrapper struct {
cc *ClientConn
balancer balancer.Balancer
stateChangeQueue *scStateUpdateBuffer
- resolverUpdateCh chan *resolverUpdate
+ resolverUpdateCh chan *resolver.State
done chan struct{}
mu sync.Mutex
@@ -106,7 +99,7 @@ func newCCBalancerWrapper(cc *ClientConn, b balancer.Builder, bopts balancer.Bui
ccb := &ccBalancerWrapper{
cc: cc,
stateChangeQueue: newSCStateUpdateBuffer(),
- resolverUpdateCh: make(chan *resolverUpdate, 1),
+ resolverUpdateCh: make(chan *resolver.State, 1),
done: make(chan struct{}),
subConns: make(map[*acBalancerWrapper]struct{}),
}
@@ -128,15 +121,23 @@ func (ccb *ccBalancerWrapper) watcher() {
return
default:
}
- ccb.balancer.HandleSubConnStateChange(t.sc, t.state)
- case t := <-ccb.resolverUpdateCh:
+ if ub, ok := ccb.balancer.(balancer.V2Balancer); ok {
+ ub.UpdateSubConnState(t.sc, balancer.SubConnState{ConnectivityState: t.state})
+ } else {
+ ccb.balancer.HandleSubConnStateChange(t.sc, t.state)
+ }
+ case s := <-ccb.resolverUpdateCh:
select {
case <-ccb.done:
ccb.balancer.Close()
return
default:
}
- ccb.balancer.HandleResolvedAddrs(t.addrs, t.err)
+ if ub, ok := ccb.balancer.(balancer.V2Balancer); ok {
+ ub.UpdateResolverState(*s)
+ } else {
+ ccb.balancer.HandleResolvedAddrs(s.Addresses, nil)
+ }
case <-ccb.done:
}
@@ -177,37 +178,23 @@ func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s co
})
}
-func (ccb *ccBalancerWrapper) handleResolvedAddrs(addrs []resolver.Address, err error) {
+func (ccb *ccBalancerWrapper) updateResolverState(s resolver.State) {
if ccb.cc.curBalancerName != grpclbName {
- var containsGRPCLB bool
- for _, a := range addrs {
- if a.Type == resolver.GRPCLB {
- containsGRPCLB = true
- break
+ // Filter any grpclb addresses since we don't have the grpclb balancer.
+ for i := 0; i < len(s.Addresses); {
+ if s.Addresses[i].Type == resolver.GRPCLB {
+ copy(s.Addresses[i:], s.Addresses[i+1:])
+ s.Addresses = s.Addresses[:len(s.Addresses)-1]
+ continue
}
- }
- if containsGRPCLB {
- // The current balancer is not grpclb, but addresses contain grpclb
- // address. This means we failed to switch to grpclb, most likely
- // because grpclb is not registered. Filter out all grpclb addresses
- // from addrs before sending to balancer.
- tempAddrs := make([]resolver.Address, 0, len(addrs))
- for _, a := range addrs {
- if a.Type != resolver.GRPCLB {
- tempAddrs = append(tempAddrs, a)
- }
- }
- addrs = tempAddrs
+ i++
}
}
select {
case <-ccb.resolverUpdateCh:
default:
}
- ccb.resolverUpdateCh <- &resolverUpdate{
- addrs: addrs,
- err: err,
- }
+ ccb.resolverUpdateCh <- &s
}
func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) {
diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go
index df1bb943a..bd2d2b317 100644
--- a/vendor/google.golang.org/grpc/clientconn.go
+++ b/vendor/google.golang.org/grpc/clientconn.go
@@ -42,7 +42,6 @@ import (
"google.golang.org/grpc/internal/grpcsync"
"google.golang.org/grpc/internal/transport"
"google.golang.org/grpc/keepalive"
- "google.golang.org/grpc/metadata"
"google.golang.org/grpc/resolver"
_ "google.golang.org/grpc/resolver/dns" // To register dns resolver.
_ "google.golang.org/grpc/resolver/passthrough" // To register passthrough resolver.
@@ -69,11 +68,9 @@ var (
errConnClosing = errors.New("grpc: the connection is closing")
// errBalancerClosed indicates that the balancer is closed.
errBalancerClosed = errors.New("grpc: balancer is closed")
- // We use an accessor so that minConnectTimeout can be
- // atomically read and updated while testing.
- getMinConnectTimeout = func() time.Duration {
- return minConnectTimeout
- }
+ // invalidDefaultServiceConfigErrPrefix is used to prefix the json parsing error for the default
+ // service config.
+ invalidDefaultServiceConfigErrPrefix = "grpc: the provided default service config is invalid"
)
// The following errors are returned from Dial and DialContext
@@ -140,6 +137,12 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
opt.apply(&cc.dopts)
}
+ defer func() {
+ if err != nil {
+ cc.Close()
+ }
+ }()
+
if channelz.IsOn() {
if cc.dopts.channelzParentID != 0 {
cc.channelzID = channelz.RegisterChannel(&channelzChannel{cc}, cc.dopts.channelzParentID, target)
@@ -179,6 +182,13 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
}
}
+ if cc.dopts.defaultServiceConfigRawJSON != nil {
+ sc, err := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON)
+ if err != nil {
+ return nil, fmt.Errorf("%s: %v", invalidDefaultServiceConfigErrPrefix, err)
+ }
+ cc.dopts.defaultServiceConfig = sc
+ }
cc.mkp = cc.dopts.copts.KeepaliveParams
if cc.dopts.copts.Dialer == nil {
@@ -201,17 +211,12 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
ctx, cancel = context.WithTimeout(ctx, cc.dopts.timeout)
defer cancel()
}
-
defer func() {
select {
case <-ctx.Done():
conn, err = nil, ctx.Err()
default:
}
-
- if err != nil {
- cc.Close()
- }
}()
scSet := false
@@ -220,7 +225,7 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
select {
case sc, ok := <-cc.dopts.scChan:
if ok {
- cc.sc = sc
+ cc.sc = &sc
scSet = true
}
default:
@@ -266,7 +271,7 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
select {
case sc, ok := <-cc.dopts.scChan:
if ok {
- cc.sc = sc
+ cc.sc = &sc
}
case <-ctx.Done():
return nil, ctx.Err()
@@ -388,14 +393,11 @@ type ClientConn struct {
mu sync.RWMutex
resolverWrapper *ccResolverWrapper
- sc ServiceConfig
- scRaw string
+ sc *ServiceConfig
conns map[*addrConn]struct{}
// Keepalive parameter can be updated if a GoAway is received.
mkp keepalive.ClientParameters
curBalancerName string
- preBalancerName string // previous balancer name.
- curAddresses []resolver.Address
balancerWrapper *ccBalancerWrapper
retryThrottler atomic.Value
@@ -437,8 +439,7 @@ func (cc *ClientConn) scWatcher() {
cc.mu.Lock()
// TODO: load balance policy runtime change is ignored.
// We may revisit this decision in the future.
- cc.sc = sc
- cc.scRaw = ""
+ cc.sc = &sc
cc.mu.Unlock()
case <-cc.ctx.Done():
return
@@ -465,50 +466,72 @@ func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) error {
}
}
-func (cc *ClientConn) handleResolvedAddrs(addrs []resolver.Address, err error) {
+// gRPC should resort to default service config when:
+// * resolver service config is disabled
+// * or, resolver does not return a service config or returns an invalid one.
+func (cc *ClientConn) fallbackToDefaultServiceConfig(sc string) bool {
+ if cc.dopts.disableServiceConfig {
+ return true
+ }
+ // The logic below is temporary, will be removed once we change the resolver.State ServiceConfig field type.
+ // Right now, we assume that empty service config string means resolver does not return a config.
+ if sc == "" {
+ return true
+ }
+ // TODO: the logic below is temporary. Once we finish the logic to validate service config
+ // in resolver, we will replace the logic below.
+ _, err := parseServiceConfig(sc)
+ return err != nil
+}
+
+func (cc *ClientConn) updateResolverState(s resolver.State) error {
cc.mu.Lock()
defer cc.mu.Unlock()
+ // Check if the ClientConn is already closed. Some fields (e.g.
+ // balancerWrapper) are set to nil when closing the ClientConn, and could
+ // cause nil pointer panic if we don't have this check.
if cc.conns == nil {
- // cc was closed.
- return
+ return nil
}
- if reflect.DeepEqual(cc.curAddresses, addrs) {
- return
+ if cc.fallbackToDefaultServiceConfig(s.ServiceConfig) {
+ if cc.dopts.defaultServiceConfig != nil && cc.sc == nil {
+ cc.applyServiceConfig(cc.dopts.defaultServiceConfig)
+ }
+ } else {
+ // TODO: the parsing logic below will be moved inside resolver.
+ sc, err := parseServiceConfig(s.ServiceConfig)
+ if err != nil {
+ return err
+ }
+ if cc.sc == nil || cc.sc.rawJSONString != s.ServiceConfig {
+ cc.applyServiceConfig(sc)
+ }
}
- cc.curAddresses = addrs
- cc.firstResolveEvent.Fire()
+ // update the service config that will be sent to balancer.
+ if cc.sc != nil {
+ s.ServiceConfig = cc.sc.rawJSONString
+ }
if cc.dopts.balancerBuilder == nil {
// Only look at balancer types and switch balancer if balancer dial
// option is not set.
var isGRPCLB bool
- for _, a := range addrs {
+ for _, a := range s.Addresses {
if a.Type == resolver.GRPCLB {
isGRPCLB = true
break
}
}
var newBalancerName string
+ // TODO: use new loadBalancerConfig field with appropriate priority.
if isGRPCLB {
newBalancerName = grpclbName
+ } else if cc.sc != nil && cc.sc.LB != nil {
+ newBalancerName = *cc.sc.LB
} else {
- // Address list doesn't contain grpclb address. Try to pick a
- // non-grpclb balancer.
- newBalancerName = cc.curBalancerName
- // If current balancer is grpclb, switch to the previous one.
- if newBalancerName == grpclbName {
- newBalancerName = cc.preBalancerName
- }
- // The following could be true in two cases:
- // - the first time handling resolved addresses
- // (curBalancerName="")
- // - the first time handling non-grpclb addresses
- // (curBalancerName="grpclb", preBalancerName="")
- if newBalancerName == "" {
- newBalancerName = PickFirstBalancerName
- }
+ newBalancerName = PickFirstBalancerName
}
cc.switchBalancer(newBalancerName)
} else if cc.balancerWrapper == nil {
@@ -517,7 +540,9 @@ func (cc *ClientConn) handleResolvedAddrs(addrs []resolver.Address, err error) {
cc.balancerWrapper = newCCBalancerWrapper(cc, cc.dopts.balancerBuilder, cc.balancerBuildOpts)
}
- cc.balancerWrapper.handleResolvedAddrs(addrs, nil)
+ cc.balancerWrapper.updateResolverState(s)
+ cc.firstResolveEvent.Fire()
+ return nil
}
// switchBalancer starts the switching from current balancer to the balancer
@@ -529,10 +554,6 @@ func (cc *ClientConn) handleResolvedAddrs(addrs []resolver.Address, err error) {
//
// Caller must hold cc.mu.
func (cc *ClientConn) switchBalancer(name string) {
- if cc.conns == nil {
- return
- }
-
if strings.ToLower(cc.curBalancerName) == strings.ToLower(name) {
return
}
@@ -542,15 +563,11 @@ func (cc *ClientConn) switchBalancer(name string) {
grpclog.Infoln("ignoring balancer switching: Balancer DialOption used instead")
return
}
- // TODO(bar switching) change this to two steps: drain and close.
- // Keep track of sc in wrapper.
if cc.balancerWrapper != nil {
cc.balancerWrapper.close()
}
builder := balancer.Get(name)
- // TODO(yuxuanli): If user send a service config that does not contain a valid balancer name, should
- // we reuse previous one?
if channelz.IsOn() {
if builder == nil {
channelz.AddTraceEvent(cc.channelzID, &channelz.TraceEventDesc{
@@ -569,7 +586,6 @@ func (cc *ClientConn) switchBalancer(name string) {
builder = newPickfirstBuilder()
}
- cc.preBalancerName = cc.curBalancerName
cc.curBalancerName = builder.Name()
cc.balancerWrapper = newCCBalancerWrapper(cc, builder, cc.balancerBuildOpts)
}
@@ -732,6 +748,9 @@ func (cc *ClientConn) GetMethodConfig(method string) MethodConfig {
// TODO: Avoid the locking here.
cc.mu.RLock()
defer cc.mu.RUnlock()
+ if cc.sc == nil {
+ return MethodConfig{}
+ }
m, ok := cc.sc.Methods[method]
if !ok {
i := strings.LastIndex(method, "/")
@@ -743,14 +762,15 @@ func (cc *ClientConn) GetMethodConfig(method string) MethodConfig {
func (cc *ClientConn) healthCheckConfig() *healthCheckConfig {
cc.mu.RLock()
defer cc.mu.RUnlock()
+ if cc.sc == nil {
+ return nil
+ }
return cc.sc.healthCheckConfig
}
func (cc *ClientConn) getTransport(ctx context.Context, failfast bool, method string) (transport.ClientTransport, func(balancer.DoneInfo), error) {
- hdr, _ := metadata.FromOutgoingContext(ctx)
t, done, err := cc.blockingpicker.pick(ctx, failfast, balancer.PickOptions{
FullMethodName: method,
- Header: hdr,
})
if err != nil {
return nil, nil, toRPCErr(err)
@@ -758,65 +778,25 @@ func (cc *ClientConn) getTransport(ctx context.Context, failfast bool, method st
return t, done, nil
}
-// handleServiceConfig parses the service config string in JSON format to Go native
-// struct ServiceConfig, and store both the struct and the JSON string in ClientConn.
-func (cc *ClientConn) handleServiceConfig(js string) error {
- if cc.dopts.disableServiceConfig {
- return nil
+func (cc *ClientConn) applyServiceConfig(sc *ServiceConfig) error {
+ if sc == nil {
+ // should never reach here.
+ return fmt.Errorf("got nil pointer for service config")
}
- if cc.scRaw == js {
- return nil
- }
- if channelz.IsOn() {
- channelz.AddTraceEvent(cc.channelzID, &channelz.TraceEventDesc{
- // The special formatting of \"%s\" instead of %q is to provide nice printing of service config
- // for human consumption.
- Desc: fmt.Sprintf("Channel has a new service config \"%s\"", js),
- Severity: channelz.CtINFO,
- })
- }
- sc, err := parseServiceConfig(js)
- if err != nil {
- return err
- }
- cc.mu.Lock()
- // Check if the ClientConn is already closed. Some fields (e.g.
- // balancerWrapper) are set to nil when closing the ClientConn, and could
- // cause nil pointer panic if we don't have this check.
- if cc.conns == nil {
- cc.mu.Unlock()
- return nil
- }
- cc.scRaw = js
cc.sc = sc
- if sc.retryThrottling != nil {
+ if cc.sc.retryThrottling != nil {
newThrottler := &retryThrottler{
- tokens: sc.retryThrottling.MaxTokens,
- max: sc.retryThrottling.MaxTokens,
- thresh: sc.retryThrottling.MaxTokens / 2,
- ratio: sc.retryThrottling.TokenRatio,
+ tokens: cc.sc.retryThrottling.MaxTokens,
+ max: cc.sc.retryThrottling.MaxTokens,
+ thresh: cc.sc.retryThrottling.MaxTokens / 2,
+ ratio: cc.sc.retryThrottling.TokenRatio,
}
cc.retryThrottler.Store(newThrottler)
} else {
cc.retryThrottler.Store((*retryThrottler)(nil))
}
- if sc.LB != nil && *sc.LB != grpclbName { // "grpclb" is not a valid balancer option in service config.
- if cc.curBalancerName == grpclbName {
- // If current balancer is grpclb, there's at least one grpclb
- // balancer address in the resolved list. Don't switch the balancer,
- // but change the previous balancer name, so if a new resolved
- // address list doesn't contain grpclb address, balancer will be
- // switched to *sc.LB.
- cc.preBalancerName = *sc.LB
- } else {
- cc.switchBalancer(*sc.LB)
- cc.balancerWrapper.handleResolvedAddrs(cc.curAddresses, nil)
- }
- }
-
- cc.mu.Unlock()
return nil
}
@@ -892,7 +872,7 @@ func (cc *ClientConn) Close() error {
}
channelz.AddTraceEvent(cc.channelzID, ted)
// TraceEvent needs to be called before RemoveEntry, as TraceEvent may add trace reference to
- // the entity beng deleted, and thus prevent it from being deleted right away.
+ // the entity being deleted, and thus prevent it from being deleted right away.
channelz.RemoveEntry(cc.channelzID)
}
return nil
@@ -921,8 +901,6 @@ type addrConn struct {
// Use updateConnectivityState for updating addrConn's connectivity state.
state connectivity.State
- tearDownErr error // The reason this addrConn is torn down.
-
backoffIdx int // Needs to be stateful for resetConnectBackoff.
resetBackoff chan struct{}
@@ -963,191 +941,169 @@ func (ac *addrConn) adjustParams(r transport.GoAwayReason) {
func (ac *addrConn) resetTransport() {
for i := 0; ; i++ {
- tryNextAddrFromStart := grpcsync.NewEvent()
-
- ac.mu.Lock()
if i > 0 {
ac.cc.resolveNow(resolver.ResolveNowOption{})
}
+
+ ac.mu.Lock()
+ if ac.state == connectivity.Shutdown {
+ ac.mu.Unlock()
+ return
+ }
+
addrs := ac.addrs
backoffFor := ac.dopts.bs.Backoff(ac.backoffIdx)
-
// This will be the duration that dial gets to finish.
- dialDuration := getMinConnectTimeout()
+ dialDuration := minConnectTimeout
+ if ac.dopts.minConnectTimeout != nil {
+ dialDuration = ac.dopts.minConnectTimeout()
+ }
+
if dialDuration < backoffFor {
// Give dial more time as we keep failing to connect.
dialDuration = backoffFor
}
+ // We can potentially spend all the time trying the first address, and
+ // if the server accepts the connection and then hangs, the following
+ // addresses will never be tried.
+ //
+ // The spec doesn't mention what should be done for multiple addresses.
+ // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md#proposed-backoff-algorithm
connectDeadline := time.Now().Add(dialDuration)
ac.mu.Unlock()
- addrLoop:
- for _, addr := range addrs {
+ newTr, addr, reconnect, err := ac.tryAllAddrs(addrs, connectDeadline)
+ if err != nil {
+ // After exhausting all addresses, the addrConn enters
+ // TRANSIENT_FAILURE.
ac.mu.Lock()
-
if ac.state == connectivity.Shutdown {
ac.mu.Unlock()
return
}
- ac.updateConnectivityState(connectivity.Connecting)
- ac.transport = nil
+ ac.updateConnectivityState(connectivity.TransientFailure)
- ac.cc.mu.RLock()
- ac.dopts.copts.KeepaliveParams = ac.cc.mkp
- ac.cc.mu.RUnlock()
+ // Backoff.
+ b := ac.resetBackoff
+ ac.mu.Unlock()
- if ac.state == connectivity.Shutdown {
+ timer := time.NewTimer(backoffFor)
+ select {
+ case <-timer.C:
+ ac.mu.Lock()
+ ac.backoffIdx++
ac.mu.Unlock()
+ case <-b:
+ timer.Stop()
+ case <-ac.ctx.Done():
+ timer.Stop()
return
}
-
- copts := ac.dopts.copts
- if ac.scopts.CredsBundle != nil {
- copts.CredsBundle = ac.scopts.CredsBundle
- }
- hctx, hcancel := context.WithCancel(ac.ctx)
- defer hcancel()
- ac.mu.Unlock()
-
- if channelz.IsOn() {
- channelz.AddTraceEvent(ac.channelzID, &channelz.TraceEventDesc{
- Desc: fmt.Sprintf("Subchannel picks a new address %q to connect", addr.Addr),
- Severity: channelz.CtINFO,
- })
- }
-
- reconnect := grpcsync.NewEvent()
- prefaceReceived := make(chan struct{})
- newTr, err := ac.createTransport(addr, copts, connectDeadline, reconnect, prefaceReceived)
- if err == nil {
- ac.mu.Lock()
- ac.curAddr = addr
- ac.transport = newTr
- ac.mu.Unlock()
-
- healthCheckConfig := ac.cc.healthCheckConfig()
- // LB channel health checking is only enabled when all the four requirements below are met:
- // 1. it is not disabled by the user with the WithDisableHealthCheck DialOption,
- // 2. the internal.HealthCheckFunc is set by importing the grpc/healthcheck package,
- // 3. a service config with non-empty healthCheckConfig field is provided,
- // 4. the current load balancer allows it.
- healthcheckManagingState := false
- if !ac.cc.dopts.disableHealthCheck && healthCheckConfig != nil && ac.scopts.HealthCheckEnabled {
- if ac.cc.dopts.healthCheckFunc == nil {
- // TODO: add a link to the health check doc in the error message.
- grpclog.Error("the client side LB channel health check function has not been set.")
- } else {
- // TODO(deklerk) refactor to just return transport
- go ac.startHealthCheck(hctx, newTr, addr, healthCheckConfig.ServiceName)
- healthcheckManagingState = true
- }
- }
- if !healthcheckManagingState {
- ac.mu.Lock()
- ac.updateConnectivityState(connectivity.Ready)
- ac.mu.Unlock()
- }
- } else {
- hcancel()
- if err == errConnClosing {
- return
- }
-
- if tryNextAddrFromStart.HasFired() {
- break addrLoop
- }
- continue
- }
-
- backoffFor = 0
- ac.mu.Lock()
- reqHandshake := ac.dopts.reqHandshake
- ac.mu.Unlock()
-
- <-reconnect.Done()
- hcancel()
-
- if reqHandshake == envconfig.RequireHandshakeHybrid {
- // In RequireHandshakeHybrid mode, we must check to see whether
- // server preface has arrived yet to decide whether to start
- // reconnecting at the top of the list (server preface received)
- // or continue with the next addr in the list as if the
- // connection were not successful (server preface not received).
- select {
- case <-prefaceReceived:
- // We received a server preface - huzzah! We consider this
- // a success and restart from the top of the addr list.
- ac.mu.Lock()
- ac.backoffIdx = 0
- ac.mu.Unlock()
- break addrLoop
- default:
- // Despite having set state to READY, in hybrid mode we
- // consider this a failure and continue connecting at the
- // next addr in the list.
- ac.mu.Lock()
- if ac.state == connectivity.Shutdown {
- ac.mu.Unlock()
- return
- }
-
- ac.updateConnectivityState(connectivity.TransientFailure)
- ac.mu.Unlock()
-
- if tryNextAddrFromStart.HasFired() {
- break addrLoop
- }
- }
- } else {
- // In RequireHandshakeOn mode, we would have already waited for
- // the server preface, so we consider this a success and restart
- // from the top of the addr list. In RequireHandshakeOff mode,
- // we don't care to wait for the server preface before
- // considering this a success, so we also restart from the top
- // of the addr list.
- ac.mu.Lock()
- ac.backoffIdx = 0
- ac.mu.Unlock()
- break addrLoop
- }
+ continue
}
- // After exhausting all addresses, or after need to reconnect after a
- // READY, the addrConn enters TRANSIENT_FAILURE.
+ ac.mu.Lock()
+ if ac.state == connectivity.Shutdown {
+ newTr.Close()
+ ac.mu.Unlock()
+ return
+ }
+ ac.curAddr = addr
+ ac.transport = newTr
+ ac.backoffIdx = 0
+
+ healthCheckConfig := ac.cc.healthCheckConfig()
+ // LB channel health checking is only enabled when all the four requirements below are met:
+ // 1. it is not disabled by the user with the WithDisableHealthCheck DialOption,
+ // 2. the internal.HealthCheckFunc is set by importing the grpc/healthcheck package,
+ // 3. a service config with non-empty healthCheckConfig field is provided,
+ // 4. the current load balancer allows it.
+ hctx, hcancel := context.WithCancel(ac.ctx)
+ healthcheckManagingState := false
+ if !ac.cc.dopts.disableHealthCheck && healthCheckConfig != nil && ac.scopts.HealthCheckEnabled {
+ if ac.cc.dopts.healthCheckFunc == nil {
+ // TODO: add a link to the health check doc in the error message.
+ grpclog.Error("the client side LB channel health check function has not been set.")
+ } else {
+ // TODO(deklerk) refactor to just return transport
+ go ac.startHealthCheck(hctx, newTr, addr, healthCheckConfig.ServiceName)
+ healthcheckManagingState = true
+ }
+ }
+ if !healthcheckManagingState {
+ ac.updateConnectivityState(connectivity.Ready)
+ }
+ ac.mu.Unlock()
+
+ // Block until the created transport is down. And when this happens,
+ // we restart from the top of the addr list.
+ <-reconnect.Done()
+ hcancel()
+
+ // Need to reconnect after a READY, the addrConn enters
+ // TRANSIENT_FAILURE.
+ //
+ // This will set addrConn to TRANSIENT_FAILURE for a very short period
+ // of time, and turns CONNECTING. It seems reasonable to skip this, but
+ // READY-CONNECTING is not a valid transition.
ac.mu.Lock()
if ac.state == connectivity.Shutdown {
ac.mu.Unlock()
return
}
ac.updateConnectivityState(connectivity.TransientFailure)
-
- // Backoff.
- b := ac.resetBackoff
- timer := time.NewTimer(backoffFor)
- acctx := ac.ctx
ac.mu.Unlock()
-
- select {
- case <-timer.C:
- ac.mu.Lock()
- ac.backoffIdx++
- ac.mu.Unlock()
- case <-b:
- timer.Stop()
- case <-acctx.Done():
- timer.Stop()
- return
- }
}
}
-// createTransport creates a connection to one of the backends in addrs. It
-// sets ac.transport in the success case, or it returns an error if it was
-// unable to successfully create a transport.
-//
-// If waitForHandshake is enabled, it blocks until server preface arrives.
-func (ac *addrConn) createTransport(addr resolver.Address, copts transport.ConnectOptions, connectDeadline time.Time, reconnect *grpcsync.Event, prefaceReceived chan struct{}) (transport.ClientTransport, error) {
+// tryAllAddrs tries to creates a connection to the addresses, and stop when at the
+// first successful one. It returns the transport, the address and a Event in
+// the successful case. The Event fires when the returned transport disconnects.
+func (ac *addrConn) tryAllAddrs(addrs []resolver.Address, connectDeadline time.Time) (transport.ClientTransport, resolver.Address, *grpcsync.Event, error) {
+ for _, addr := range addrs {
+ ac.mu.Lock()
+ if ac.state == connectivity.Shutdown {
+ ac.mu.Unlock()
+ return nil, resolver.Address{}, nil, errConnClosing
+ }
+ ac.updateConnectivityState(connectivity.Connecting)
+ ac.transport = nil
+
+ ac.cc.mu.RLock()
+ ac.dopts.copts.KeepaliveParams = ac.cc.mkp
+ ac.cc.mu.RUnlock()
+
+ copts := ac.dopts.copts
+ if ac.scopts.CredsBundle != nil {
+ copts.CredsBundle = ac.scopts.CredsBundle
+ }
+ ac.mu.Unlock()
+
+ if channelz.IsOn() {
+ channelz.AddTraceEvent(ac.channelzID, &channelz.TraceEventDesc{
+ Desc: fmt.Sprintf("Subchannel picks a new address %q to connect", addr.Addr),
+ Severity: channelz.CtINFO,
+ })
+ }
+
+ newTr, reconnect, err := ac.createTransport(addr, copts, connectDeadline)
+ if err == nil {
+ return newTr, addr, reconnect, nil
+ }
+ ac.cc.blockingpicker.updateConnectionError(err)
+ }
+
+ // Couldn't connect to any address.
+ return nil, resolver.Address{}, nil, fmt.Errorf("couldn't connect to any address")
+}
+
+// createTransport creates a connection to addr. It returns the transport and a
+// Event in the successful case. The Event fires when the returned transport
+// disconnects.
+func (ac *addrConn) createTransport(addr resolver.Address, copts transport.ConnectOptions, connectDeadline time.Time) (transport.ClientTransport, *grpcsync.Event, error) {
+ prefaceReceived := make(chan struct{})
onCloseCalled := make(chan struct{})
+ reconnect := grpcsync.NewEvent()
target := transport.TargetInfo{
Addr: addr.Addr,
@@ -1155,8 +1111,6 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne
Authority: ac.cc.authority,
}
- prefaceTimer := time.NewTimer(time.Until(connectDeadline))
-
onGoAway := func(r transport.GoAwayReason) {
ac.mu.Lock()
ac.adjustParams(r)
@@ -1166,13 +1120,11 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne
onClose := func() {
close(onCloseCalled)
- prefaceTimer.Stop()
reconnect.Fire()
}
onPrefaceReceipt := func() {
close(prefaceReceived)
- prefaceTimer.Stop()
}
connectCtx, cancel := context.WithDeadline(ac.ctx, connectDeadline)
@@ -1182,69 +1134,28 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne
}
newTr, err := transport.NewClientTransport(connectCtx, ac.cc.ctx, target, copts, onPrefaceReceipt, onGoAway, onClose)
-
- if err == nil {
- if ac.dopts.reqHandshake == envconfig.RequireHandshakeOn {
- select {
- case <-prefaceTimer.C:
- // We didn't get the preface in time.
- newTr.Close()
- err = errors.New("timed out waiting for server handshake")
- case <-prefaceReceived:
- // We got the preface - huzzah! things are good.
- case <-onCloseCalled:
- // The transport has already closed - noop.
- return nil, errors.New("connection closed")
- }
- } else if ac.dopts.reqHandshake == envconfig.RequireHandshakeHybrid {
- go func() {
- select {
- case <-prefaceTimer.C:
- // We didn't get the preface in time.
- newTr.Close()
- case <-prefaceReceived:
- // We got the preface just in the nick of time - huzzah!
- case <-onCloseCalled:
- // The transport has already closed - noop.
- }
- }()
- }
- }
-
if err != nil {
// newTr is either nil, or closed.
- ac.cc.blockingpicker.updateConnectionError(err)
- ac.mu.Lock()
- if ac.state == connectivity.Shutdown {
- // ac.tearDown(...) has been invoked.
- ac.mu.Unlock()
-
- return nil, errConnClosing
- }
- ac.mu.Unlock()
grpclog.Warningf("grpc: addrConn.createTransport failed to connect to %v. Err :%v. Reconnecting...", addr, err)
- return nil, err
+ return nil, nil, err
}
- // Now there is a viable transport to be use, so set ac.transport to reflect the new viable transport.
- ac.mu.Lock()
- if ac.state == connectivity.Shutdown {
- ac.mu.Unlock()
- newTr.Close()
- return nil, errConnClosing
+ if ac.dopts.reqHandshake == envconfig.RequireHandshakeOn {
+ select {
+ case <-time.After(connectDeadline.Sub(time.Now())):
+ // We didn't get the preface in time.
+ newTr.Close()
+ grpclog.Warningf("grpc: addrConn.createTransport failed to connect to %v: didn't receive server preface in time. Reconnecting...", addr)
+ return nil, nil, errors.New("timed out waiting for server handshake")
+ case <-prefaceReceived:
+ // We got the preface - huzzah! things are good.
+ case <-onCloseCalled:
+ // The transport has already closed - noop.
+ return nil, nil, errors.New("connection closed")
+ // TODO(deklerk) this should bail on ac.ctx.Done(). Add a test and fix.
+ }
}
- ac.mu.Unlock()
-
- // Now there is a viable transport to be use, so set ac.transport to reflect the new viable transport.
- ac.mu.Lock()
- if ac.state == connectivity.Shutdown {
- ac.mu.Unlock()
- newTr.Close()
- return nil, errConnClosing
- }
- ac.mu.Unlock()
-
- return newTr, nil
+ return newTr, reconnect, nil
}
func (ac *addrConn) startHealthCheck(ctx context.Context, newTr transport.ClientTransport, addr resolver.Address, serviceName string) {
@@ -1332,7 +1243,6 @@ func (ac *addrConn) tearDown(err error) {
// between setting the state and logic that waits on context cancelation / etc.
ac.updateConnectivityState(connectivity.Shutdown)
ac.cancel()
- ac.tearDownErr = err
ac.curAddr = resolver.Address{}
if err == errConnDrain && curTr != nil {
// GracefulClose(...) may be executed multiple times when
diff --git a/vendor/google.golang.org/grpc/credentials/credentials.go b/vendor/google.golang.org/grpc/credentials/credentials.go
index a85156045..88aff9459 100644
--- a/vendor/google.golang.org/grpc/credentials/credentials.go
+++ b/vendor/google.golang.org/grpc/credentials/credentials.go
@@ -36,9 +36,6 @@ import (
"google.golang.org/grpc/credentials/internal"
)
-// alpnProtoStr are the specified application level protocols for gRPC.
-var alpnProtoStr = []string{"h2"}
-
// PerRPCCredentials defines the common interface for the credentials which need to
// attach security information to every RPC (e.g., oauth2).
type PerRPCCredentials interface {
@@ -208,10 +205,23 @@ func (c *tlsCreds) OverrideServerName(serverNameOverride string) error {
return nil
}
+const alpnProtoStrH2 = "h2"
+
+func appendH2ToNextProtos(ps []string) []string {
+ for _, p := range ps {
+ if p == alpnProtoStrH2 {
+ return ps
+ }
+ }
+ ret := make([]string, 0, len(ps)+1)
+ ret = append(ret, ps...)
+ return append(ret, alpnProtoStrH2)
+}
+
// NewTLS uses c to construct a TransportCredentials based on TLS.
func NewTLS(c *tls.Config) TransportCredentials {
tc := &tlsCreds{cloneTLSConfig(c)}
- tc.config.NextProtos = alpnProtoStr
+ tc.config.NextProtos = appendH2ToNextProtos(tc.config.NextProtos)
return tc
}
diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go
index 537b25860..e114fecbb 100644
--- a/vendor/google.golang.org/grpc/dialoptions.go
+++ b/vendor/google.golang.org/grpc/dialoptions.go
@@ -55,13 +55,16 @@ type dialOptions struct {
// balancer, and also by WithBalancerName dial option.
balancerBuilder balancer.Builder
// This is to support grpclb.
- resolverBuilder resolver.Builder
- reqHandshake envconfig.RequireHandshakeSetting
- channelzParentID int64
- disableServiceConfig bool
- disableRetry bool
- disableHealthCheck bool
- healthCheckFunc internal.HealthChecker
+ resolverBuilder resolver.Builder
+ reqHandshake envconfig.RequireHandshakeSetting
+ channelzParentID int64
+ disableServiceConfig bool
+ disableRetry bool
+ disableHealthCheck bool
+ healthCheckFunc internal.HealthChecker
+ minConnectTimeout func() time.Duration
+ defaultServiceConfig *ServiceConfig // defaultServiceConfig is parsed from defaultServiceConfigRawJSON.
+ defaultServiceConfigRawJSON *string
}
// DialOption configures how we set up the connection.
@@ -440,12 +443,27 @@ func WithChannelzParentID(id int64) DialOption {
// WithDisableServiceConfig returns a DialOption that causes grpc to ignore any
// service config provided by the resolver and provides a hint to the resolver
// to not fetch service configs.
+//
+// Note that, this dial option only disables service config from resolver. If
+// default service config is provided, grpc will use the default service config.
func WithDisableServiceConfig() DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.disableServiceConfig = true
})
}
+// WithDefaultServiceConfig returns a DialOption that configures the default
+// service config, which will be used in cases where:
+// 1. WithDisableServiceConfig is called.
+// 2. Resolver does not return service config or if the resolver gets and invalid config.
+//
+// This API is EXPERIMENTAL.
+func WithDefaultServiceConfig(s string) DialOption {
+ return newFuncDialOption(func(o *dialOptions) {
+ o.defaultServiceConfigRawJSON = &s
+ })
+}
+
// WithDisableRetry returns a DialOption that disables retries, even if the
// service config enables them. This does not impact transparent retries, which
// will happen automatically if no data is written to the wire or if the RPC is
@@ -470,7 +488,8 @@ func WithMaxHeaderListSize(s uint32) DialOption {
})
}
-// WithDisableHealthCheck disables the LB channel health checking for all SubConns of this ClientConn.
+// WithDisableHealthCheck disables the LB channel health checking for all
+// SubConns of this ClientConn.
//
// This API is EXPERIMENTAL.
func WithDisableHealthCheck() DialOption {
@@ -479,8 +498,8 @@ func WithDisableHealthCheck() DialOption {
})
}
-// withHealthCheckFunc replaces the default health check function with the provided one. It makes
-// tests easier to change the health check function.
+// withHealthCheckFunc replaces the default health check function with the
+// provided one. It makes tests easier to change the health check function.
//
// For testing purpose only.
func withHealthCheckFunc(f internal.HealthChecker) DialOption {
@@ -500,3 +519,14 @@ func defaultDialOptions() dialOptions {
},
}
}
+
+// withGetMinConnectDeadline specifies the function that clientconn uses to
+// get minConnectDeadline. This can be used to make connection attempts happen
+// faster/slower.
+//
+// For testing purpose only.
+func withMinConnectDeadline(f func() time.Duration) DialOption {
+ return newFuncDialOption(func(o *dialOptions) {
+ o.minConnectTimeout = f
+ })
+}
diff --git a/vendor/google.golang.org/grpc/encoding/encoding.go b/vendor/google.golang.org/grpc/encoding/encoding.go
index ade8b7cec..30a75da99 100644
--- a/vendor/google.golang.org/grpc/encoding/encoding.go
+++ b/vendor/google.golang.org/grpc/encoding/encoding.go
@@ -102,10 +102,10 @@ func RegisterCodec(codec Codec) {
if codec == nil {
panic("cannot register a nil Codec")
}
- contentSubtype := strings.ToLower(codec.Name())
- if contentSubtype == "" {
- panic("cannot register Codec with empty string result for String()")
+ if codec.Name() == "" {
+ panic("cannot register Codec with empty string result for Name()")
}
+ contentSubtype := strings.ToLower(codec.Name())
registeredCodecs[contentSubtype] = codec
}
diff --git a/vendor/google.golang.org/grpc/go.mod b/vendor/google.golang.org/grpc/go.mod
index 04188077e..9f3ef3a53 100644
--- a/vendor/google.golang.org/grpc/go.mod
+++ b/vendor/google.golang.org/grpc/go.mod
@@ -7,13 +7,12 @@ require (
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/mock v1.1.1
github.com/golang/protobuf v1.2.0
- golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3
- golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
+ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3
+ golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect
- golang.org/x/sys v0.0.0-20180830151530-49385e6e1522
- golang.org/x/text v0.3.0 // indirect
- golang.org/x/tools v0.0.0-20190114222345-bf090417da8b
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
+ golang.org/x/tools v0.0.0-20190311212946-11955173bddd
google.golang.org/appengine v1.1.0 // indirect
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099
diff --git a/vendor/google.golang.org/grpc/go.sum b/vendor/google.golang.org/grpc/go.sum
index a79939d94..b8638ce76 100644
--- a/vendor/google.golang.org/grpc/go.sum
+++ b/vendor/google.golang.org/grpc/go.sum
@@ -10,20 +10,21 @@ github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 h1:x/bBzNauLQAlE3fLku/xy92Y8QwKX5HZymrMz2IiKFc=
-golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I=
-golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522 h1:Ve1ORMCxvRmSXBwJK+t3Oy+V2vRW2OetUQBq4rJIkZE=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b h1:qMK98NmNCRVDIYFycQ5yVRkvgDUFfdP8Ip4KqmDEB7g=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
diff --git a/vendor/google.golang.org/grpc/grpclog/grpclog.go b/vendor/google.golang.org/grpc/grpclog/grpclog.go
index 1fabb11e1..51bb9457c 100644
--- a/vendor/google.golang.org/grpc/grpclog/grpclog.go
+++ b/vendor/google.golang.org/grpc/grpclog/grpclog.go
@@ -18,7 +18,7 @@
// Package grpclog defines logging for grpc.
//
-// All logs in transport package only go to verbose level 2.
+// All logs in transport and grpclb packages only go to verbose level 2.
// All logs in other packages in grpc are logged in spite of the verbosity level.
//
// In the default logger,
diff --git a/vendor/google.golang.org/grpc/internal/balancerload/load.go b/vendor/google.golang.org/grpc/internal/balancerload/load.go
new file mode 100644
index 000000000..3a905d966
--- /dev/null
+++ b/vendor/google.golang.org/grpc/internal/balancerload/load.go
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2019 gRPC authors.
+ *
+ * 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.
+ */
+
+// Package balancerload defines APIs to parse server loads in trailers. The
+// parsed loads are sent to balancers in DoneInfo.
+package balancerload
+
+import (
+ "google.golang.org/grpc/metadata"
+)
+
+// Parser converts loads from metadata into a concrete type.
+type Parser interface {
+ // Parse parses loads from metadata.
+ Parse(md metadata.MD) interface{}
+}
+
+var parser Parser
+
+// SetParser sets the load parser.
+//
+// Not mutex-protected, should be called before any gRPC functions.
+func SetParser(lr Parser) {
+ parser = lr
+}
+
+// Parse calls parser.Read().
+func Parse(md metadata.MD) interface{} {
+ if parser == nil {
+ return nil
+ }
+ return parser.Parse(md)
+}
diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go
index 62ed0f2f1..11be7cd08 100644
--- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go
+++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go
@@ -34,13 +34,9 @@ const (
type RequireHandshakeSetting int
const (
- // RequireHandshakeHybrid (default, deprecated) indicates to not wait for
- // handshake before considering a connection ready, but wait before
- // considering successful.
- RequireHandshakeHybrid RequireHandshakeSetting = iota
- // RequireHandshakeOn (default after the 1.17 release) indicates to wait
- // for handshake before considering a connection ready/successful.
- RequireHandshakeOn
+ // RequireHandshakeOn indicates to wait for handshake before considering a
+ // connection ready/successful.
+ RequireHandshakeOn RequireHandshakeSetting = iota
// RequireHandshakeOff indicates to not wait for handshake before
// considering a connection ready/successful.
RequireHandshakeOff
@@ -53,7 +49,7 @@ var (
// environment variable.
//
// Will be removed after the 1.18 release.
- RequireHandshake RequireHandshakeSetting
+ RequireHandshake = RequireHandshakeOn
)
func init() {
@@ -64,8 +60,5 @@ func init() {
RequireHandshake = RequireHandshakeOn
case "off":
RequireHandshake = RequireHandshakeOff
- case "hybrid":
- // Will be removed after the 1.17 release.
- RequireHandshake = RequireHandshakeHybrid
}
}
diff --git a/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go b/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go
index 61678feb0..d3fd9dab3 100644
--- a/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go
+++ b/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go
@@ -22,18 +22,24 @@ package syscall
import (
"net"
+ "sync"
"time"
"google.golang.org/grpc/grpclog"
)
-func init() {
- grpclog.Info("CPU time info is unavailable on non-linux or appengine environment.")
+var once sync.Once
+
+func log() {
+ once.Do(func() {
+ grpclog.Info("CPU time info is unavailable on non-linux or appengine environment.")
+ })
}
// GetCPUTime returns the how much CPU time has passed since the start of this process.
// It always returns 0 under non-linux or appengine environment.
func GetCPUTime() int64 {
+ log()
return 0
}
@@ -42,22 +48,26 @@ type Rusage struct{}
// GetRusage is a no-op function under non-linux or appengine environment.
func GetRusage() (rusage *Rusage) {
+ log()
return nil
}
// CPUTimeDiff returns the differences of user CPU time and system CPU time used
// between two Rusage structs. It a no-op function for non-linux or appengine environment.
func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) {
+ log()
return 0, 0
}
// SetTCPUserTimeout is a no-op function under non-linux or appengine environments
func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error {
+ log()
return nil
}
// GetTCPUserTimeout is a no-op function under non-linux or appengine environments
// a negative return value indicates the operation is not supported
func GetTCPUserTimeout(conn net.Conn) (int, error) {
+ log()
return -1, nil
}
diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go
index 73b41ea7e..f2de84d43 100644
--- a/vendor/google.golang.org/grpc/internal/transport/handler_server.go
+++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go
@@ -63,9 +63,6 @@ func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats sta
if _, ok := w.(http.Flusher); !ok {
return nil, errors.New("gRPC requires a ResponseWriter supporting http.Flusher")
}
- if _, ok := w.(http.CloseNotifier); !ok {
- return nil, errors.New("gRPC requires a ResponseWriter supporting http.CloseNotifier")
- }
st := &serverHandlerTransport{
rw: w,
@@ -176,17 +173,11 @@ func (a strAddr) String() string { return string(a) }
// do runs fn in the ServeHTTP goroutine.
func (ht *serverHandlerTransport) do(fn func()) error {
- // Avoid a panic writing to closed channel. Imperfect but maybe good enough.
select {
case <-ht.closedCh:
return ErrConnClosing
- default:
- select {
- case ht.writes <- fn:
- return nil
- case <-ht.closedCh:
- return ErrConnClosing
- }
+ case ht.writes <- fn:
+ return nil
}
}
@@ -237,7 +228,6 @@ func (ht *serverHandlerTransport) WriteStatus(s *Stream, st *status.Status) erro
if ht.stats != nil {
ht.stats.HandleRPC(s.Context(), &stats.OutTrailer{})
}
- close(ht.writes)
}
ht.Close()
return err
@@ -315,19 +305,13 @@ func (ht *serverHandlerTransport) HandleStreams(startStream func(*Stream), trace
ctx, cancel = context.WithCancel(ctx)
}
- // requestOver is closed when either the request's context is done
- // or the status has been written via WriteStatus.
+ // requestOver is closed when the status has been written via WriteStatus.
requestOver := make(chan struct{})
-
- // clientGone receives a single value if peer is gone, either
- // because the underlying connection is dead or because the
- // peer sends an http2 RST_STREAM.
- clientGone := ht.rw.(http.CloseNotifier).CloseNotify()
go func() {
select {
case <-requestOver:
case <-ht.closedCh:
- case <-clientGone:
+ case <-ht.req.Context().Done():
}
cancel()
ht.Close()
@@ -407,10 +391,7 @@ func (ht *serverHandlerTransport) HandleStreams(startStream func(*Stream), trace
func (ht *serverHandlerTransport) runStream() {
for {
select {
- case fn, ok := <-ht.writes:
- if !ok {
- return
- }
+ case fn := <-ht.writes:
fn()
case <-ht.closedCh:
return
diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go
index ff8f4db08..9dee6db61 100644
--- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go
+++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go
@@ -1140,15 +1140,27 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) {
if !ok {
return
}
+ endStream := frame.StreamEnded()
atomic.StoreUint32(&s.bytesReceived, 1)
- var state decodeState
- if err := state.decodeHeader(frame); err != nil {
- t.closeStream(s, err, true, http2.ErrCodeProtocol, status.New(codes.Internal, err.Error()), nil, false)
- // Something wrong. Stops reading even when there is remaining.
+ initialHeader := atomic.SwapUint32(&s.headerDone, 1) == 0
+
+ if !initialHeader && !endStream {
+ // As specified by RFC 7540, a HEADERS frame (and associated CONTINUATION frames) can only appear
+ // at the start or end of a stream. Therefore, second HEADERS frame must have EOS bit set.
+ st := status.New(codes.Internal, "a HEADERS frame cannot appear in the middle of a stream")
+ t.closeStream(s, st.Err(), true, http2.ErrCodeProtocol, st, nil, false)
+ return
+ }
+
+ state := &decodeState{}
+ // Initialize isGRPC value to be !initialHeader, since if a gRPC ResponseHeader has been received
+ // which indicates peer speaking gRPC, we are in gRPC mode.
+ state.data.isGRPC = !initialHeader
+ if err := state.decodeHeader(frame); err != nil {
+ t.closeStream(s, err, true, http2.ErrCodeProtocol, status.Convert(err), nil, endStream)
return
}
- endStream := frame.StreamEnded()
var isHeader bool
defer func() {
if t.statsHandler != nil {
@@ -1167,29 +1179,30 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) {
}
}
}()
+
// If headers haven't been received yet.
- if atomic.SwapUint32(&s.headerDone, 1) == 0 {
+ if initialHeader {
if !endStream {
- // Headers frame is not actually a trailers-only frame.
+ // Headers frame is ResponseHeader.
isHeader = true
// These values can be set without any synchronization because
// stream goroutine will read it only after seeing a closed
// headerChan which we'll close after setting this.
- s.recvCompress = state.encoding
- if len(state.mdata) > 0 {
- s.header = state.mdata
+ s.recvCompress = state.data.encoding
+ if len(state.data.mdata) > 0 {
+ s.header = state.data.mdata
}
- } else {
- s.noHeaders = true
+ close(s.headerChan)
+ return
}
+ // Headers frame is Trailers-only.
+ s.noHeaders = true
close(s.headerChan)
}
- if !endStream {
- return
- }
+
// if client received END_STREAM from server while stream was still active, send RST_STREAM
rst := s.getState() == streamActive
- t.closeStream(s, io.EOF, rst, http2.ErrCodeNo, state.status(), state.mdata, true)
+ t.closeStream(s, io.EOF, rst, http2.ErrCodeNo, state.status(), state.data.mdata, true)
}
// reader runs as a separate goroutine in charge of reading data from network
@@ -1356,6 +1369,8 @@ func (t *http2Client) ChannelzMetric() *channelz.SocketInternalMetric {
return &s
}
+func (t *http2Client) RemoteAddr() net.Addr { return t.remoteAddr }
+
func (t *http2Client) IncrMsgSent() {
atomic.AddInt64(&t.czData.msgSent, 1)
atomic.StoreInt64(&t.czData.lastMsgSentTime, time.Now().UnixNano())
diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go
index d038b2dfe..435092e5c 100644
--- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go
+++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go
@@ -286,7 +286,9 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err
// operateHeader takes action on the decoded headers.
func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func(*Stream), traceCtx func(context.Context, string) context.Context) (fatal bool) {
streamID := frame.Header().StreamID
- state := decodeState{serverSide: true}
+ state := &decodeState{
+ serverSide: true,
+ }
if err := state.decodeHeader(frame); err != nil {
if se, ok := status.FromError(err); ok {
t.controlBuf.put(&cleanupStream{
@@ -305,16 +307,16 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func(
st: t,
buf: buf,
fc: &inFlow{limit: uint32(t.initialWindowSize)},
- recvCompress: state.encoding,
- method: state.method,
- contentSubtype: state.contentSubtype,
+ recvCompress: state.data.encoding,
+ method: state.data.method,
+ contentSubtype: state.data.contentSubtype,
}
if frame.StreamEnded() {
// s is just created by the caller. No lock needed.
s.state = streamReadDone
}
- if state.timeoutSet {
- s.ctx, s.cancel = context.WithTimeout(t.ctx, state.timeout)
+ if state.data.timeoutSet {
+ s.ctx, s.cancel = context.WithTimeout(t.ctx, state.data.timeout)
} else {
s.ctx, s.cancel = context.WithCancel(t.ctx)
}
@@ -327,19 +329,19 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func(
}
s.ctx = peer.NewContext(s.ctx, pr)
// Attach the received metadata to the context.
- if len(state.mdata) > 0 {
- s.ctx = metadata.NewIncomingContext(s.ctx, state.mdata)
+ if len(state.data.mdata) > 0 {
+ s.ctx = metadata.NewIncomingContext(s.ctx, state.data.mdata)
}
- if state.statsTags != nil {
- s.ctx = stats.SetIncomingTags(s.ctx, state.statsTags)
+ if state.data.statsTags != nil {
+ s.ctx = stats.SetIncomingTags(s.ctx, state.data.statsTags)
}
- if state.statsTrace != nil {
- s.ctx = stats.SetIncomingTrace(s.ctx, state.statsTrace)
+ if state.data.statsTrace != nil {
+ s.ctx = stats.SetIncomingTrace(s.ctx, state.data.statsTrace)
}
if t.inTapHandle != nil {
var err error
info := &tap.Info{
- FullMethodName: state.method,
+ FullMethodName: state.data.method,
}
s.ctx, err = t.inTapHandle(s.ctx, info)
if err != nil {
@@ -435,7 +437,7 @@ func (t *http2Server) HandleStreams(handle func(*Stream), traceCtx func(context.
s := t.activeStreams[se.StreamID]
t.mu.Unlock()
if s != nil {
- t.closeStream(s, true, se.Code, nil, false)
+ t.closeStream(s, true, se.Code, false)
} else {
t.controlBuf.put(&cleanupStream{
streamID: se.StreamID,
@@ -577,7 +579,7 @@ func (t *http2Server) handleData(f *http2.DataFrame) {
}
if size > 0 {
if err := s.fc.onData(size); err != nil {
- t.closeStream(s, true, http2.ErrCodeFlowControl, nil, false)
+ t.closeStream(s, true, http2.ErrCodeFlowControl, false)
return
}
if f.Header().Flags.Has(http2.FlagDataPadded) {
@@ -602,11 +604,18 @@ func (t *http2Server) handleData(f *http2.DataFrame) {
}
func (t *http2Server) handleRSTStream(f *http2.RSTStreamFrame) {
- s, ok := t.getStream(f)
- if !ok {
+ // If the stream is not deleted from the transport's active streams map, then do a regular close stream.
+ if s, ok := t.getStream(f); ok {
+ t.closeStream(s, false, 0, false)
return
}
- t.closeStream(s, false, 0, nil, false)
+ // If the stream is already deleted from the active streams map, then put a cleanupStream item into controlbuf to delete the stream from loopy writer's established streams map.
+ t.controlBuf.put(&cleanupStream{
+ streamID: f.Header().StreamID,
+ rst: false,
+ rstCode: 0,
+ onWrite: func() {},
+ })
}
func (t *http2Server) handleSettings(f *http2.SettingsFrame) {
@@ -770,7 +779,7 @@ func (t *http2Server) writeHeaderLocked(s *Stream) error {
if err != nil {
return err
}
- t.closeStream(s, true, http2.ErrCodeInternal, nil, false)
+ t.closeStream(s, true, http2.ErrCodeInternal, false)
return ErrHeaderListSizeLimitViolation
}
if t.stats != nil {
@@ -834,10 +843,12 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
if err != nil {
return err
}
- t.closeStream(s, true, http2.ErrCodeInternal, nil, false)
+ t.closeStream(s, true, http2.ErrCodeInternal, false)
return ErrHeaderListSizeLimitViolation
}
- t.closeStream(s, false, 0, trailingHeader, true)
+ // Send a RST_STREAM after the trailers if the client has not already half-closed.
+ rst := s.getState() == streamActive
+ t.finishStream(s, rst, http2.ErrCodeNo, trailingHeader, true)
if t.stats != nil {
t.stats.HandleRPC(s.Context(), &stats.OutTrailer{})
}
@@ -849,6 +860,9 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) error {
if !s.isHeaderSent() { // Headers haven't been written yet.
if err := t.WriteHeader(s, nil); err != nil {
+ if _, ok := err.(ConnectionError); ok {
+ return err
+ }
// TODO(mmukhi, dfawley): Make sure this is the right code to return.
return status.Errorf(codes.Internal, "transport: %v", err)
}
@@ -1005,16 +1019,24 @@ func (t *http2Server) Close() error {
}
// deleteStream deletes the stream s from transport's active streams.
-func (t *http2Server) deleteStream(s *Stream, eosReceived bool) {
- t.mu.Lock()
- if _, ok := t.activeStreams[s.id]; !ok {
- t.mu.Unlock()
- return
+func (t *http2Server) deleteStream(s *Stream, eosReceived bool) (oldState streamState) {
+ oldState = s.swapState(streamDone)
+ if oldState == streamDone {
+ // If the stream was already done, return.
+ return oldState
}
- delete(t.activeStreams, s.id)
- if len(t.activeStreams) == 0 {
- t.idle = time.Now()
+ // In case stream sending and receiving are invoked in separate
+ // goroutines (e.g., bi-directional streaming), cancel needs to be
+ // called to interrupt the potential blocking on other goroutines.
+ s.cancel()
+
+ t.mu.Lock()
+ if _, ok := t.activeStreams[s.id]; ok {
+ delete(t.activeStreams, s.id)
+ if len(t.activeStreams) == 0 {
+ t.idle = time.Now()
+ }
}
t.mu.Unlock()
@@ -1025,55 +1047,38 @@ func (t *http2Server) deleteStream(s *Stream, eosReceived bool) {
atomic.AddInt64(&t.czData.streamsFailed, 1)
}
}
+
+ return oldState
}
-// closeStream clears the footprint of a stream when the stream is not needed
-// any more.
-func (t *http2Server) closeStream(s *Stream, rst bool, rstCode http2.ErrCode, hdr *headerFrame, eosReceived bool) {
- // Mark the stream as done
- oldState := s.swapState(streamDone)
+// finishStream closes the stream and puts the trailing headerFrame into controlbuf.
+func (t *http2Server) finishStream(s *Stream, rst bool, rstCode http2.ErrCode, hdr *headerFrame, eosReceived bool) {
+ oldState := t.deleteStream(s, eosReceived)
+ // If the stream is already closed, then don't put trailing header to controlbuf.
+ if oldState == streamDone {
+ return
+ }
- // In case stream sending and receiving are invoked in separate
- // goroutines (e.g., bi-directional streaming), cancel needs to be
- // called to interrupt the potential blocking on other goroutines.
- s.cancel()
-
- // Deletes the stream from active streams
- t.deleteStream(s, eosReceived)
-
- cleanup := &cleanupStream{
+ hdr.cleanup = &cleanupStream{
streamID: s.id,
rst: rst,
rstCode: rstCode,
onWrite: func() {},
}
-
- // No trailer. Puts cleanupFrame into transport's control buffer.
- if hdr == nil {
- t.controlBuf.put(cleanup)
- return
- }
-
- // We do the check here, because of the following scenario:
- // 1. closeStream is called first with a trailer. A trailer item with a piggybacked cleanup item
- // is put to control buffer.
- // 2. Loopy writer is waiting on a stream quota. It will never get it because client errored at
- // some point. So loopy can't act on trailer
- // 3. Client sends a RST_STREAM due to the error. Then closeStream is called without a trailer as
- // the result of the received RST_STREAM.
- // If we do this check at the beginning of the closeStream, then we won't put a cleanup item in
- // response to received RST_STREAM into the control buffer and outStream in loopy writer will
- // never get cleaned up.
-
- // If the stream is already done, don't send the trailer.
- if oldState == streamDone {
- return
- }
-
- hdr.cleanup = cleanup
t.controlBuf.put(hdr)
}
+// closeStream clears the footprint of a stream when the stream is not needed any more.
+func (t *http2Server) closeStream(s *Stream, rst bool, rstCode http2.ErrCode, eosReceived bool) {
+ t.deleteStream(s, eosReceived)
+ t.controlBuf.put(&cleanupStream{
+ streamID: s.id,
+ rst: rst,
+ rstCode: rstCode,
+ onWrite: func() {},
+ })
+}
+
func (t *http2Server) RemoteAddr() net.Addr {
return t.remoteAddr
}
diff --git a/vendor/google.golang.org/grpc/internal/transport/http_util.go b/vendor/google.golang.org/grpc/internal/transport/http_util.go
index 77a2cfaae..9d212867c 100644
--- a/vendor/google.golang.org/grpc/internal/transport/http_util.go
+++ b/vendor/google.golang.org/grpc/internal/transport/http_util.go
@@ -78,7 +78,8 @@ var (
codes.ResourceExhausted: http2.ErrCodeEnhanceYourCalm,
codes.PermissionDenied: http2.ErrCodeInadequateSecurity,
}
- httpStatusConvTab = map[int]codes.Code{
+ // HTTPStatusConvTab is the HTTP status code to gRPC error code conversion table.
+ HTTPStatusConvTab = map[int]codes.Code{
// 400 Bad Request - INTERNAL.
http.StatusBadRequest: codes.Internal,
// 401 Unauthorized - UNAUTHENTICATED.
@@ -98,9 +99,7 @@ var (
}
)
-// Records the states during HPACK decoding. Must be reset once the
-// decoding of the entire headers are finished.
-type decodeState struct {
+type parsedHeaderData struct {
encoding string
// statusGen caches the stream status received from the trailer the server
// sent. Client side only. Do not access directly. After all trailers are
@@ -120,8 +119,30 @@ type decodeState struct {
statsTags []byte
statsTrace []byte
contentSubtype string
+
+ // isGRPC field indicates whether the peer is speaking gRPC (otherwise HTTP).
+ //
+ // We are in gRPC mode (peer speaking gRPC) if:
+ // * We are client side and have already received a HEADER frame that indicates gRPC peer.
+ // * The header contains valid a content-type, i.e. a string starts with "application/grpc"
+ // And we should handle error specific to gRPC.
+ //
+ // Otherwise (i.e. a content-type string starts without "application/grpc", or does not exist), we
+ // are in HTTP fallback mode, and should handle error specific to HTTP.
+ isGRPC bool
+ grpcErr error
+ httpErr error
+ contentTypeErr string
+}
+
+// decodeState configures decoding criteria and records the decoded data.
+type decodeState struct {
// whether decoding on server side or not
serverSide bool
+
+ // Records the states during HPACK decoding. It will be filled with info parsed from HTTP HEADERS
+ // frame once decodeHeader function has been invoked and returned.
+ data parsedHeaderData
}
// isReservedHeader checks whether hdr belongs to HTTP2 headers
@@ -202,11 +223,11 @@ func contentType(contentSubtype string) string {
}
func (d *decodeState) status() *status.Status {
- if d.statusGen == nil {
+ if d.data.statusGen == nil {
// No status-details were provided; generate status using code/msg.
- d.statusGen = status.New(codes.Code(int32(*(d.rawStatusCode))), d.rawStatusMsg)
+ d.data.statusGen = status.New(codes.Code(int32(*(d.data.rawStatusCode))), d.data.rawStatusMsg)
}
- return d.statusGen
+ return d.data.statusGen
}
const binHdrSuffix = "-bin"
@@ -244,113 +265,146 @@ func (d *decodeState) decodeHeader(frame *http2.MetaHeadersFrame) error {
if frame.Truncated {
return status.Error(codes.Internal, "peer header list size exceeded limit")
}
+
for _, hf := range frame.Fields {
- if err := d.processHeaderField(hf); err != nil {
- return err
+ d.processHeaderField(hf)
+ }
+
+ if d.data.isGRPC {
+ if d.data.grpcErr != nil {
+ return d.data.grpcErr
+ }
+ if d.serverSide {
+ return nil
+ }
+ if d.data.rawStatusCode == nil && d.data.statusGen == nil {
+ // gRPC status doesn't exist.
+ // Set rawStatusCode to be unknown and return nil error.
+ // So that, if the stream has ended this Unknown status
+ // will be propagated to the user.
+ // Otherwise, it will be ignored. In which case, status from
+ // a later trailer, that has StreamEnded flag set, is propagated.
+ code := int(codes.Unknown)
+ d.data.rawStatusCode = &code
}
- }
-
- if d.serverSide {
return nil
}
- // If grpc status exists, no need to check further.
- if d.rawStatusCode != nil || d.statusGen != nil {
- return nil
+ // HTTP fallback mode
+ if d.data.httpErr != nil {
+ return d.data.httpErr
}
- // If grpc status doesn't exist and http status doesn't exist,
- // then it's a malformed header.
- if d.httpStatus == nil {
- return status.Error(codes.Internal, "malformed header: doesn't contain status(gRPC or HTTP)")
- }
+ var (
+ code = codes.Internal // when header does not include HTTP status, return INTERNAL
+ ok bool
+ )
- if *(d.httpStatus) != http.StatusOK {
- code, ok := httpStatusConvTab[*(d.httpStatus)]
+ if d.data.httpStatus != nil {
+ code, ok = HTTPStatusConvTab[*(d.data.httpStatus)]
if !ok {
code = codes.Unknown
}
- return status.Error(code, http.StatusText(*(d.httpStatus)))
}
- // gRPC status doesn't exist and http status is OK.
- // Set rawStatusCode to be unknown and return nil error.
- // So that, if the stream has ended this Unknown status
- // will be propagated to the user.
- // Otherwise, it will be ignored. In which case, status from
- // a later trailer, that has StreamEnded flag set, is propagated.
- code := int(codes.Unknown)
- d.rawStatusCode = &code
- return nil
+ return status.Error(code, d.constructHTTPErrMsg())
+}
+
+// constructErrMsg constructs error message to be returned in HTTP fallback mode.
+// Format: HTTP status code and its corresponding message + content-type error message.
+func (d *decodeState) constructHTTPErrMsg() string {
+ var errMsgs []string
+
+ if d.data.httpStatus == nil {
+ errMsgs = append(errMsgs, "malformed header: missing HTTP status")
+ } else {
+ errMsgs = append(errMsgs, fmt.Sprintf("%s: HTTP status code %d", http.StatusText(*(d.data.httpStatus)), *d.data.httpStatus))
+ }
+
+ if d.data.contentTypeErr == "" {
+ errMsgs = append(errMsgs, "transport: missing content-type field")
+ } else {
+ errMsgs = append(errMsgs, d.data.contentTypeErr)
+ }
+
+ return strings.Join(errMsgs, "; ")
}
func (d *decodeState) addMetadata(k, v string) {
- if d.mdata == nil {
- d.mdata = make(map[string][]string)
+ if d.data.mdata == nil {
+ d.data.mdata = make(map[string][]string)
}
- d.mdata[k] = append(d.mdata[k], v)
+ d.data.mdata[k] = append(d.data.mdata[k], v)
}
-func (d *decodeState) processHeaderField(f hpack.HeaderField) error {
+func (d *decodeState) processHeaderField(f hpack.HeaderField) {
switch f.Name {
case "content-type":
contentSubtype, validContentType := contentSubtype(f.Value)
if !validContentType {
- return status.Errorf(codes.Internal, "transport: received the unexpected content-type %q", f.Value)
+ d.data.contentTypeErr = fmt.Sprintf("transport: received the unexpected content-type %q", f.Value)
+ return
}
- d.contentSubtype = contentSubtype
+ d.data.contentSubtype = contentSubtype
// TODO: do we want to propagate the whole content-type in the metadata,
// or come up with a way to just propagate the content-subtype if it was set?
// ie {"content-type": "application/grpc+proto"} or {"content-subtype": "proto"}
// in the metadata?
d.addMetadata(f.Name, f.Value)
+ d.data.isGRPC = true
case "grpc-encoding":
- d.encoding = f.Value
+ d.data.encoding = f.Value
case "grpc-status":
code, err := strconv.Atoi(f.Value)
if err != nil {
- return status.Errorf(codes.Internal, "transport: malformed grpc-status: %v", err)
+ d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-status: %v", err)
+ return
}
- d.rawStatusCode = &code
+ d.data.rawStatusCode = &code
case "grpc-message":
- d.rawStatusMsg = decodeGrpcMessage(f.Value)
+ d.data.rawStatusMsg = decodeGrpcMessage(f.Value)
case "grpc-status-details-bin":
v, err := decodeBinHeader(f.Value)
if err != nil {
- return status.Errorf(codes.Internal, "transport: malformed grpc-status-details-bin: %v", err)
+ d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-status-details-bin: %v", err)
+ return
}
s := &spb.Status{}
if err := proto.Unmarshal(v, s); err != nil {
- return status.Errorf(codes.Internal, "transport: malformed grpc-status-details-bin: %v", err)
+ d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-status-details-bin: %v", err)
+ return
}
- d.statusGen = status.FromProto(s)
+ d.data.statusGen = status.FromProto(s)
case "grpc-timeout":
- d.timeoutSet = true
+ d.data.timeoutSet = true
var err error
- if d.timeout, err = decodeTimeout(f.Value); err != nil {
- return status.Errorf(codes.Internal, "transport: malformed time-out: %v", err)
+ if d.data.timeout, err = decodeTimeout(f.Value); err != nil {
+ d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed time-out: %v", err)
}
case ":path":
- d.method = f.Value
+ d.data.method = f.Value
case ":status":
code, err := strconv.Atoi(f.Value)
if err != nil {
- return status.Errorf(codes.Internal, "transport: malformed http-status: %v", err)
+ d.data.httpErr = status.Errorf(codes.Internal, "transport: malformed http-status: %v", err)
+ return
}
- d.httpStatus = &code
+ d.data.httpStatus = &code
case "grpc-tags-bin":
v, err := decodeBinHeader(f.Value)
if err != nil {
- return status.Errorf(codes.Internal, "transport: malformed grpc-tags-bin: %v", err)
+ d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-tags-bin: %v", err)
+ return
}
- d.statsTags = v
+ d.data.statsTags = v
d.addMetadata(f.Name, string(v))
case "grpc-trace-bin":
v, err := decodeBinHeader(f.Value)
if err != nil {
- return status.Errorf(codes.Internal, "transport: malformed grpc-trace-bin: %v", err)
+ d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-trace-bin: %v", err)
+ return
}
- d.statsTrace = v
+ d.data.statsTrace = v
d.addMetadata(f.Name, string(v))
default:
if isReservedHeader(f.Name) && !isWhitelistedHeader(f.Name) {
@@ -359,11 +413,10 @@ func (d *decodeState) processHeaderField(f hpack.HeaderField) error {
v, err := decodeMetadataHeader(f.Name, f.Value)
if err != nil {
errorf("Failed to decode metadata header (%q, %q): %v", f.Name, f.Value, err)
- return nil
+ return
}
d.addMetadata(f.Name, v)
}
- return nil
}
type timeoutUnit uint8
diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go
index 2580aa7d3..7f82cbb08 100644
--- a/vendor/google.golang.org/grpc/internal/transport/transport.go
+++ b/vendor/google.golang.org/grpc/internal/transport/transport.go
@@ -327,8 +327,7 @@ func (s *Stream) TrailersOnly() (bool, error) {
if err != nil {
return false, err
}
- // if !headerDone, some other connection error occurred.
- return s.noHeaders && atomic.LoadUint32(&s.headerDone) == 1, nil
+ return s.noHeaders, nil
}
// Trailer returns the cached trailer metedata. Note that if it is not called
@@ -611,6 +610,9 @@ type ClientTransport interface {
// GetGoAwayReason returns the reason why GoAway frame was received.
GetGoAwayReason() GoAwayReason
+ // RemoteAddr returns the remote network address.
+ RemoteAddr() net.Addr
+
// IncrMsgSent increments the number of message sent through this transport.
IncrMsgSent()
diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go
index a2575c963..f9625496c 100644
--- a/vendor/google.golang.org/grpc/picker_wrapper.go
+++ b/vendor/google.golang.org/grpc/picker_wrapper.go
@@ -165,6 +165,11 @@ func (bp *pickerWrapper) pick(ctx context.Context, failfast bool, opts balancer.
}
return t, done, nil
}
+ if done != nil {
+ // Calling done with nil error, no bytes sent and no bytes received.
+ // DoneInfo with default value works.
+ done(balancer.DoneInfo{})
+ }
grpclog.Infof("blockingPicker: the picked transport is not ready, loop back to repick")
// If ok == false, ac.state is not READY.
// A valid picker always returns READY subConn. This means the state of ac
diff --git a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go
index 2d8da331d..583559907 100644
--- a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go
+++ b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go
@@ -47,6 +47,8 @@ const (
defaultFreq = time.Minute * 30
defaultDNSSvrPort = "53"
golang = "GO"
+ // txtPrefix is the prefix string to be prepended to the host name for txt record lookup.
+ txtPrefix = "_grpc_config."
// In DNS, service config is encoded in a TXT record via the mechanism
// described in RFC-1464 using the attribute name grpc_config.
txtAttribute = "grpc_config="
@@ -282,7 +284,7 @@ func (d *dnsResolver) lookupSRV() []resolver.Address {
}
func (d *dnsResolver) lookupTXT() string {
- ss, err := d.resolver.LookupTXT(d.ctx, d.host)
+ ss, err := d.resolver.LookupTXT(d.ctx, txtPrefix+d.host)
if err != nil {
grpclog.Infof("grpc: failed dns TXT record lookup due to %v.\n", err)
return ""
diff --git a/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go b/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go
index b76010d74..893d5d12c 100644
--- a/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go
+++ b/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go
@@ -45,7 +45,7 @@ type passthroughResolver struct {
}
func (r *passthroughResolver) start() {
- r.cc.NewAddress([]resolver.Address{{Addr: r.target.Endpoint}})
+ r.cc.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: r.target.Endpoint}}})
}
func (*passthroughResolver) ResolveNow(o resolver.ResolveNowOption) {}
diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go
index 145cf477e..52ec603da 100644
--- a/vendor/google.golang.org/grpc/resolver/resolver.go
+++ b/vendor/google.golang.org/grpc/resolver/resolver.go
@@ -98,6 +98,15 @@ type BuildOption struct {
DisableServiceConfig bool
}
+// State contains the current Resolver state relevant to the ClientConn.
+type State struct {
+ Addresses []Address // Resolved addresses for the target
+ ServiceConfig string // JSON representation of the service config
+
+ // TODO: add Err error
+ // TODO: add ParsedServiceConfig interface{}
+}
+
// ClientConn contains the callbacks for resolver to notify any updates
// to the gRPC ClientConn.
//
@@ -106,12 +115,18 @@ type BuildOption struct {
// testing, the new implementation should embed this interface. This allows
// gRPC to add new methods to this interface.
type ClientConn interface {
+ // UpdateState updates the state of the ClientConn appropriately.
+ UpdateState(State)
// NewAddress is called by resolver to notify ClientConn a new list
// of resolved addresses.
// The address list should be the complete list of resolved addresses.
+ //
+ // Deprecated: Use UpdateState instead.
NewAddress(addresses []Address)
// NewServiceConfig is called by resolver to notify ClientConn a new
// service config. The service config should be provided as a json string.
+ //
+ // Deprecated: Use UpdateState instead.
NewServiceConfig(serviceConfig string)
}
diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go
index 50991eafb..e9cef3a92 100644
--- a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go
+++ b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go
@@ -21,6 +21,7 @@ package grpc
import (
"fmt"
"strings"
+ "sync/atomic"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal/channelz"
@@ -30,12 +31,12 @@ import (
// ccResolverWrapper is a wrapper on top of cc for resolvers.
// It implements resolver.ClientConnection interface.
type ccResolverWrapper struct {
- cc *ClientConn
- resolver resolver.Resolver
- addrCh chan []resolver.Address
- scCh chan string
- done chan struct{}
- lastAddressesCount int
+ cc *ClientConn
+ resolver resolver.Resolver
+ addrCh chan []resolver.Address
+ scCh chan string
+ done uint32 // accessed atomically; set to 1 when closed.
+ curState resolver.State
}
// split2 returns the values from strings.SplitN(s, sep, 2).
@@ -82,7 +83,6 @@ func newCCResolverWrapper(cc *ClientConn) (*ccResolverWrapper, error) {
cc: cc,
addrCh: make(chan []resolver.Address, 1),
scCh: make(chan string, 1),
- done: make(chan struct{}),
}
var err error
@@ -99,57 +99,67 @@ func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOption) {
func (ccr *ccResolverWrapper) close() {
ccr.resolver.Close()
- close(ccr.done)
+ atomic.StoreUint32(&ccr.done, 1)
}
-// NewAddress is called by the resolver implemenetion to send addresses to gRPC.
-func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) {
- select {
- case <-ccr.done:
+func (ccr *ccResolverWrapper) isDone() bool {
+ return atomic.LoadUint32(&ccr.done) == 1
+}
+
+func (ccr *ccResolverWrapper) UpdateState(s resolver.State) {
+ if ccr.isDone() {
+ return
+ }
+ grpclog.Infof("ccResolverWrapper: sending update to cc: %v", s)
+ if channelz.IsOn() {
+ ccr.addChannelzTraceEvent(s)
+ }
+ ccr.cc.updateResolverState(s)
+ ccr.curState = s
+}
+
+// NewAddress is called by the resolver implementation to send addresses to gRPC.
+func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) {
+ if ccr.isDone() {
return
- default:
}
grpclog.Infof("ccResolverWrapper: sending new addresses to cc: %v", addrs)
if channelz.IsOn() {
- ccr.addChannelzTraceEvent(addrs)
+ ccr.addChannelzTraceEvent(resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig})
}
- ccr.cc.handleResolvedAddrs(addrs, nil)
+ ccr.curState.Addresses = addrs
+ ccr.cc.updateResolverState(ccr.curState)
}
-// NewServiceConfig is called by the resolver implemenetion to send service
+// NewServiceConfig is called by the resolver implementation to send service
// configs to gRPC.
func (ccr *ccResolverWrapper) NewServiceConfig(sc string) {
- select {
- case <-ccr.done:
+ if ccr.isDone() {
return
- default:
}
grpclog.Infof("ccResolverWrapper: got new service config: %v", sc)
- ccr.cc.handleServiceConfig(sc)
+ if channelz.IsOn() {
+ ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: sc})
+ }
+ ccr.curState.ServiceConfig = sc
+ ccr.cc.updateResolverState(ccr.curState)
}
-func (ccr *ccResolverWrapper) addChannelzTraceEvent(addrs []resolver.Address) {
- if len(addrs) == 0 && ccr.lastAddressesCount != 0 {
- channelz.AddTraceEvent(ccr.cc.channelzID, &channelz.TraceEventDesc{
- Desc: "Resolver returns an empty address list",
- Severity: channelz.CtWarning,
- })
- } else if len(addrs) != 0 && ccr.lastAddressesCount == 0 {
- var s string
- for i, a := range addrs {
- if a.ServerName != "" {
- s += a.Addr + "(" + a.ServerName + ")"
- } else {
- s += a.Addr
- }
- if i != len(addrs)-1 {
- s += " "
- }
- }
- channelz.AddTraceEvent(ccr.cc.channelzID, &channelz.TraceEventDesc{
- Desc: fmt.Sprintf("Resolver returns a non-empty address list (previous one was empty) %q", s),
- Severity: channelz.CtINFO,
- })
+func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) {
+ if s.ServiceConfig == ccr.curState.ServiceConfig && (len(ccr.curState.Addresses) == 0) == (len(s.Addresses) == 0) {
+ return
}
- ccr.lastAddressesCount = len(addrs)
+ var updates []string
+ if s.ServiceConfig != ccr.curState.ServiceConfig {
+ updates = append(updates, "service config updated")
+ }
+ if len(ccr.curState.Addresses) > 0 && len(s.Addresses) == 0 {
+ updates = append(updates, "resolver returned an empty address list")
+ } else if len(ccr.curState.Addresses) == 0 && len(s.Addresses) > 0 {
+ updates = append(updates, "resolver returned new addresses")
+ }
+ channelz.AddTraceEvent(ccr.cc.channelzID, &channelz.TraceEventDesc{
+ Desc: fmt.Sprintf("Resolver state updated: %+v (%v)", s, strings.Join(updates, "; ")),
+ Severity: channelz.CtINFO,
+ })
}
diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go
index 33272a47a..8115828fd 100644
--- a/vendor/google.golang.org/grpc/server.go
+++ b/vendor/google.golang.org/grpc/server.go
@@ -614,12 +614,13 @@ func (s *Server) handleRawConn(rawConn net.Conn) {
rawConn.SetDeadline(time.Now().Add(s.opts.connectionTimeout))
conn, authInfo, err := s.useTransportAuthenticator(rawConn)
if err != nil {
- s.mu.Lock()
- s.errorf("ServerHandshake(%q) failed: %v", rawConn.RemoteAddr(), err)
- s.mu.Unlock()
- grpclog.Warningf("grpc: Server.Serve failed to complete security handshake from %q: %v", rawConn.RemoteAddr(), err)
- // If serverHandshake returns ErrConnDispatched, keep rawConn open.
+ // ErrConnDispatched means that the connection was dispatched away from
+ // gRPC; those connections should be left open.
if err != credentials.ErrConnDispatched {
+ s.mu.Lock()
+ s.errorf("ServerHandshake(%q) failed: %v", rawConn.RemoteAddr(), err)
+ s.mu.Unlock()
+ grpclog.Warningf("grpc: Server.Serve failed to complete security handshake from %q: %v", rawConn.RemoteAddr(), err)
rawConn.Close()
}
rawConn.SetDeadline(time.Time{})
@@ -748,10 +749,11 @@ func (s *Server) traceInfo(st transport.ServerTransport, stream *transport.Strea
trInfo = &traceInfo{
tr: tr,
+ firstLine: firstLine{
+ client: false,
+ remoteAddr: st.RemoteAddr(),
+ },
}
- trInfo.firstLine.client = false
- trInfo.firstLine.remoteAddr = st.RemoteAddr()
-
if dl, ok := stream.Context().Deadline(); ok {
trInfo.firstLine.deadline = time.Until(dl)
}
@@ -859,7 +861,6 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.
}
if trInfo != nil {
defer trInfo.tr.Finish()
- trInfo.firstLine.client = false
trInfo.tr.LazyLog(&trInfo.firstLine, false)
defer func() {
if err != nil && err != io.EOF {
@@ -1245,7 +1246,8 @@ func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Str
service := sm[:pos]
method := sm[pos+1:]
- if srv, ok := s.m[service]; ok {
+ srv, knownService := s.m[service]
+ if knownService {
if md, ok := srv.md[method]; ok {
s.processUnaryRPC(t, stream, srv, md, trInfo)
return
@@ -1260,11 +1262,16 @@ func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Str
s.processStreamingRPC(t, stream, nil, unknownDesc, trInfo)
return
}
+ var errDesc string
+ if !knownService {
+ errDesc = fmt.Sprintf("unknown service %v", service)
+ } else {
+ errDesc = fmt.Sprintf("unknown method %v for service %v", method, service)
+ }
if trInfo != nil {
- trInfo.tr.LazyLog(&fmtStringer{"Unknown service %v", []interface{}{service}}, true)
+ trInfo.tr.LazyPrintf("%s", errDesc)
trInfo.tr.SetError()
}
- errDesc := fmt.Sprintf("unknown service %v", service)
if err := t.WriteStatus(stream, status.New(codes.Unimplemented, errDesc)); err != nil {
if trInfo != nil {
trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true)
diff --git a/vendor/google.golang.org/grpc/service_config.go b/vendor/google.golang.org/grpc/service_config.go
index 162857e20..1c5227426 100644
--- a/vendor/google.golang.org/grpc/service_config.go
+++ b/vendor/google.golang.org/grpc/service_config.go
@@ -99,6 +99,9 @@ type ServiceConfig struct {
// healthCheckConfig must be set as one of the requirement to enable LB channel
// health check.
healthCheckConfig *healthCheckConfig
+ // rawJSONString stores service config json string that get parsed into
+ // this service config struct.
+ rawJSONString string
}
// healthCheckConfig defines the go-native version of the LB channel health check config.
@@ -238,24 +241,22 @@ type jsonSC struct {
HealthCheckConfig *healthCheckConfig
}
-func parseServiceConfig(js string) (ServiceConfig, error) {
- if len(js) == 0 {
- return ServiceConfig{}, fmt.Errorf("no JSON service config provided")
- }
+func parseServiceConfig(js string) (*ServiceConfig, error) {
var rsc jsonSC
err := json.Unmarshal([]byte(js), &rsc)
if err != nil {
grpclog.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err)
- return ServiceConfig{}, err
+ return nil, err
}
sc := ServiceConfig{
LB: rsc.LoadBalancingPolicy,
Methods: make(map[string]MethodConfig),
retryThrottling: rsc.RetryThrottling,
healthCheckConfig: rsc.HealthCheckConfig,
+ rawJSONString: js,
}
if rsc.MethodConfig == nil {
- return sc, nil
+ return &sc, nil
}
for _, m := range *rsc.MethodConfig {
@@ -265,7 +266,7 @@ func parseServiceConfig(js string) (ServiceConfig, error) {
d, err := parseDuration(m.Timeout)
if err != nil {
grpclog.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err)
- return ServiceConfig{}, err
+ return nil, err
}
mc := MethodConfig{
@@ -274,7 +275,7 @@ func parseServiceConfig(js string) (ServiceConfig, error) {
}
if mc.retryPolicy, err = convertRetryPolicy(m.RetryPolicy); err != nil {
grpclog.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err)
- return ServiceConfig{}, err
+ return nil, err
}
if m.MaxRequestMessageBytes != nil {
if *m.MaxRequestMessageBytes > int64(maxInt) {
@@ -299,13 +300,13 @@ func parseServiceConfig(js string) (ServiceConfig, error) {
if sc.retryThrottling != nil {
if sc.retryThrottling.MaxTokens <= 0 ||
- sc.retryThrottling.MaxTokens >= 1000 ||
+ sc.retryThrottling.MaxTokens > 1000 ||
sc.retryThrottling.TokenRatio <= 0 {
// Illegal throttling config; disable throttling.
sc.retryThrottling = nil
}
}
- return sc, nil
+ return &sc, nil
}
func convertRetryPolicy(jrp *jsonRetryPolicy) (p *retryPolicy, err error) {
diff --git a/vendor/google.golang.org/grpc/stats/stats.go b/vendor/google.golang.org/grpc/stats/stats.go
index 84f77dafa..f3f593c84 100644
--- a/vendor/google.golang.org/grpc/stats/stats.go
+++ b/vendor/google.golang.org/grpc/stats/stats.go
@@ -27,6 +27,8 @@ import (
"context"
"net"
"time"
+
+ "google.golang.org/grpc/metadata"
)
// RPCStats contains stats information about RPCs.
@@ -172,6 +174,9 @@ type End struct {
BeginTime time.Time
// EndTime is the time when the RPC ends.
EndTime time.Time
+ // Trailer contains the trailer metadata received from the server. This
+ // field is only valid if this End is from the client side.
+ Trailer metadata.MD
// Error is the error the RPC ended with. It is an error generated from
// status.Status and can be converted back to status.Status using
// status.FromError if non-nil.
diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go
index ccf996b4b..6e2bf51e0 100644
--- a/vendor/google.golang.org/grpc/stream.go
+++ b/vendor/google.golang.org/grpc/stream.go
@@ -33,6 +33,7 @@ import (
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/encoding"
"google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/internal/balancerload"
"google.golang.org/grpc/internal/binarylog"
"google.golang.org/grpc/internal/channelz"
"google.golang.org/grpc/internal/grpcrand"
@@ -230,10 +231,14 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
if c.creds != nil {
callHdr.Creds = c.creds
}
- var trInfo traceInfo
+ var trInfo *traceInfo
if EnableTracing {
- trInfo.tr = trace.New("grpc.Sent."+methodFamily(method), method)
- trInfo.firstLine.client = true
+ trInfo = &traceInfo{
+ tr: trace.New("grpc.Sent."+methodFamily(method), method),
+ firstLine: firstLine{
+ client: true,
+ },
+ }
if deadline, ok := ctx.Deadline(); ok {
trInfo.firstLine.deadline = time.Until(deadline)
}
@@ -323,7 +328,7 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
return cs, nil
}
-func (cs *clientStream) newAttemptLocked(sh stats.Handler, trInfo traceInfo) error {
+func (cs *clientStream) newAttemptLocked(sh stats.Handler, trInfo *traceInfo) error {
cs.attempt = &csAttempt{
cs: cs,
dc: cs.cc.dopts.dc,
@@ -338,6 +343,9 @@ func (cs *clientStream) newAttemptLocked(sh stats.Handler, trInfo traceInfo) err
if err != nil {
return err
}
+ if trInfo != nil {
+ trInfo.firstLine.SetRemoteAddr(t.RemoteAddr())
+ }
cs.attempt.t = t
cs.attempt.done = done
return nil
@@ -414,9 +422,10 @@ type csAttempt struct {
decompSet bool
mu sync.Mutex // guards trInfo.tr
+ // trInfo may be nil (if EnableTracing is false).
// trInfo.tr is set when created (if EnableTracing is true),
// and cleared when the finish method is called.
- trInfo traceInfo
+ trInfo *traceInfo
statsHandler stats.Handler
}
@@ -540,7 +549,7 @@ func (cs *clientStream) retryLocked(lastErr error) error {
cs.commitAttemptLocked()
return err
}
- if err := cs.newAttemptLocked(nil, traceInfo{}); err != nil {
+ if err := cs.newAttemptLocked(nil, nil); err != nil {
return err
}
if lastErr = cs.replayBufferLocked(); lastErr == nil {
@@ -811,7 +820,7 @@ func (cs *clientStream) finish(err error) {
func (a *csAttempt) sendMsg(m interface{}, hdr, payld, data []byte) error {
cs := a.cs
- if EnableTracing {
+ if a.trInfo != nil {
a.mu.Lock()
if a.trInfo.tr != nil {
a.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true)
@@ -868,7 +877,7 @@ func (a *csAttempt) recvMsg(m interface{}, payInfo *payloadInfo) (err error) {
}
return toRPCErr(err)
}
- if EnableTracing {
+ if a.trInfo != nil {
a.mu.Lock()
if a.trInfo.tr != nil {
a.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true)
@@ -881,8 +890,9 @@ func (a *csAttempt) recvMsg(m interface{}, payInfo *payloadInfo) (err error) {
RecvTime: time.Now(),
Payload: m,
// TODO truncate large payload.
- Data: payInfo.uncompressedBytes,
- Length: len(payInfo.uncompressedBytes),
+ Data: payInfo.uncompressedBytes,
+ WireLength: payInfo.wireLength,
+ Length: len(payInfo.uncompressedBytes),
})
}
if channelz.IsOn() {
@@ -915,22 +925,23 @@ func (a *csAttempt) finish(err error) {
// Ending a stream with EOF indicates a success.
err = nil
}
+ var tr metadata.MD
if a.s != nil {
a.t.CloseStream(a.s, err)
+ tr = a.s.Trailer()
}
if a.done != nil {
br := false
- var tr metadata.MD
if a.s != nil {
br = a.s.BytesReceived()
- tr = a.s.Trailer()
}
a.done(balancer.DoneInfo{
Err: err,
Trailer: tr,
BytesSent: a.s != nil,
BytesReceived: br,
+ ServerLoad: balancerload.Parse(tr),
})
}
if a.statsHandler != nil {
@@ -938,11 +949,12 @@ func (a *csAttempt) finish(err error) {
Client: true,
BeginTime: a.cs.beginTime,
EndTime: time.Now(),
+ Trailer: tr,
Error: err,
}
a.statsHandler.HandleRPC(a.cs.ctx, end)
}
- if a.trInfo.tr != nil {
+ if a.trInfo != nil && a.trInfo.tr != nil {
if err == nil {
a.trInfo.tr.LazyPrintf("RPC: [OK]")
} else {
@@ -1466,8 +1478,9 @@ func (ss *serverStream) RecvMsg(m interface{}) (err error) {
RecvTime: time.Now(),
Payload: m,
// TODO truncate large payload.
- Data: payInfo.uncompressedBytes,
- Length: len(payInfo.uncompressedBytes),
+ Data: payInfo.uncompressedBytes,
+ WireLength: payInfo.wireLength,
+ Length: len(payInfo.uncompressedBytes),
})
}
if ss.binlog != nil {
diff --git a/vendor/google.golang.org/grpc/trace.go b/vendor/google.golang.org/grpc/trace.go
index c1c96dedc..0a57b9994 100644
--- a/vendor/google.golang.org/grpc/trace.go
+++ b/vendor/google.golang.org/grpc/trace.go
@@ -24,6 +24,7 @@ import (
"io"
"net"
"strings"
+ "sync"
"time"
"golang.org/x/net/trace"
@@ -53,13 +54,25 @@ type traceInfo struct {
}
// firstLine is the first line of an RPC trace.
+// It may be mutated after construction; remoteAddr specifically may change
+// during client-side use.
type firstLine struct {
+ mu sync.Mutex
client bool // whether this is a client (outgoing) RPC
remoteAddr net.Addr
deadline time.Duration // may be zero
}
+func (f *firstLine) SetRemoteAddr(addr net.Addr) {
+ f.mu.Lock()
+ f.remoteAddr = addr
+ f.mu.Unlock()
+}
+
func (f *firstLine) String() string {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+
var line bytes.Buffer
io.WriteString(&line, "RPC: ")
if f.client {
diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go
index 035b939c0..092e08825 100644
--- a/vendor/google.golang.org/grpc/version.go
+++ b/vendor/google.golang.org/grpc/version.go
@@ -19,4 +19,4 @@
package grpc
// Version is the current grpc version.
-const Version = "1.19.1"
+const Version = "1.20.1"
diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh
index 7209aa5b0..bd5c8de90 100644
--- a/vendor/google.golang.org/grpc/vet.sh
+++ b/vendor/google.golang.org/grpc/vet.sh
@@ -86,7 +86,7 @@ go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go
# - gofmt, goimports, golint (with exceptions for generated code), go vet.
gofmt -s -d -l . 2>&1 | fail_on_output
-goimports -l . 2>&1 | fail_on_output
+goimports -l . 2>&1 | (! grep -vE "(_mock|\.pb)\.go:") | fail_on_output
golint ./... 2>&1 | (! grep -vE "(_mock|\.pb)\.go:")
go tool vet -all .
@@ -108,13 +108,19 @@ fi
# TODO(menghanl): fix errors in transport_test.
staticcheck -go 1.9 -checks 'inherit,-ST1015' -ignore '
google.golang.org/grpc/balancer.go:SA1019
-google.golang.org/grpc/balancer_test.go:SA1019
-google.golang.org/grpc/clientconn_test.go:SA1019
google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go:SA1019
+google.golang.org/grpc/balancer/xds/edsbalancer/balancergroup.go:SA1019
+google.golang.org/grpc/balancer/xds/xds.go:SA1019
+google.golang.org/grpc/balancer_conn_wrappers.go:SA1019
+google.golang.org/grpc/balancer_test.go:SA1019
google.golang.org/grpc/benchmark/benchmain/main.go:SA1019
google.golang.org/grpc/benchmark/worker/benchmark_client.go:SA1019
+google.golang.org/grpc/clientconn.go:S1024
+google.golang.org/grpc/clientconn_state_transition_test.go:SA1019
+google.golang.org/grpc/clientconn_test.go:SA1019
google.golang.org/grpc/internal/transport/handler_server.go:SA1019
google.golang.org/grpc/internal/transport/handler_server_test.go:SA1019
+google.golang.org/grpc/resolver/dns/dns_resolver.go:SA1019
google.golang.org/grpc/stats/stats_test.go:SA1019
google.golang.org/grpc/test/channelz_test.go:SA1019
google.golang.org/grpc/test/end2end_test.go:SA1019
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 46ffb4106..0af5d43ae 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -6,11 +6,11 @@ cloud.google.com/go/internal
cloud.google.com/go/internal/optional
cloud.google.com/go/internal/trace
cloud.google.com/go/internal/version
-# contrib.go.opencensus.io/exporter/ocagent v0.4.12
+# contrib.go.opencensus.io/exporter/ocagent v0.5.0
contrib.go.opencensus.io/exporter/ocagent
# github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1
github.com/1and1/oneandone-cloudserver-sdk-go
-# github.com/Azure/azure-sdk-for-go v27.3.0+incompatible
+# github.com/Azure/azure-sdk-for-go v30.0.0+incompatible
github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute
github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network
github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources
@@ -18,15 +18,15 @@ github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage
github.com/Azure/azure-sdk-for-go/storage
github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions
github.com/Azure/azure-sdk-for-go/version
-# github.com/Azure/go-autorest v10.12.0+incompatible
+# github.com/Azure/go-autorest v12.0.0+incompatible
github.com/Azure/go-autorest/autorest
github.com/Azure/go-autorest/autorest/adal
github.com/Azure/go-autorest/autorest/azure
github.com/Azure/go-autorest/autorest/to
github.com/Azure/go-autorest/autorest/date
github.com/Azure/go-autorest/autorest/validation
-# github.com/Azure/go-autorest/tracing v0.1.0
github.com/Azure/go-autorest/tracing
+github.com/Azure/go-autorest/logger
# github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4
github.com/Azure/go-ntlmssp
# github.com/ChrisTrenkamp/goxpath v0.0.0-20170625215350-4fe035839290
@@ -311,8 +311,6 @@ github.com/konsorten/go-windows-terminal-sequences
github.com/kr/fs
# github.com/linode/linodego v0.7.1
github.com/linode/linodego
-# github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c
-github.com/marstr/guid
# github.com/masterzen/azure-sdk-for-go v0.0.0-20161014135628-ee4f0065d00c
github.com/masterzen/azure-sdk-for-go/core/http
github.com/masterzen/azure-sdk-for-go/core/tls
@@ -474,7 +472,7 @@ github.com/yandex-cloud/go-sdk/pkg/grpcclient
github.com/yandex-cloud/go-sdk/pkg/sdkerrors
github.com/yandex-cloud/go-sdk/pkg/singleflight
github.com/yandex-cloud/go-sdk/gen/iam/awscompatibility
-# go.opencensus.io v0.20.2
+# go.opencensus.io v0.21.0
go.opencensus.io/plugin/ochttp
go.opencensus.io/plugin/ochttp/propagation/tracecontext
go.opencensus.io/stats/view
@@ -555,7 +553,7 @@ golang.org/x/text/runes
golang.org/x/text/internal/tag
# golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
golang.org/x/time/rate
-# google.golang.org/api v0.3.1
+# google.golang.org/api v0.4.0
google.golang.org/api/compute/v1
google.golang.org/api/storage/v1
google.golang.org/api/gensupport
@@ -588,7 +586,7 @@ google.golang.org/genproto/googleapis/iam/v1
google.golang.org/genproto/googleapis/type/timeofday
google.golang.org/genproto/googleapis/rpc/code
google.golang.org/genproto/googleapis/api/httpbody
-# google.golang.org/grpc v1.19.1
+# google.golang.org/grpc v1.20.1
google.golang.org/grpc
google.golang.org/grpc/metadata
google.golang.org/grpc/credentials
@@ -602,6 +600,7 @@ google.golang.org/grpc/encoding/proto
google.golang.org/grpc/grpclog
google.golang.org/grpc/internal
google.golang.org/grpc/internal/backoff
+google.golang.org/grpc/internal/balancerload
google.golang.org/grpc/internal/binarylog
google.golang.org/grpc/internal/channelz
google.golang.org/grpc/internal/envconfig