From 8d90cadc0b2b7e2e838d2e5edd473d4d9fb655c3 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 6 Dec 2016 22:14:21 -0800 Subject: [PATCH 1/3] Update azure dependency. Add contianer registry. --- Godeps/Godeps.json | 50 +- Godeps/LICENSES | 409 ++++++++ .../arm/compute/availabilitysets.go | 22 +- .../azure-sdk-for-go/arm/compute/models.go | 154 +-- .../arm/compute/usageoperations.go | 19 +- .../azure-sdk-for-go/arm/compute/version.go | 6 +- .../arm/compute/virtualmachineextensions.go | 8 + .../arm/compute/virtualmachineimages.go | 24 +- .../arm/compute/virtualmachines.go | 83 +- .../arm/compute/virtualmachinescalesets.go | 172 ++-- .../arm/compute/virtualmachinescalesetvms.go | 103 +- .../arm/compute/virtualmachinesizes.go | 7 + .../arm/containerregistry/client.go | 57 ++ .../arm/containerregistry/models.go | 118 +++ .../arm/containerregistry/registries.go | 685 +++++++++++++ .../arm/containerregistry/version.go | 43 + .../arm/network/applicationgateways.go | 143 ++- .../azure-sdk-for-go/arm/network/client.go | 10 +- .../expressroutecircuitauthorizations.go | 39 +- .../network/expressroutecircuitpeerings.go | 39 +- .../arm/network/expressroutecircuits.go | 92 +- .../network/expressrouteserviceproviders.go | 13 +- .../arm/network/interfaces.go | 104 +- .../arm/network/loadbalancers.go | 47 +- .../arm/network/localnetworkgateways.go | 36 +- .../azure-sdk-for-go/arm/network/models.go | 947 ++++++++++-------- .../arm/network/publicipaddresses.go | 74 +- .../azure-sdk-for-go/arm/network/routes.go | 33 +- .../arm/network/routetables.go | 51 +- .../arm/network/securitygroups.go | 56 +- .../arm/network/securityrules.go | 45 +- .../azure-sdk-for-go/arm/network/subnets.go | 54 +- .../azure-sdk-for-go/arm/network/usages.go | 17 +- .../azure-sdk-for-go/arm/network/version.go | 8 +- .../virtualnetworkgatewayconnections.go | 110 +- .../arm/network/virtualnetworkgateways.go | 71 +- .../arm/network/virtualnetworkpeerings.go | 33 +- .../arm/network/virtualnetworks.go | 46 +- .../azure-sdk-for-go/arm/storage/accounts.go | 115 ++- .../azure-sdk-for-go/arm/storage/models.go | 58 +- .../azure-sdk-for-go/arm/storage/version.go | 6 +- .../Azure/azure-sdk-for-go/storage/README.md | 5 + .../Azure/azure-sdk-for-go/storage/blob.go | 493 ++++++++- .../Azure/azure-sdk-for-go/storage/client.go | 3 +- .../Azure/azure-sdk-for-go/storage/file.go | 832 ++++++++++++++- .../Azure/azure-sdk-for-go/storage/queue.go | 38 + .../storage/table_entities.go | 6 + .../Azure/azure-sdk-for-go/storage/util.go | 2 +- vendor/github.com/Azure/go-ansiterm/README.md | 3 + .../github.com/Azure/go-ansiterm/constants.go | 22 +- .../github.com/Azure/go-ansiterm/context.go | 2 +- .../Azure/go-ansiterm/csi_entry_state.go | 32 +- .../Azure/go-ansiterm/csi_param_state.go | 22 +- .../go-ansiterm/escape_intermediate_state.go | 26 +- .../Azure/go-ansiterm/escape_state.go | 34 +- .../Azure/go-ansiterm/ground_state.go | 12 +- .../Azure/go-ansiterm/osc_string_state.go | 10 +- vendor/github.com/Azure/go-ansiterm/parser.go | 65 +- .../go-ansiterm/parser_action_helpers.go | 2 +- .../Azure/go-ansiterm/parser_actions.go | 2 +- .../Azure/go-ansiterm/parser_test_helpers.go | 114 --- .../go-ansiterm/parser_test_utilities.go | 66 -- vendor/github.com/Azure/go-ansiterm/states.go | 42 +- .../Azure/go-ansiterm/test_event_handler.go | 173 ---- .../Azure/go-ansiterm/winterm/ansi.go | 22 +- .../Azure/go-ansiterm/winterm/api.go | 85 +- .../go-ansiterm/winterm/attr_translation.go | 56 +- .../go-ansiterm/winterm/cursor_helpers.go | 34 +- .../go-ansiterm/winterm/erase_helpers.go | 10 +- .../go-ansiterm/winterm/scroll_helper.go | 26 +- .../Azure/go-ansiterm/winterm/utilities.go | 2 +- .../go-ansiterm/winterm/win_event_handler.go | 161 +-- .../autorest/azure/environments.go | 157 +-- .../Azure/go-autorest/autorest/azure/token.go | 4 +- .../Azure/go-autorest/autorest/client.go | 9 +- .../Azure/go-autorest/autorest/date/time.go | 27 +- .../Azure/go-autorest/autorest/preparer.go | 60 ++ .../Azure/go-autorest/autorest/utility.go | 17 + .../autorest/validation/validation.go | 373 +++++++ 79 files changed, 5225 insertions(+), 2031 deletions(-) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/storage/README.md delete mode 100644 vendor/github.com/Azure/go-ansiterm/parser_test_helpers.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/parser_test_utilities.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/test_event_handler.go create mode 100644 vendor/github.com/Azure/go-autorest/autorest/validation/validation.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 105779cfaba..7169ebd7994 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -30,51 +30,61 @@ }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/compute", - "Comment": "v3.1.0-beta-24-g8316b90", - "Rev": "8316b9060f9c2443ba0864663245695d570a7fa2" + "Comment": "v7.0.1-beta", + "Rev": "0984e0641ae43b89283223034574d6465be93bf4" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/containerregistry", + "Comment": "v7.0.1-beta", + "Rev": "0984e0641ae43b89283223034574d6465be93bf4" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/network", - "Comment": "v3.1.0-beta-24-g8316b90", - "Rev": "8316b9060f9c2443ba0864663245695d570a7fa2" + "Comment": "v7.0.1-beta", + "Rev": "0984e0641ae43b89283223034574d6465be93bf4" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/storage", - "Comment": "v3.1.0-beta-24-g8316b90", - "Rev": "8316b9060f9c2443ba0864663245695d570a7fa2" + "Comment": "v7.0.1-beta", + "Rev": "0984e0641ae43b89283223034574d6465be93bf4" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/storage", - "Comment": "v3.1.0-beta-24-g8316b90", - "Rev": "8316b9060f9c2443ba0864663245695d570a7fa2" + "Comment": "v7.0.1-beta", + "Rev": "0984e0641ae43b89283223034574d6465be93bf4" }, { "ImportPath": "github.com/Azure/go-ansiterm", - "Rev": "70b2c90b260171e829f1ebd7c17f600c11858dbe" + "Rev": "fa152c58bc15761d0200cb75fe958b89a9d4888e" }, { "ImportPath": "github.com/Azure/go-ansiterm/winterm", - "Rev": "70b2c90b260171e829f1ebd7c17f600c11858dbe" + "Rev": "fa152c58bc15761d0200cb75fe958b89a9d4888e" }, { "ImportPath": "github.com/Azure/go-autorest/autorest", - "Comment": "v7.0.6-4-g2492d97", - "Rev": "2492d97b402e00797833c03ac5fa1c572c7bb29a" + "Comment": "v7.2.2-8-ge0c77ec", + "Rev": "e0c77ecbe74311e03f2a629834d2110f031f1453" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/azure", - "Comment": "v7.0.6-4-g2492d97", - "Rev": "2492d97b402e00797833c03ac5fa1c572c7bb29a" + "Comment": "v7.2.2-8-ge0c77ec", + "Rev": "e0c77ecbe74311e03f2a629834d2110f031f1453" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/date", - "Comment": "v7.0.6-4-g2492d97", - "Rev": "2492d97b402e00797833c03ac5fa1c572c7bb29a" + "Comment": "v7.2.2-8-ge0c77ec", + "Rev": "e0c77ecbe74311e03f2a629834d2110f031f1453" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/to", - "Comment": "v7.0.6-4-g2492d97", - "Rev": "2492d97b402e00797833c03ac5fa1c572c7bb29a" + "Comment": "v7.2.2-8-ge0c77ec", + "Rev": "e0c77ecbe74311e03f2a629834d2110f031f1453" + }, + { + "ImportPath": "github.com/Azure/go-autorest/autorest/validation", + "Comment": "v7.2.2-8-ge0c77ec", + "Rev": "e0c77ecbe74311e03f2a629834d2110f031f1453" }, { "ImportPath": "github.com/MakeNowJust/heredoc", @@ -2304,12 +2314,12 @@ }, { "ImportPath": "github.com/vmware/photon-controller-go-sdk/photon", - "Comment": "PROMOTED-336", + "Comment": "PROMOTED-339", "Rev": "dd6be2029ef341cae37b2557ddd302f68176f832" }, { "ImportPath": "github.com/vmware/photon-controller-go-sdk/photon/lightwave", - "Comment": "PROMOTED-336", + "Comment": "PROMOTED-339", "Rev": "dd6be2029ef341cae37b2557ddd302f68176f832" }, { diff --git a/Godeps/LICENSES b/Godeps/LICENSES index 457538a782e..4d2ba996a20 100644 --- a/Godeps/LICENSES +++ b/Godeps/LICENSES @@ -7664,6 +7664,216 @@ SOFTWARE. ================================================================================ +================================================================================ += vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry licensed under: = + + + 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 + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 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. + += vendor/github.com/Azure/azure-sdk-for-go/LICENSE cce6fd055830ca30ff78fdf077e870d6 - +================================================================================ + + ================================================================================ = vendor/github.com/Azure/azure-sdk-for-go/arm/network licensed under: = @@ -9148,6 +9358,205 @@ THE SOFTWARE. ================================================================================ +================================================================================ += vendor/github.com/Azure/go-autorest/autorest/validation licensed under: = + + + 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. + += vendor/github.com/Azure/go-autorest/LICENSE a250e5ac3848f2acadb5adcb9555c18b - +================================================================================ + + ================================================================================ = vendor/github.com/beorn7/perks/quantile licensed under: = diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go index 013a6af9acc..34a4d2df826 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go @@ -21,6 +21,7 @@ package compute import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,12 +42,19 @@ func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the operation to create or update the availability set. +// CreateOrUpdate create or update an availability set. // -// resourceGroupName is the name of the resource group. name is parameters -// supplied to the Create Availability Set operation. parameters is -// parameters supplied to the Create Availability Set operation. +// resourceGroupName is the name of the resource group. name is the name of +// the availability set. parameters is parameters supplied to the Create +// Availability Set operation. func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters AvailabilitySet) (result AvailabilitySet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.AvailabilitySetProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AvailabilitySetProperties.Statuses", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters) if err != nil { return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -107,7 +115,7 @@ func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response return } -// Delete the operation to delete the availability set. +// Delete delete an availability set. // // resourceGroupName is the name of the resource group. availabilitySetName is // the name of the availability set. @@ -169,7 +177,7 @@ func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (resul return } -// Get the operation to get the availability set. +// Get retrieves information about an availability set. // // resourceGroupName is the name of the resource group. availabilitySetName is // the name of the availability set. @@ -232,7 +240,7 @@ func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result A return } -// List the operation to list the availability sets. +// List lists all availability sets in a resource group. // // resourceGroupName is the name of the resource group. func (client AvailabilitySetsClient) List(resourceGroupName string) (result AvailabilitySetListResult, err error) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/models.go index e38a3a12226..13dbe637c4a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/models.go @@ -365,15 +365,15 @@ type APIErrorBase struct { Message *string `json:"message,omitempty"` } -// AvailabilitySet is create or update Availability Set parameters. +// AvailabilitySet is create or update availability set parameters. type AvailabilitySet struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *AvailabilitySetProperties `json:"properties,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *AvailabilitySetProperties `json:"properties,omitempty"` } // AvailabilitySetListResult is the List Availability Set operation response. @@ -477,7 +477,7 @@ type KeyVaultSecretReference struct { SourceVault *SubResource `json:"sourceVault,omitempty"` } -// LinuxConfiguration is describes Windows Configuration of the OS Profile. +// LinuxConfiguration is describes Windows configuration of the OS Profile. type LinuxConfiguration struct { DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` SSH *SSHConfiguration `json:"ssh,omitempty"` @@ -522,8 +522,8 @@ type LongRunningOperationProperties struct { // NetworkInterfaceReference is describes a network interface reference. type NetworkInterfaceReference struct { - ID *string `json:"id,omitempty"` - Properties *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` + ID *string `json:"id,omitempty"` + *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` } // NetworkInterfaceReferenceProperties is describes a network interface @@ -581,7 +581,7 @@ type PurchasePlan struct { Product *string `json:"product,omitempty"` } -// Resource is +// Resource is the resource model definition. type Resource struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -661,15 +661,15 @@ type VirtualHardDisk struct { // VirtualMachine is describes a Virtual Machine. type VirtualMachine struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Plan *Plan `json:"plan,omitempty"` - Properties *VirtualMachineProperties `json:"properties,omitempty"` - Resources *[]VirtualMachineExtension `json:"resources,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + Plan *Plan `json:"plan,omitempty"` + *VirtualMachineProperties `json:"properties,omitempty"` + Resources *[]VirtualMachineExtension `json:"resources,omitempty"` } // VirtualMachineAgentInstanceView is the instance view of the VM Agent @@ -689,9 +689,9 @@ type VirtualMachineCaptureParameters struct { // VirtualMachineCaptureResult is resource Id. type VirtualMachineCaptureResult struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Properties *VirtualMachineCaptureResultProperties `json:"properties,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + *VirtualMachineCaptureResultProperties `json:"properties,omitempty"` } // VirtualMachineCaptureResultProperties is compute-specific operation @@ -702,13 +702,13 @@ type VirtualMachineCaptureResultProperties struct { // VirtualMachineExtension is describes a Virtual Machine Extension. type VirtualMachineExtension struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *VirtualMachineExtensionProperties `json:"properties,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *VirtualMachineExtensionProperties `json:"properties,omitempty"` } // VirtualMachineExtensionHandlerInstanceView is the instance view of a @@ -721,13 +721,13 @@ type VirtualMachineExtensionHandlerInstanceView struct { // VirtualMachineExtensionImage is describes a Virtual Machine Extension Image. type VirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` } // VirtualMachineExtensionImageProperties is describes the properties of a @@ -766,12 +766,12 @@ type VirtualMachineExtensionProperties struct { // VirtualMachineImage is describes a Virtual Machine Image. type VirtualMachineImage struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *VirtualMachineImageProperties `json:"properties,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *VirtualMachineImageProperties `json:"properties,omitempty"` } // VirtualMachineImageProperties is describes the properties of a Virtual @@ -837,22 +837,22 @@ type VirtualMachineProperties struct { // VirtualMachineScaleSet is describes a Virtual Machine Scale Set. type VirtualMachineScaleSet struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Properties *VirtualMachineScaleSetProperties `json:"properties,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + Sku *Sku `json:"sku,omitempty"` + *VirtualMachineScaleSetProperties `json:"properties,omitempty"` } // VirtualMachineScaleSetExtension is describes a Virtual Machine Scale Set // Extension. type VirtualMachineScaleSetExtension struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` } // VirtualMachineScaleSetExtensionProfile is describes a virtual machine scale @@ -891,9 +891,9 @@ type VirtualMachineScaleSetInstanceViewStatusesSummary struct { // VirtualMachineScaleSetIPConfiguration is describes a virtual machine scale // set network profile's IP configuration. type VirtualMachineScaleSetIPConfiguration struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` } // VirtualMachineScaleSetIPConfigurationProperties is describes a virtual @@ -968,9 +968,9 @@ func (client VirtualMachineScaleSetListWithLinkResult) VirtualMachineScaleSetLis // VirtualMachineScaleSetNetworkConfiguration is describes a virtual machine // scale set network profile's network configurations. type VirtualMachineScaleSetNetworkConfiguration struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` } // VirtualMachineScaleSetNetworkConfigurationProperties is describes a virtual @@ -1015,7 +1015,7 @@ type VirtualMachineScaleSetProperties struct { UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - OverProvision *bool `json:"overProvision,omitempty"` + Overprovision *bool `json:"overprovision,omitempty"` } // VirtualMachineScaleSetSku is describes an available virtual machine scale @@ -1044,17 +1044,17 @@ type VirtualMachineScaleSetStorageProfile struct { // VirtualMachineScaleSetVM is describes a virtual machine scale set virtual // machine. type VirtualMachineScaleSetVM struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - InstanceID *string `json:"instanceId,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Properties *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` - Plan *Plan `json:"plan,omitempty"` - Resources *[]VirtualMachineExtension `json:"resources,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + InstanceID *string `json:"instanceId,omitempty"` + Sku *Sku `json:"sku,omitempty"` + *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Resources *[]VirtualMachineExtension `json:"resources,omitempty"` } // VirtualMachineScaleSetVMExtensionsSummary is extensions summary for virtual @@ -1064,14 +1064,14 @@ type VirtualMachineScaleSetVMExtensionsSummary struct { StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } -// VirtualMachineScaleSetVMInstanceIDs is specifies the list of virtual -// machine scale set instance IDs. +// VirtualMachineScaleSetVMInstanceIDs is specifies a list of virtual machine +// instance IDs from the VM scale set. type VirtualMachineScaleSetVMInstanceIDs struct { InstanceIds *[]string `json:"instanceIds,omitempty"` } -// VirtualMachineScaleSetVMInstanceRequiredIDs is specifies the list of -// virtual machine scale set instance IDs. +// VirtualMachineScaleSetVMInstanceRequiredIDs is specifies a list of virtual +// machine instance IDs from the VM scale set. type VirtualMachineScaleSetVMInstanceRequiredIDs struct { InstanceIds *[]string `json:"instanceIds,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/usageoperations.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/usageoperations.go index 922ae1d98db..5fb5bd6f555 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/usageoperations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/usageoperations.go @@ -21,6 +21,7 @@ package compute import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,10 +42,18 @@ func NewUsageOperationsClientWithBaseURI(baseURI string, subscriptionID string) return UsageOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists compute usages for a subscription. +// List gets, for the specified location, the current compute resource usage +// information as well as the limits for compute resources under the +// subscription. // -// location is the location upon which resource usage is queried. +// location is the location for which resource usage is queried. func (client UsageOperationsClient) List(location string) (result ListUsagesResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.UsageOperationsClient", "List") + } + req, err := client.ListPreparer(location) if err != nil { return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", nil, "Failure preparing request") @@ -106,7 +115,7 @@ func (client UsageOperationsClient) ListResponder(resp *http.Response) (result L func (client UsageOperationsClient) ListNextResults(lastResults ListUsagesResult) (result ListUsagesResult, err error) { req, err := lastResults.ListUsagesResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -115,12 +124,12 @@ func (client UsageOperationsClient) ListNextResults(lastResults ListUsagesResult resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/version.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/version.go index dffee825d15..3c4783ed6fa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/version.go @@ -23,9 +23,9 @@ import ( ) const ( - major = "3" - minor = "2" - patch = "0" + major = "7" + minor = "0" + patch = "1" // Always begin a "tag" with a dash (as per http://semver.org) tag = "-beta" semVerFormat = "%s.%s.%s%s" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go index 826687b045f..d94a2b9683a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go @@ -21,6 +21,7 @@ package compute import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -52,6 +53,13 @@ func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID // extensionParameters is parameters supplied to the Create Virtual Machine // Extension operation. func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: extensionParameters, + Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, vmName, vmExtensionName, extensionParameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go index 50d96146028..db187778937 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go @@ -43,6 +43,9 @@ func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID str // Get gets a virtual machine image. // +// location is the name of a supported Azure region. publisherName is a valid +// image publisher. offer is a valid image publisher offer. skus is a valid +// image SKU. version is a valid image SKU version. func (client VirtualMachineImagesClient) Get(location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { req, err := client.GetPreparer(location, publisherName, offer, skus, version) if err != nil { @@ -105,9 +108,12 @@ func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (resu return } -// List gets a list of virtual machine images. +// List gets a list of all virtual machine image versions for the specified +// location, publisher, offer, and SKU. // -// filter is the filter to apply on the operation. +// location is the name of a supported Azure region. publisherName is a valid +// image publisher. offer is a valid image publisher offer. skus is a valid +// image SKU. filter is the filter to apply on the operation. func (client VirtualMachineImagesClient) List(location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListPreparer(location, publisherName, offer, skus, filter, top, orderby) if err != nil { @@ -178,8 +184,11 @@ func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (res return } -// ListOffers gets a list of virtual machine image offers. +// ListOffers gets a list of virtual machine image offers for the specified +// location and publisher. // +// location is the name of a supported Azure region. publisherName is a valid +// image publisher. func (client VirtualMachineImagesClient) ListOffers(location string, publisherName string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListOffersPreparer(location, publisherName) if err != nil { @@ -239,8 +248,10 @@ func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response return } -// ListPublishers gets a list of virtual machine image publishers. +// ListPublishers gets a list of virtual machine image publishers for the +// specified Azure location. // +// location is the name of a supported Azure region. func (client VirtualMachineImagesClient) ListPublishers(location string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListPublishersPreparer(location) if err != nil { @@ -299,8 +310,11 @@ func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Resp return } -// ListSkus gets a list of virtual machine image skus. +// ListSkus gets a list of virtual machine image SKUs for the specified +// location, publisher, and offer. // +// location is the name of a supported Azure region. publisherName is a valid +// image publisher. offer is a valid image publisher offer. func (client VirtualMachineImagesClient) ListSkus(location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListSkusPreparer(location, publisherName, offer) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go index a55c845de85..626319737ce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go @@ -21,6 +21,7 @@ package compute import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -51,6 +52,14 @@ func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) // the virtual machine. parameters is parameters supplied to the Capture // Virtual Machine operation. func (client VirtualMachinesClient) Capture(resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VhdPrefix", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DestinationContainerName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.OverwriteVhds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachinesClient", "Capture") + } + req, err := client.CapturePreparer(resourceGroupName, vmName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure preparing request") @@ -121,6 +130,33 @@ func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (resul // the virtual machine. parameters is parameters supplied to the Create // Virtual Machine operation. func (client VirtualMachinesClient) CreateOrUpdate(resourceGroupName string, vmName string, parameters VirtualMachine, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.Vhd", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.VirtualMachineProperties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineProperties.InstanceView", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineProperties.VMID", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}, + {Target: "parameters.Resources", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachinesClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, vmName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -182,9 +218,9 @@ func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) return } -// Deallocate shuts down the Virtual Machine and releases the compute -// resources. You are not billed for the compute resources that this Virtual -// Machine uses. This method may poll for completion. Polling can be canceled +// Deallocate shuts down the virtual machine and releases the compute +// resources. You are not billed for the compute resources that this virtual +// machine uses. This method may poll for completion. Polling can be canceled // by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // @@ -317,7 +353,7 @@ func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result return } -// Generalize sets the state of the VM as Generalized. +// Generalize sets the state of the virtual machine to generalized. // // resourceGroupName is the name of the resource group. vmName is the name of // the virtual machine. @@ -379,7 +415,8 @@ func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (re return } -// Get the operation to get a virtual machine. +// Get retrieves information about the model view or the instance view of a +// virtual machine. // // resourceGroupName is the name of the resource group. vmName is the name of // the virtual machine. expand is the expand expression to apply on the @@ -446,7 +483,9 @@ func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result Vi return } -// List the operation to list virtual machines under a resource group. +// List lists all of the virtual machines in the specified resource group. Use +// the nextLink property in the response to get the next page of virtual +// machines. // // resourceGroupName is the name of the resource group. func (client VirtualMachinesClient) List(resourceGroupName string) (result VirtualMachineListResult, err error) { @@ -511,7 +550,7 @@ func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result V func (client VirtualMachinesClient) ListNextResults(lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { req, err := lastResults.VirtualMachineListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -520,20 +559,20 @@ func (client VirtualMachinesClient) ListNextResults(lastResults VirtualMachineLi resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to next results request") } return } -// ListAll gets the list of Virtual Machines in the subscription. Use nextLink -// property in the response to get the next page of Virtual Machines. Do this -// till nextLink is not null to fetch all the Virtual Machines. +// ListAll lists all of the virtual machines in the specified subscription. +// Use the nextLink property in the response to get the next page of virtual +// machines. func (client VirtualMachinesClient) ListAll() (result VirtualMachineListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -595,7 +634,7 @@ func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (resul func (client VirtualMachinesClient) ListAllNextResults(lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { req, err := lastResults.VirtualMachineListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -604,19 +643,19 @@ func (client VirtualMachinesClient) ListAllNextResults(lastResults VirtualMachin resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to next results request") } return } -// ListAvailableSizes lists all available virtual machine sizes it can be -// resized to for a virtual machine. +// ListAvailableSizes lists all available virtual machine sizes to which the +// specified virtual machine can be resized. // // resourceGroupName is the name of the resource group. vmName is the name of // the virtual machine. @@ -679,10 +718,12 @@ func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Respo return } -// PowerOff the operation to power off (stop) a virtual machine. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// PowerOff the operation to power off (stop) a virtual machine. The virtual +// machine can be restarted with the same provisioned resources. You are +// still charged for this virtual machine. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. vmName is the name of // the virtual machine. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go index 649e008ee69..648e9fa4aec 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go @@ -21,6 +21,7 @@ package compute import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,16 +42,28 @@ func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate allows you to create or update a virtual machine scale set -// by providing parameters or a path to pre-configured parameter file. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and -// any outstanding HTTP requests. +// CreateOrUpdate create or update a VM scale set. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // -// resourceGroupName is the name of the resource group. name is parameters -// supplied to the Create Virtual Machine Scale Set operation. parameters is -// parameters supplied to the Create Virtual Machine Scale Set operation. +// resourceGroupName is the name of the resource group. name is the name of +// the VM scale set to create or update. parameters is the scale set object. func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.VirtualMachineProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile.OsDisk", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile.OsDisk.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}, + {Target: "parameters.VirtualMachineScaleSetProperties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -112,16 +125,16 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.R return } -// Deallocate allows you to deallocate virtual machines in a virtual machine -// scale set. Shuts down the virtual machines and releases the compute -// resources. You are not billed for the compute resources that this virtual -// machine scale set uses. This method may poll for completion. Polling can -// be canceled by passing the cancel channel argument. The channel will be -// used to cancel polling and any outstanding HTTP requests. +// Deallocate deallocates specific virtual machines in a VM scale set. Shuts +// down the virtual machines and releases the compute resources. You are not +// billed for the compute resources that this virtual machine scale set +// deallocates. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. vmInstanceIDs is the list of -// virtual machine scale set instance IDs. +// name of the VM scale set. vmInstanceIDs is a list of virtual machine +// instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Deallocate(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) if err != nil { @@ -187,13 +200,12 @@ func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Respo return } -// Delete allows you to delete a virtual machine scale set. This method may -// poll for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes a VM scale set. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will +// be used to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. +// name of the VM scale set. func (client VirtualMachineScaleSetsClient) Delete(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, cancel) if err != nil { @@ -254,15 +266,21 @@ func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) return } -// DeleteInstances allows you to delete virtual machines in a virtual machine -// scale set. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// DeleteInstances deletes virtual machines in a VM scale set. This method may +// poll for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. vmInstanceIDs is the list of -// virtual machine scale set instance IDs. +// name of the VM scale set. vmInstanceIDs is a list of virtual machine +// instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) DeleteInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vmInstanceIDs, + Constraints: []validation.Constraint{{Target: "vmInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances") + } + req, err := client.DeleteInstancesPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request") @@ -327,7 +345,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http. // Get display information about a virtual machine scale set. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. +// name of the VM scale set. func (client VirtualMachineScaleSetsClient) Get(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSet, err error) { req, err := client.GetPreparer(resourceGroupName, vmScaleSetName) if err != nil { @@ -387,10 +405,10 @@ func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (r return } -// GetInstanceView displays status of a virtual machine scale set instance. +// GetInstanceView gets the status of a VM scale set instance. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. +// name of the VM scale set. func (client VirtualMachineScaleSetsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { req, err := client.GetInstanceViewPreparer(resourceGroupName, vmScaleSetName) if err != nil { @@ -450,7 +468,7 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http. return } -// List lists all virtual machine scale sets under a resource group. +// List gets a list of all VM scale sets under a resource group. // // resourceGroupName is the name of the resource group. func (client VirtualMachineScaleSetsClient) List(resourceGroupName string) (result VirtualMachineScaleSetListResult, err error) { @@ -515,7 +533,7 @@ func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) ( func (client VirtualMachineScaleSetsClient) ListNextResults(lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { req, err := lastResults.VirtualMachineScaleSetListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -524,21 +542,21 @@ func (client VirtualMachineScaleSetsClient) ListNextResults(lastResults VirtualM resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to next results request") } return } -// ListAll lists all Virtual Machine Scale Sets in the subscription. Use -// nextLink property in the response to get the next page of Virtual Machine -// Scale Sets. Do this till nextLink is not null to fetch all the Virtual -// Machine Scale Sets. +// ListAll gets a list of all VM Scale Sets in the subscription, regardless of +// the associated resource group. Use nextLink property in the response to +// get the next page of VM Scale Sets. Do this till nextLink is not null to +// fetch all the VM Scale Sets. func (client VirtualMachineScaleSetsClient) ListAll() (result VirtualMachineScaleSetListWithLinkResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -600,7 +618,7 @@ func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response func (client VirtualMachineScaleSetsClient) ListAllNextResults(lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) { req, err := lastResults.VirtualMachineScaleSetListWithLinkResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -609,23 +627,22 @@ func (client VirtualMachineScaleSetsClient) ListAllNextResults(lastResults Virtu resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to next results request") } return } -// ListSkus displays available skus for your virtual machine scale set -// including the minimum and maximum vm instances allowed for a particular -// sku. +// ListSkus gets a list of SKUs available for your VM scale set, including the +// minimum and maximum VM instances allowed for each SKU. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. +// name of the VM scale set. func (client VirtualMachineScaleSetsClient) ListSkus(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetListSkusResult, err error) { req, err := client.ListSkusPreparer(resourceGroupName, vmScaleSetName) if err != nil { @@ -689,7 +706,7 @@ func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Respons func (client VirtualMachineScaleSetsClient) ListSkusNextResults(lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) { req, err := lastResults.VirtualMachineScaleSetListSkusResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing next results request") } if req == nil { return @@ -698,27 +715,27 @@ func (client VirtualMachineScaleSetsClient) ListSkusNextResults(lastResults Virt resp, err := client.ListSkusSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending next results request") } result, err = client.ListSkusResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to next results request") } return } -// PowerOff allows you to power off (stop) virtual machines in a virtual -// machine scale set. Note that resources are still attached and you are -// getting charged for the resources. Use deallocate to release resources. +// PowerOff power off (stop) one or more virtual machines in a VM scale set. +// Note that resources are still attached and you are getting charged for the +// resources. Instead, use deallocate to release resources and avoid charges. // This method may poll for completion. Polling can be canceled by passing // the cancel channel argument. The channel will be used to cancel polling // and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. vmInstanceIDs is the list of -// virtual machine scale set instance IDs. +// name of the VM scale set. vmInstanceIDs is a list of virtual machine +// instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) PowerOff(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) if err != nil { @@ -784,14 +801,13 @@ func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Respons return } -// Reimage allows you to re-image(update the version of the installed -// operating system) virtual machines in a virtual machine scale set. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and -// any outstanding HTTP requests. +// Reimage reimages (upgrade the operating system) one or more virtual +// machines in a VM scale set. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will +// be used to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. +// name of the VM scale set. func (client VirtualMachineScaleSetsClient) Reimage(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, cancel) if err != nil { @@ -852,14 +868,14 @@ func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response return } -// Restart allows you to restart virtual machines in a virtual machine scale -// set. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Restart restarts one or more virtual machines in a VM scale set. This +// method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and +// any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. vmInstanceIDs is the list of -// virtual machine scale set instance IDs. +// name of the VM scale set. vmInstanceIDs is a list of virtual machine +// instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Restart(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) if err != nil { @@ -925,14 +941,14 @@ func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response return } -// Start allows you to start virtual machines in a virtual machine scale set. -// This method may poll for completion. Polling can be canceled by passing -// the cancel channel argument. The channel will be used to cancel polling -// and any outstanding HTTP requests. +// Start starts one or more virtual machines in a VM scale set. This method +// may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. vmInstanceIDs is the list of -// virtual machine scale set instance IDs. +// name of the VM scale set. vmInstanceIDs is a list of virtual machine +// instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Start(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) if err != nil { @@ -998,15 +1014,21 @@ func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) return } -// UpdateInstances allows you to manually upgrade virtual machines in a -// virtual machine scale set. This method may poll for completion. Polling +// UpdateInstances upgrades one or more virtual machines to the latest SKU set +// in the VM scale set model. This method may poll for completion. Polling // can be canceled by passing the cancel channel argument. The channel will // be used to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. vmInstanceIDs is the list of -// virtual machine scale set instance IDs. +// name of the VM scale set. vmInstanceIDs is a list of virtual machine +// instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) UpdateInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vmInstanceIDs, + Constraints: []validation.Constraint{{Target: "vmInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances") + } + req, err := client.UpdateInstancesPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go index 1db4a136009..f0b309510e6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go @@ -41,16 +41,16 @@ func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionI return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Deallocate allows you to deallocate a virtual machine scale set virtual -// machine. Shuts down the virtual machine and releases the compute -// resources. You are not billed for the compute resources that this virtual -// machine uses. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts +// down the virtual machine and releases the compute resources it uses. You +// are not billed for the compute resources of this virtual machine once it +// is deallocated. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used +// to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. instanceID is the instance id of -// the virtual machine. +// name of the VM scale set. instanceID is the instance ID of the virtual +// machine. func (client VirtualMachineScaleSetVMsClient) Deallocate(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) if err != nil { @@ -112,14 +112,14 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Res return } -// Delete allows you to delete a virtual machine scale set. This method may -// poll for completion. Polling can be canceled by passing the cancel channel +// Delete deletes a virtual machine from a VM scale set. This method may poll +// for completion. Polling can be canceled by passing the cancel channel // argument. The channel will be used to cancel polling and any outstanding // HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. instanceID is the instance id of -// the virtual machine. +// name of the VM scale set. instanceID is the instance ID of the virtual +// machine. func (client VirtualMachineScaleSetVMsClient) Delete(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) if err != nil { @@ -181,11 +181,11 @@ func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Respons return } -// Get displays information about a virtual machine scale set virtual machine. +// Get gets a virtual machine from a VM scale set. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. instanceID is the instance id of -// the virtual machine. +// name of the VM scale set. instanceID is the instance ID of the virtual +// machine. func (client VirtualMachineScaleSetVMsClient) Get(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) { req, err := client.GetPreparer(resourceGroupName, vmScaleSetName, instanceID) if err != nil { @@ -246,12 +246,11 @@ func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) return } -// GetInstanceView displays the status of a virtual machine scale set virtual -// machine. +// GetInstanceView gets the status of a virtual machine from a VM scale set. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. instanceID is the instance id of -// the virtual machine. +// name of the VM scale set. instanceID is the instance ID of the virtual +// machine. func (client VirtualMachineScaleSetVMsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { req, err := client.GetInstanceViewPreparer(resourceGroupName, vmScaleSetName, instanceID) if err != nil { @@ -312,13 +311,12 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *htt return } -// List lists all virtual machines in a VM scale sets. +// List gets a list of all virtual machines in a VM scale sets. // // resourceGroupName is the name of the resource group. -// virtualMachineScaleSetName is the name of the virtual machine scale set. -// filter is the filter to apply on the operation. selectParameter is the -// list parameters. expand is the expand expression to apply on the -// operation. +// virtualMachineScaleSetName is the name of the VM scale set. filter is the +// filter to apply to the operation. selectParameter is the list parameters. +// expand is the expand expression to apply to the operation. func (client VirtualMachineScaleSetVMsClient) List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResult, err error) { req, err := client.ListPreparer(resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) if err != nil { @@ -391,7 +389,7 @@ func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) func (client VirtualMachineScaleSetVMsClient) ListNextResults(lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) { req, err := lastResults.VirtualMachineScaleSetVMListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -400,25 +398,27 @@ func (client VirtualMachineScaleSetVMsClient) ListNextResults(lastResults Virtua resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to next results request") } return } -// PowerOff allows you to power off (stop) a virtual machine in a VM scale -// set. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// PowerOff power off (stop) a virtual machine in a VM scale set. Note that +// resources are still attached and you are getting charged for the +// resources. Instead, use deallocate to release resources and avoid charges. +// This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling +// and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. instanceID is the instance id of -// the virtual machine. +// name of the VM scale set. instanceID is the instance ID of the virtual +// machine. func (client VirtualMachineScaleSetVMsClient) PowerOff(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) if err != nil { @@ -480,15 +480,14 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Respo return } -// Reimage allows you to re-image(update the version of the installed -// operating system) a virtual machine scale set instance. This method may -// poll for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Reimage reimages (upgrade the operating system) a specific virtual machine +// in a VM scale set. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used +// to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. instanceID is the instance id of -// the virtual machine. +// name of the VM scale set. instanceID is the instance ID of the virtual +// machine. func (client VirtualMachineScaleSetVMsClient) Reimage(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) if err != nil { @@ -550,14 +549,14 @@ func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Respon return } -// Restart allows you to restart a virtual machine in a VM scale set. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and -// any outstanding HTTP requests. +// Restart restarts a virtual machine in a VM scale set. This method may poll +// for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. instanceID is the instance id of -// the virtual machine. +// name of the VM scale set. instanceID is the instance ID of the virtual +// machine. func (client VirtualMachineScaleSetVMsClient) Restart(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) if err != nil { @@ -619,14 +618,14 @@ func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Respon return } -// Start allows you to start a virtual machine in a VM scale set. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// Start starts a virtual machine in a VM scale set. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. vmScaleSetName is the -// name of the virtual machine scale set. instanceID is the instance id of -// the virtual machine. +// name of the VM scale set. instanceID is the instance ID of the virtual +// machine. func (client VirtualMachineScaleSetVMsClient) Start(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go index 3cdeecedbff..507e9f157ec 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go @@ -21,6 +21,7 @@ package compute import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -46,6 +47,12 @@ func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID stri // // location is the location upon which virtual-machine-sizes is queried. func (client VirtualMachineSizesClient) List(location string) (result VirtualMachineSizeListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineSizesClient", "List") + } + req, err := client.ListPreparer(location) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go new file mode 100644 index 00000000000..2257c451fb1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go @@ -0,0 +1,57 @@ +// Package containerregistry implements the Azure ARM Containerregistry +// service API version 2016-06-27-preview. +// +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // APIVersion is the version of the Containerregistry + APIVersion = "2016-06-27-preview" + + // DefaultBaseURI is the default URI used for the service Containerregistry + DefaultBaseURI = "https://management.azure.com" +) + +// ManagementClient is the base client for Containerregistry. +type ManagementClient struct { + autorest.Client + BaseURI string + APIVersion string + SubscriptionID string +} + +// New creates an instance of the ManagementClient client. +func New(subscriptionID string) ManagementClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the ManagementClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient { + return ManagementClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + APIVersion: APIVersion, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go new file mode 100644 index 00000000000..ecf1ca8f648 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go @@ -0,0 +1,118 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "net/http" +) + +// Registry is an object that represents a container registry. +type Registry struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *RegistryProperties `json:"properties,omitempty"` +} + +// RegistryCredentials is the result of a request to get the administrator +// login credentials for a container registry. +type RegistryCredentials struct { + autorest.Response `json:"-"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` +} + +// RegistryListResult is the result of a request to list container registries. +type RegistryListResult struct { + autorest.Response `json:"-"` + Value *[]Registry `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// RegistryListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client RegistryListResult) RegistryListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// RegistryNameCheckRequest is a request to check whether the container +// registry name is available. +type RegistryNameCheckRequest struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} + +// RegistryNameStatus is the result of a request to check the availability of +// a container registry name. +type RegistryNameStatus struct { + autorest.Response `json:"-"` + NameAvailable *bool `json:"nameAvailable,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// RegistryProperties is the properties of a container registry. +type RegistryProperties struct { + LoginServer *string `json:"loginServer,omitempty"` + CreationDate *date.Time `json:"creationDate,omitempty"` + AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"` +} + +// RegistryPropertiesUpdateParameters is the parameters for updating the +// properties of a container registry. +type RegistryPropertiesUpdateParameters struct { + AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"` +} + +// RegistryUpdateParameters is the parameters for updating a container +// registry. +type RegistryUpdateParameters struct { + Tags *map[string]*string `json:"tags,omitempty"` + *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` +} + +// Resource is an Azure resource. +type Resource struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` +} + +// StorageAccountProperties is the properties of a storage account for a +// container registry. +type StorageAccountProperties struct { + Name *string `json:"name,omitempty"` + AccessKey *string `json:"accessKey,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go new file mode 100644 index 00000000000..c658cccf580 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go @@ -0,0 +1,685 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// RegistriesClient is the client for the Registries methods of the +// Containerregistry service. +type RegistriesClient struct { + ManagementClient +} + +// NewRegistriesClient creates an instance of the RegistriesClient client. +func NewRegistriesClient(subscriptionID string) RegistriesClient { + return NewRegistriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRegistriesClientWithBaseURI creates an instance of the RegistriesClient +// client. +func NewRegistriesClientWithBaseURI(baseURI string, subscriptionID string) RegistriesClient { + return RegistriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks whether the container registry name is +// available for use. The name must contain only alphanumeric characters, be +// globally unique, and between 5 and 60 characters in length. +// +// registryNameCheckRequest is the object containing information for the +// availability request. +func (client RegistriesClient) CheckNameAvailability(registryNameCheckRequest RegistryNameCheckRequest) (result RegistryNameStatus, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryNameCheckRequest, + Constraints: []validation.Constraint{{Target: "registryNameCheckRequest.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "registryNameCheckRequest.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "CheckNameAvailability") + } + + req, err := client.CheckNameAvailabilityPreparer(registryNameCheckRequest) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", nil, "Failure preparing request") + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", resp, "Failure sending request") + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client RegistriesClient) CheckNameAvailabilityPreparer(registryNameCheckRequest RegistryNameCheckRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability", pathParameters), + autorest.WithJSON(registryNameCheckRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client RegistriesClient) CheckNameAvailabilityResponder(resp *http.Response) (result RegistryNameStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates or updates a container registry with the specified +// parameters. +// +// resourceGroupName is the name of the resource group to which the container +// registry belongs. registryName is the name of the container registry. +// registry is the parameters for creating or updating a container registry. +func (client RegistriesClient) CreateOrUpdate(resourceGroupName string, registryName string, registry Registry) (result Registry, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registry, + Constraints: []validation.Constraint{{Target: "registry.RegistryProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "registry.RegistryProperties.StorageAccount.AccessKey", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "registry.RegistryProperties.LoginServer", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "registry.RegistryProperties.CreationDate", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "CreateOrUpdate") + } + + req, err := client.CreateOrUpdatePreparer(resourceGroupName, registryName, registry) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CreateOrUpdate", nil, "Failure preparing request") + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CreateOrUpdate", resp, "Failure sending request") + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RegistriesClient) CreateOrUpdatePreparer(resourceGroupName string, registryName string, registry Registry) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithJSON(registry), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RegistriesClient) CreateOrUpdateResponder(resp *http.Response) (result Registry, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a container registry. +// +// resourceGroupName is the name of the resource group to which the container +// registry belongs. registryName is the name of the container registry. +func (client RegistriesClient) Delete(resourceGroupName string, registryName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(resourceGroupName, registryName) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", nil, "Failure preparing request") + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure sending request") + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RegistriesClient) DeletePreparer(resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RegistriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetCredentials gets the administrator login credentials for the specified +// container registry. +// +// resourceGroupName is the name of the resource group to which the container +// registry belongs. registryName is the name of the container registry. +func (client RegistriesClient) GetCredentials(resourceGroupName string, registryName string) (result RegistryCredentials, err error) { + req, err := client.GetCredentialsPreparer(resourceGroupName, registryName) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetCredentials", nil, "Failure preparing request") + } + + resp, err := client.GetCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetCredentials", resp, "Failure sending request") + } + + result, err = client.GetCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetCredentials", resp, "Failure responding to request") + } + + return +} + +// GetCredentialsPreparer prepares the GetCredentials request. +func (client RegistriesClient) GetCredentialsPreparer(resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/getCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetCredentialsSender sends the GetCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) GetCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetCredentialsResponder handles the response to the GetCredentials request. The method always +// closes the http.Response Body. +func (client RegistriesClient) GetCredentialsResponder(resp *http.Response) (result RegistryCredentials, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProperties gets the properties of the specified container registry. +// +// resourceGroupName is the name of the resource group to which the container +// registry belongs. registryName is the name of the container registry. +func (client RegistriesClient) GetProperties(resourceGroupName string, registryName string) (result Registry, err error) { + req, err := client.GetPropertiesPreparer(resourceGroupName, registryName) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetProperties", nil, "Failure preparing request") + } + + resp, err := client.GetPropertiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetProperties", resp, "Failure sending request") + } + + result, err = client.GetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetProperties", resp, "Failure responding to request") + } + + return +} + +// GetPropertiesPreparer prepares the GetProperties request. +func (client RegistriesClient) GetPropertiesPreparer(resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetPropertiesSender sends the GetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) GetPropertiesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetPropertiesResponder handles the response to the GetProperties request. The method always +// closes the http.Response Body. +func (client RegistriesClient) GetPropertiesResponder(resp *http.Response) (result Registry, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the available container registries under the specified +// subscription. +func (client RegistriesClient) List() (result RegistryListResult, err error) { + req, err := client.ListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", nil, "Failure preparing request") + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure sending request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client RegistriesClient) ListPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListResponder(resp *http.Response) (result RegistryListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client RegistriesClient) ListNextResults(lastResults RegistryListResult) (result RegistryListResult, err error) { + req, err := lastResults.RegistryListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListByResourceGroup lists all the available container registries under the +// specified resource group. +// +// resourceGroupName is the name of the resource group to which the container +// registry belongs. +func (client RegistriesClient) ListByResourceGroup(resourceGroupName string) (result RegistryListResult, err error) { + req, err := client.ListByResourceGroupPreparer(resourceGroupName) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", nil, "Failure preparing request") + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure sending request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client RegistriesClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListByResourceGroupResponder(resp *http.Response) (result RegistryListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroupNextResults retrieves the next set of results, if any. +func (client RegistriesClient) ListByResourceGroupNextResults(lastResults RegistryListResult) (result RegistryListResult, err error) { + req, err := lastResults.RegistryListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure sending next results request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure responding to next results request") + } + + return +} + +// RegenerateCredentials regenerates the administrator login credentials for +// the specified container registry. +// +// resourceGroupName is the name of the resource group to which the container +// registry belongs. registryName is the name of the container registry. +func (client RegistriesClient) RegenerateCredentials(resourceGroupName string, registryName string) (result RegistryCredentials, err error) { + req, err := client.RegenerateCredentialsPreparer(resourceGroupName, registryName) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredentials", nil, "Failure preparing request") + } + + resp, err := client.RegenerateCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredentials", resp, "Failure sending request") + } + + result, err = client.RegenerateCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredentials", resp, "Failure responding to request") + } + + return +} + +// RegenerateCredentialsPreparer prepares the RegenerateCredentials request. +func (client RegistriesClient) RegenerateCredentialsPreparer(resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// RegenerateCredentialsSender sends the RegenerateCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) RegenerateCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// RegenerateCredentialsResponder handles the response to the RegenerateCredentials request. The method always +// closes the http.Response Body. +func (client RegistriesClient) RegenerateCredentialsResponder(resp *http.Response) (result RegistryCredentials, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a container registry with the specified parameters. +// +// resourceGroupName is the name of the resource group to which the container +// registry belongs. registryName is the name of the container registry. +// registryUpdateParameters is the parameters for updating a container +// registry. +func (client RegistriesClient) Update(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (result Registry, err error) { + req, err := client.UpdatePreparer(resourceGroupName, registryName, registryUpdateParameters) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", nil, "Failure preparing request") + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure sending request") + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RegistriesClient) UpdatePreparer(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithJSON(registryUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client RegistriesClient) UpdateResponder(resp *http.Response) (result Registry, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go new file mode 100644 index 00000000000..e0d70c1b510 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go @@ -0,0 +1,43 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "fmt" +) + +const ( + major = "7" + minor = "0" + patch = "1" + // Always begin a "tag" with a dash (as per http://semver.org) + tag = "-beta" + semVerFormat = "%s.%s.%s%s" + userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s" +) + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return fmt.Sprintf(userAgentFormat, Version(), "containerregistry", "2016-06-27-preview") +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return fmt.Sprintf(semVerFormat, major, minor, patch, tag) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go index 3c481c5df28..872fbbf7c5b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // ApplicationGatewaysClient is the the Microsoft Azure Network management API // provides a RESTful set of web services that interact with Microsoft Azure -// Networks service to manage your network resrources. The API has entities +// Networks service to manage your network resources. The API has entities // that capture the relationship between an end user and the Microsoft Azure // Networks service. type ApplicationGatewaysClient struct { @@ -45,15 +46,96 @@ func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID stri return ApplicationGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put ApplicationGateway operation creates/updates a -// ApplicationGateway This method may poll for completion. Polling can be +// BackendHealth gets the backend health of the specified application gateway +// in a resource group. This method may poll for completion. Polling can be // canceled by passing the cancel channel argument. The channel will be used // to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the ApplicationGateway. parameters is parameters supplied -// to the create/delete ApplicationGateway operation +// is the name of the application gateway. expand is expands +// BackendAddressPool and BackendHttpSettings referenced in backend health. +func (client ApplicationGatewaysClient) BackendHealth(resourceGroupName string, applicationGatewayName string, expand string, cancel <-chan struct{}) (result autorest.Response, err error) { + req, err := client.BackendHealthPreparer(resourceGroupName, applicationGatewayName, expand, cancel) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", nil, "Failure preparing request") + } + + resp, err := client.BackendHealthSender(req) + if err != nil { + result.Response = resp + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", resp, "Failure sending request") + } + + result, err = client.BackendHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", resp, "Failure responding to request") + } + + return +} + +// BackendHealthPreparer prepares the BackendHealth request. +func (client ApplicationGatewaysClient) BackendHealthPreparer(resourceGroupName string, applicationGatewayName string, expand string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGatewayName": autorest.Encode("path", applicationGatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": client.APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// BackendHealthSender sends the BackendHealth request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationGatewaysClient) BackendHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// BackendHealthResponder handles the response to the BackendHealth request. The method always +// closes the http.Response Body. +func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate creates or updates the specified application gateway. This +// method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and +// any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. applicationGatewayName +// is the name of the application gateway. parameters is parameters supplied +// to the create or update application gateway operation. func (client ApplicationGatewaysClient) CreateOrUpdate(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ApplicationGatewayPropertiesFormat.OperationalState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, applicationGatewayName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -115,13 +197,13 @@ func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Respo return } -// Delete the delete applicationgateway operation deletes the specified -// applicationgateway. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// Delete deletes the specified application gateway. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the applicationgateway. +// is the name of the application gateway. func (client ApplicationGatewaysClient) Delete(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.DeletePreparer(resourceGroupName, applicationGatewayName, cancel) if err != nil { @@ -182,11 +264,10 @@ func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (re return } -// Get the Get applicationgateway operation retreives information about the -// specified applicationgateway. +// Get gets the specified application gateway. // // resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the applicationgateway. +// is the name of the application gateway. func (client ApplicationGatewaysClient) Get(resourceGroupName string, applicationGatewayName string) (result ApplicationGateway, err error) { req, err := client.GetPreparer(resourceGroupName, applicationGatewayName) if err != nil { @@ -246,8 +327,7 @@ func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (resul return } -// List the List ApplicationGateway operation retrieves all the -// applicationgateways in a resource group. +// List lists all application gateways in a resource group. // // resourceGroupName is the name of the resource group. func (client ApplicationGatewaysClient) List(resourceGroupName string) (result ApplicationGatewayListResult, err error) { @@ -312,7 +392,7 @@ func (client ApplicationGatewaysClient) ListResponder(resp *http.Response) (resu func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, err error) { req, err := lastResults.ApplicationGatewayListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -321,19 +401,18 @@ func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationG resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure responding to next results request") } return } -// ListAll the List applicationgateway operation retrieves all the -// applicationgateways in a subscription. +// ListAll gets all the application gateways in a subscription. func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -395,7 +474,7 @@ func (client ApplicationGatewaysClient) ListAllResponder(resp *http.Response) (r func (client ApplicationGatewaysClient) ListAllNextResults(lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, err error) { req, err := lastResults.ApplicationGatewayListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -404,22 +483,21 @@ func (client ApplicationGatewaysClient) ListAllNextResults(lastResults Applicati resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure responding to next results request") } return } -// Start the Start ApplicationGateway operation starts application gatewayin -// the specified resource group through Network resource provider. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and -// any outstanding HTTP requests. +// Start starts the specified application gateway. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. applicationGatewayName // is the name of the application gateway. @@ -483,11 +561,10 @@ func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (res return } -// Stop the STOP ApplicationGateway operation stops application gatewayin the -// specified resource group through Network resource provider. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// Stop stops the specified application gateway in a resource group. This +// method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and +// any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. applicationGatewayName // is the name of the application gateway. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/client.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/client.go index 6a5e007a275..74e3d7e491b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/client.go @@ -1,10 +1,10 @@ // Package network implements the Azure ARM Network service API version -// 2016-06-01. +// 2016-09-01. // // The Microsoft Azure Network management API provides a RESTful set of web // services that interact with Microsoft Azure Networks service to manage -// your network resrources. The API has entities that capture the -// relationship between an end user and the Microsoft Azure Networks service. +// your network resources. The API has entities that capture the relationship +// between an end user and the Microsoft Azure Networks service. package network // Copyright (c) Microsoft and contributors. All rights reserved. @@ -33,7 +33,7 @@ import ( const ( // APIVersion is the version of the Network - APIVersion = "2016-06-01" + APIVersion = "2016-09-01" // DefaultBaseURI is the default URI used for the service Network DefaultBaseURI = "https://management.azure.com" @@ -65,7 +65,7 @@ func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient { // CheckDNSNameAvailability checks whether a domain name in the cloudapp.net // zone is available for use. // -// location is the location of the domain name domainNameLabel is the domain +// location is the location of the domain name. domainNameLabel is the domain // name to be verified. It must conform to the following regular expression: // ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. func (client ManagementClient) CheckDNSNameAvailability(location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go index df5e8792df7..eb0a2a075c2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go @@ -26,8 +26,8 @@ import ( // ExpressRouteCircuitAuthorizationsClient is the the Microsoft Azure Network // management API provides a RESTful set of web services that interact with -// Microsoft Azure Networks service to manage your network resrources. The -// API has entities that capture the relationship between an end user and the +// Microsoft Azure Networks service to manage your network resources. The API +// has entities that capture the relationship between an end user and the // Microsoft Azure Networks service. type ExpressRouteCircuitAuthorizationsClient struct { ManagementClient @@ -45,16 +45,15 @@ func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subsc return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put Authorization operation creates/updates an -// authorization in thespecified ExpressRouteCircuits This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// CreateOrUpdate creates or updates an authorization in the specified express +// route circuit. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used +// to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the // name of the express route circuit. authorizationName is the name of the // authorization. authorizationParameters is parameters supplied to the -// create/update ExpressRouteCircuitAuthorization operation +// create or update express route circuit authorization operation. func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, authorizationName, authorizationParameters, cancel) if err != nil { @@ -118,11 +117,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(re return } -// Delete the delete authorization operation deletes the specified -// authorization from the specified ExpressRouteCircuit. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes the specified authorization from the specified express route +// circuit. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the // name of the express route circuit. authorizationName is the name of the @@ -188,8 +186,8 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http return } -// Get the GET authorization operation retrieves the specified authorization -// from the specified ExpressRouteCircuit. +// Get gets the specified authorization from the specified express route +// circuit. // // resourceGroupName is the name of the resource group. circuitName is the // name of the express route circuit. authorizationName is the name of the @@ -254,11 +252,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Re return } -// List the List authorization operation retrieves all the authorizations in -// an ExpressRouteCircuit. +// List gets all authorizations in an express route circuit. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the curcuit. +// name of the circuit. func (client ExpressRouteCircuitAuthorizationsClient) List(resourceGroupName string, circuitName string) (result AuthorizationListResult, err error) { req, err := client.ListPreparer(resourceGroupName, circuitName) if err != nil { @@ -322,7 +319,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListResponder(resp *http.R func (client ExpressRouteCircuitAuthorizationsClient) ListNextResults(lastResults AuthorizationListResult) (result AuthorizationListResult, err error) { req, err := lastResults.AuthorizationListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -331,12 +328,12 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListNextResults(lastResult resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go index 28c09350624..a459574b89b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go @@ -26,8 +26,8 @@ import ( // ExpressRouteCircuitPeeringsClient is the the Microsoft Azure Network // management API provides a RESTful set of web services that interact with -// Microsoft Azure Networks service to manage your network resrources. The -// API has entities that capture the relationship between an end user and the +// Microsoft Azure Networks service to manage your network resources. The API +// has entities that capture the relationship between an end user and the // Microsoft Azure Networks service. type ExpressRouteCircuitPeeringsClient struct { ManagementClient @@ -45,15 +45,15 @@ func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptio return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put Pering operation creates/updates an peering in the -// specified ExpressRouteCircuits This method may poll for completion. -// Polling can be canceled by passing the cancel channel argument. The -// channel will be used to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a peering in the specified express route +// circuits. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the // name of the express route circuit. peeringName is the name of the peering. -// peeringParameters is parameters supplied to the create/update -// ExpressRouteCircuit Peering operation +// peeringParameters is parameters supplied to the create or update express +// route circuit peering operation. func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, peeringName, peeringParameters, cancel) if err != nil { @@ -117,10 +117,10 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *ht return } -// Delete the delete peering operation deletes the specified peering from the -// ExpressRouteCircuit. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// Delete deletes the specified peering from the specified express route +// circuit. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the // name of the express route circuit. peeringName is the name of the peering. @@ -185,8 +185,8 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Respo return } -// Get the GET peering operation retrieves the specified authorization from -// the ExpressRouteCircuit. +// Get gets the specified authorization from the specified express route +// circuit. // // resourceGroupName is the name of the resource group. circuitName is the // name of the express route circuit. peeringName is the name of the peering. @@ -250,11 +250,10 @@ func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response return } -// List the List peering operation retrieves all the peerings in an -// ExpressRouteCircuit. +// List gets all peerings in a specified express route circuit. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the curcuit. +// name of the express route circuit. func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResult, err error) { req, err := client.ListPreparer(resourceGroupName, circuitName) if err != nil { @@ -318,7 +317,7 @@ func (client ExpressRouteCircuitPeeringsClient) ListResponder(resp *http.Respons func (client ExpressRouteCircuitPeeringsClient) ListNextResults(lastResults ExpressRouteCircuitPeeringListResult) (result ExpressRouteCircuitPeeringListResult, err error) { req, err := lastResults.ExpressRouteCircuitPeeringListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -327,12 +326,12 @@ func (client ExpressRouteCircuitPeeringsClient) ListNextResults(lastResults Expr resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go index 979bee99e48..6572e92b625 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go @@ -26,7 +26,7 @@ import ( // ExpressRouteCircuitsClient is the the Microsoft Azure Network management // API provides a RESTful set of web services that interact with Microsoft -// Azure Networks service to manage your network resrources. The API has +// Azure Networks service to manage your network resources. The API has // entities that capture the relationship between an end user and the // Microsoft Azure Networks service. type ExpressRouteCircuitsClient struct { @@ -45,14 +45,14 @@ func NewExpressRouteCircuitsClientWithBaseURI(baseURI string, subscriptionID str return ExpressRouteCircuitsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put ExpressRouteCircuit operation creates/updates a -// ExpressRouteCircuit This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates an express route circuit. This method may +// poll for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the circuit. parameters is parameters supplied to the -// create/delete ExpressRouteCircuit operation +// name of the circuit. parameters is parameters supplied to the create or +// update express route circuit operation. func (client ExpressRouteCircuitsClient) CreateOrUpdate(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, parameters, cancel) if err != nil { @@ -115,13 +115,13 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Resp return } -// Delete the delete ExpressRouteCircuit operation deletes the specified -// ExpressRouteCircuit. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// Delete deletes the specified express route circuit. This method may poll +// for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the express route Circuit. +// name of the express route circuit. func (client ExpressRouteCircuitsClient) Delete(resourceGroupName string, circuitName string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.DeletePreparer(resourceGroupName, circuitName, cancel) if err != nil { @@ -182,11 +182,10 @@ func (client ExpressRouteCircuitsClient) DeleteResponder(resp *http.Response) (r return } -// Get the Get ExpressRouteCircuit operation retreives information about the -// specified ExpressRouteCircuit. +// Get gets information about the specified express route circuit. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the circuit. +// name of express route circuit. func (client ExpressRouteCircuitsClient) Get(resourceGroupName string, circuitName string) (result ExpressRouteCircuit, err error) { req, err := client.GetPreparer(resourceGroupName, circuitName) if err != nil { @@ -246,11 +245,11 @@ func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (resu return } -// GetPeeringStats the Liststats ExpressRouteCircuit operation retrieves all -// the stats from a ExpressRouteCircuits in a resource group. +// GetPeeringStats gets all stats from an express route circuit in a resource +// group. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the circuit. peeringName is the name of the peering. +// name of the express route circuit. peeringName is the name of the peering. func (client ExpressRouteCircuitsClient) GetPeeringStats(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) { req, err := client.GetPeeringStatsPreparer(resourceGroupName, circuitName, peeringName) if err != nil { @@ -311,11 +310,11 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Res return } -// GetStats the Liststats ExpressRouteCircuit operation retrieves all the -// stats from a ExpressRouteCircuits in a resource group. +// GetStats gets all the stats from an express route circuit in a resource +// group. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the circuit. +// name of the express route circuit. func (client ExpressRouteCircuitsClient) GetStats(resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) { req, err := client.GetStatsPreparer(resourceGroupName, circuitName) if err != nil { @@ -375,8 +374,7 @@ func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response) return } -// List the List ExpressRouteCircuit operation retrieves all the -// ExpressRouteCircuits in a resource group. +// List gets all the express route circuits in a resource group. // // resourceGroupName is the name of the resource group. func (client ExpressRouteCircuitsClient) List(resourceGroupName string) (result ExpressRouteCircuitListResult, err error) { @@ -441,7 +439,7 @@ func (client ExpressRouteCircuitsClient) ListResponder(resp *http.Response) (res func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, err error) { req, err := lastResults.ExpressRouteCircuitListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -450,19 +448,18 @@ func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRout resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure responding to next results request") } return } -// ListAll the List ExpressRouteCircuit operation retrieves all the -// ExpressRouteCircuits in a subscription. +// ListAll gets all the express route circuits in a subscription. func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -524,7 +521,7 @@ func (client ExpressRouteCircuitsClient) ListAllResponder(resp *http.Response) ( func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, err error) { req, err := lastResults.ExpressRouteCircuitListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -533,27 +530,26 @@ func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressR resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure responding to next results request") } return } -// ListArpTable the ListArpTable from ExpressRouteCircuit operation retrieves -// the currently advertised arp table associated with the -// ExpressRouteCircuits in a resource group. This method may poll for +// ListArpTable gets the currently advertised ARP table associated with the +// express route circuit in a resource group. This method may poll for // completion. Polling can be canceled by passing the cancel channel // argument. The channel will be used to cancel polling and any outstanding // HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the circuit. peeringName is the name of the peering. devicePath is -// the path of the device. +// name of the express route circuit. peeringName is the name of the peering. +// devicePath is the path of the device. func (client ExpressRouteCircuitsClient) ListArpTable(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.ListArpTablePreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel) if err != nil { @@ -616,16 +612,15 @@ func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Respon return } -// ListRoutesTable the ListRoutesTable from ExpressRouteCircuit operation -// retrieves the currently advertised routes table associated with the -// ExpressRouteCircuits in a resource group. This method may poll for +// ListRoutesTable gets the currently advertised routes table associated with +// the express route circuit in a resource group. This method may poll for // completion. Polling can be canceled by passing the cancel channel // argument. The channel will be used to cancel polling and any outstanding // HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the circuit. peeringName is the name of the peering. devicePath is -// the path of the device. +// name of the express route circuit. peeringName is the name of the peering. +// devicePath is the path of the device. func (client ExpressRouteCircuitsClient) ListRoutesTable(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.ListRoutesTablePreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel) if err != nil { @@ -688,16 +683,15 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Res return } -// ListRoutesTableSummary the ListRoutesTable from ExpressRouteCircuit -// operation retrieves the currently advertised routes table associated with -// the ExpressRouteCircuits in a resource group. This method may poll for -// completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// ListRoutesTableSummary gets the currently advertised routes table summary +// associated with the express route circuit in a resource group. This method +// may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. // // resourceGroupName is the name of the resource group. circuitName is the -// name of the circuit. peeringName is the name of the peering. devicePath is -// the path of the device. +// name of the express route circuit. peeringName is the name of the peering. +// devicePath is the path of the device. func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.ListRoutesTableSummaryPreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go index 4943835d090..9d0450ecf09 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go @@ -26,8 +26,8 @@ import ( // ExpressRouteServiceProvidersClient is the the Microsoft Azure Network // management API provides a RESTful set of web services that interact with -// Microsoft Azure Networks service to manage your network resrources. The -// API has entities that capture the relationship between an end user and the +// Microsoft Azure Networks service to manage your network resources. The API +// has entities that capture the relationship between an end user and the // Microsoft Azure Networks service. type ExpressRouteServiceProvidersClient struct { ManagementClient @@ -45,8 +45,7 @@ func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscripti return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List the List ExpressRouteServiceProvider operation retrieves all the -// available ExpressRouteServiceProviders. +// List gets all the available express route service providers. func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServiceProviderListResult, err error) { req, err := client.ListPreparer() if err != nil { @@ -108,7 +107,7 @@ func (client ExpressRouteServiceProvidersClient) ListResponder(resp *http.Respon func (client ExpressRouteServiceProvidersClient) ListNextResults(lastResults ExpressRouteServiceProviderListResult) (result ExpressRouteServiceProviderListResult, err error) { req, err := lastResults.ExpressRouteServiceProviderListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -117,12 +116,12 @@ func (client ExpressRouteServiceProvidersClient) ListNextResults(lastResults Exp resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go index d198f37f499..9fbf7cddd4a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // InterfacesClient is the the Microsoft Azure Network management API provides // a RESTful set of web services that interact with Microsoft Azure Networks -// service to manage your network resrources. The API has entities that +// service to manage your network resources. The API has entities that // capture the relationship between an end user and the Microsoft Azure // Networks service. type InterfacesClient struct { @@ -44,15 +45,28 @@ func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) Inter return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put NetworkInterface operation creates/updates a -// networkInterface This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a network interface. This method may poll +// for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. networkInterfaceName // is the name of the network interface. parameters is parameters supplied to -// the create/update NetworkInterface operation +// the create or update network interface operation. func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkInterfaceName string, parameters Interface, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.NetworkSecurityGroup", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.InterfacePropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.InterfacesClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkInterfaceName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -114,10 +128,10 @@ func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (res return } -// Delete the delete netwokInterface operation deletes the specified -// netwokInterface. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// Delete deletes the specified network interface. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. networkInterfaceName // is the name of the network interface. @@ -181,11 +195,10 @@ func (client InterfacesClient) DeleteResponder(resp *http.Response) (result auto return } -// Get the Get ntework interface operation retreives information about the -// specified network interface. +// Get gets information about the specified network interface. // // resourceGroupName is the name of the resource group. networkInterfaceName -// is the name of the network interface. expand is expand references +// is the name of the network interface. expand is expands referenced // resources. func (client InterfacesClient) Get(resourceGroupName string, networkInterfaceName string, expand string) (result Interface, err error) { req, err := client.GetPreparer(resourceGroupName, networkInterfaceName, expand) @@ -249,11 +262,10 @@ func (client InterfacesClient) GetResponder(resp *http.Response) (result Interfa return } -// GetEffectiveRouteTable the get effective routetable operation retrieves all -// the route tables applied on a networkInterface. This method may poll for -// completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// GetEffectiveRouteTable gets all route tables applied to a network +// interface. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. networkInterfaceName // is the name of the network interface. @@ -317,14 +329,13 @@ func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Respon return } -// GetVirtualMachineScaleSetNetworkInterface the Get ntework interface -// operation retreives information about the specified network interface in a -// virtual machine scale set. +// GetVirtualMachineScaleSetNetworkInterface get the specified network +// interface in a virtual machine scale set. // // resourceGroupName is the name of the resource group. // virtualMachineScaleSetName is the name of the virtual machine scale set. // virtualmachineIndex is the virtual machine index. networkInterfaceName is -// the name of the network interface. expand is expand references resources. +// the name of the network interface. expand is expands referenced resources. func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) { req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) if err != nil { @@ -389,8 +400,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponde return } -// List the List networkInterfaces operation retrieves all the -// networkInterfaces in a resource group. +// List gets all network interfaces in a resource group. // // resourceGroupName is the name of the resource group. func (client InterfacesClient) List(resourceGroupName string) (result InterfaceListResult, err error) { @@ -455,7 +465,7 @@ func (client InterfacesClient) ListResponder(resp *http.Response) (result Interf func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) { req, err := lastResults.InterfaceListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -464,19 +474,18 @@ func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult) resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure responding to next results request") } return } -// ListAll the List networkInterfaces operation retrieves all the -// networkInterfaces in a subscription. +// ListAll gets all network interfaces in a subscription. func (client InterfacesClient) ListAll() (result InterfaceListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -538,7 +547,7 @@ func (client InterfacesClient) ListAllResponder(resp *http.Response) (result Int func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) { req, err := lastResults.InterfaceListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -547,22 +556,21 @@ func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResul resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure responding to next results request") } return } -// ListEffectiveNetworkSecurityGroups the list effective network security -// group operation retrieves all the network security groups applied on a -// networkInterface. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// ListEffectiveNetworkSecurityGroups gets all network security groups applied +// to a network interface. This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be +// used to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. networkInterfaceName // is the name of the network interface. @@ -626,9 +634,8 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp return } -// ListVirtualMachineScaleSetNetworkInterfaces the list network interface -// operation retrieves information about all network interfaces in a virtual -// machine scale set. +// ListVirtualMachineScaleSetNetworkInterfaces gets all network interfaces in +// a virtual machine scale set. // // resourceGroupName is the name of the resource group. // virtualMachineScaleSetName is the name of the virtual machine scale set. @@ -695,7 +702,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesRespon func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) { req, err := lastResults.InterfaceListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", nil, "Failure preparing next results request") } if req == nil { return @@ -704,20 +711,19 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesNextRe resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure sending next results request") } result, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure responding to next results request") } return } -// ListVirtualMachineScaleSetVMNetworkInterfaces the list network interface -// operation retrieves information about all network interfaces in a virtual -// machine from a virtual machine scale set. +// ListVirtualMachineScaleSetVMNetworkInterfaces gets information about all +// network interfaces in a virtual machine in a virtual machine scale set. // // resourceGroupName is the name of the resource group. // virtualMachineScaleSetName is the name of the virtual machine scale set. @@ -786,7 +792,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesResp func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) { req, err := lastResults.InterfaceListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", nil, "Failure preparing next results request") } if req == nil { return @@ -795,12 +801,12 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesNext resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure sending next results request") } result, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go index 80b99183ce7..30012ff35b9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go @@ -26,7 +26,7 @@ import ( // LoadBalancersClient is the the Microsoft Azure Network management API // provides a RESTful set of web services that interact with Microsoft Azure -// Networks service to manage your network resrources. The API has entities +// Networks service to manage your network resources. The API has entities // that capture the relationship between an end user and the Microsoft Azure // Networks service. type LoadBalancersClient struct { @@ -45,14 +45,14 @@ func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) Lo return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put LoadBalancer operation creates/updates a -// LoadBalancer This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a load balancer. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. loadBalancerName is -// the name of the loadBalancer. parameters is parameters supplied to the -// create/delete LoadBalancer operation +// the name of the load balancer. parameters is parameters supplied to the +// create or update load balancer operation. func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, loadBalancerName, parameters, cancel) if err != nil { @@ -115,13 +115,13 @@ func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) ( return } -// Delete the delete loadbalancer operation deletes the specified -// loadbalancer. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Delete deletes the specified load balancer. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. loadBalancerName is -// the name of the loadBalancer. +// the name of the load balancer. func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.DeletePreparer(resourceGroupName, loadBalancerName, cancel) if err != nil { @@ -182,11 +182,10 @@ func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result a return } -// Get the Get ntework interface operation retreives information about the -// specified network interface. +// Get gets the specified load balancer. // // resourceGroupName is the name of the resource group. loadBalancerName is -// the name of the loadBalancer. expand is expand references resources. +// the name of the load balancer. expand is expands referenced resources. func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { req, err := client.GetPreparer(resourceGroupName, loadBalancerName, expand) if err != nil { @@ -249,8 +248,7 @@ func (client LoadBalancersClient) GetResponder(resp *http.Response) (result Load return } -// List the List loadBalancer operation retrieves all the loadbalancers in a -// resource group. +// List gets all the load balancers in a resource group. // // resourceGroupName is the name of the resource group. func (client LoadBalancersClient) List(resourceGroupName string) (result LoadBalancerListResult, err error) { @@ -315,7 +313,7 @@ func (client LoadBalancersClient) ListResponder(resp *http.Response) (result Loa func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) { req, err := lastResults.LoadBalancerListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -324,19 +322,18 @@ func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListRe resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to next results request") } return } -// ListAll the List loadBalancer operation retrieves all the loadbalancers in -// a subscription. +// ListAll gets all the load balancers in a subscription. func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -398,7 +395,7 @@ func (client LoadBalancersClient) ListAllResponder(resp *http.Response) (result func (client LoadBalancersClient) ListAllNextResults(lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) { req, err := lastResults.LoadBalancerListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -407,12 +404,12 @@ func (client LoadBalancersClient) ListAllNextResults(lastResults LoadBalancerLis resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go index 679e9b35c4a..fd48306f245 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // LocalNetworkGatewaysClient is the the Microsoft Azure Network management // API provides a RESTful set of web services that interact with Microsoft -// Azure Networks service to manage your network resrources. The API has +// Azure Networks service to manage your network resources. The API has // entities that capture the relationship between an end user and the // Microsoft Azure Networks service. type LocalNetworkGatewaysClient struct { @@ -45,17 +46,25 @@ func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID str return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put LocalNetworkGateway operation creates/updates a -// local network gateway in the specified resource group through Network -// resource provider. This method may poll for completion. Polling can be +// CreateOrUpdate creates or updates a local network gateway in the specified +// resource group. This method may poll for completion. Polling can be // canceled by passing the cancel channel argument. The channel will be used // to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. // localNetworkGatewayName is the name of the local network gateway. -// parameters is parameters supplied to the Begin Create or update Local -// Network Gateway operation through Network resource provider. +// parameters is parameters supplied to the create or update local network +// gateway operation. func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat.LocalNetworkAddressSpace", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.LocalNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, localNetworkGatewayName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -117,8 +126,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Resp return } -// Delete the Delete LocalNetworkGateway operation deletes the specifed local -// network Gateway through Network resource provider. This method may poll +// Delete deletes the specified local network gateway. This method may poll // for completion. Polling can be canceled by passing the cancel channel // argument. The channel will be used to cancel polling and any outstanding // HTTP requests. @@ -185,8 +193,7 @@ func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (r return } -// Get the Get LocalNetworkGateway operation retrieves information about the -// specified local network gateway through Network resource provider. +// Get gets the specified local network gateway in a resource group. // // resourceGroupName is the name of the resource group. // localNetworkGatewayName is the name of the local network gateway. @@ -249,8 +256,7 @@ func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (resu return } -// List the List LocalNetworkGateways operation retrieves all the local -// network gateways stored. +// List gets all the local network gateways in a resource group. // // resourceGroupName is the name of the resource group. func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result LocalNetworkGatewayListResult, err error) { @@ -315,7 +321,7 @@ func (client LocalNetworkGatewaysClient) ListResponder(resp *http.Response) (res func (client LocalNetworkGatewaysClient) ListNextResults(lastResults LocalNetworkGatewayListResult) (result LocalNetworkGatewayListResult, err error) { req, err := lastResults.LocalNetworkGatewayListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -324,12 +330,12 @@ func (client LocalNetworkGatewaysClient) ListNextResults(lastResults LocalNetwor resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/models.go index c09c581127b..bb514f796b3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/models.go @@ -24,6 +24,25 @@ import ( "net/http" ) +// ApplicationGatewayBackendHealthServerHealth enumerates the values for +// application gateway backend health server health. +type ApplicationGatewayBackendHealthServerHealth string + +const ( + // Down specifies the down state for application gateway backend health + // server health. + Down ApplicationGatewayBackendHealthServerHealth = "Down" + // Partial specifies the partial state for application gateway backend + // health server health. + Partial ApplicationGatewayBackendHealthServerHealth = "Partial" + // Unknown specifies the unknown state for application gateway backend + // health server health. + Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" + // Up specifies the up state for application gateway backend health server + // health. + Up ApplicationGatewayBackendHealthServerHealth = "Up" +) + // ApplicationGatewayCookieBasedAffinity enumerates the values for application // gateway cookie based affinity. type ApplicationGatewayCookieBasedAffinity string @@ -37,6 +56,19 @@ const ( Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" ) +// ApplicationGatewayFirewallMode enumerates the values for application +// gateway firewall mode. +type ApplicationGatewayFirewallMode string + +const ( + // Detection specifies the detection state for application gateway + // firewall mode. + Detection ApplicationGatewayFirewallMode = "Detection" + // Prevention specifies the prevention state for application gateway + // firewall mode. + Prevention ApplicationGatewayFirewallMode = "Prevention" +) + // ApplicationGatewayOperationalState enumerates the values for application // gateway operational state. type ApplicationGatewayOperationalState string @@ -94,6 +126,11 @@ const ( // StandardSmall specifies the standard small state for application // gateway sku name. StandardSmall ApplicationGatewaySkuName = "Standard_Small" + // WAFLarge specifies the waf large state for application gateway sku name. + WAFLarge ApplicationGatewaySkuName = "WAF_Large" + // WAFMedium specifies the waf medium state for application gateway sku + // name. + WAFMedium ApplicationGatewaySkuName = "WAF_Medium" ) // ApplicationGatewaySslProtocol enumerates the values for application gateway @@ -118,6 +155,8 @@ type ApplicationGatewayTier string const ( // Standard specifies the standard state for application gateway tier. Standard ApplicationGatewayTier = "Standard" + // WAF specifies the waf state for application gateway tier. + WAF ApplicationGatewayTier = "WAF" ) // AuthorizationUseStatus enumerates the values for authorization use status. @@ -390,18 +429,22 @@ const ( type VirtualNetworkGatewayConnectionStatus string const ( - // Connected specifies the connected state for virtual network gateway - // connection status. - Connected VirtualNetworkGatewayConnectionStatus = "Connected" - // Connecting specifies the connecting state for virtual network gateway - // connection status. - Connecting VirtualNetworkGatewayConnectionStatus = "Connecting" - // NotConnected specifies the not connected state for virtual network + // VirtualNetworkGatewayConnectionStatusConnected specifies the virtual + // network gateway connection status connected state for virtual network // gateway connection status. - NotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - // Unknown specifies the unknown state for virtual network gateway - // connection status. - Unknown VirtualNetworkGatewayConnectionStatus = "Unknown" + VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" + // VirtualNetworkGatewayConnectionStatusConnecting specifies the virtual + // network gateway connection status connecting state for virtual network + // gateway connection status. + VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" + // VirtualNetworkGatewayConnectionStatusNotConnected specifies the virtual + // network gateway connection status not connected state for virtual + // network gateway connection status. + VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" + // VirtualNetworkGatewayConnectionStatusUnknown specifies the virtual + // network gateway connection status unknown state for virtual network + // gateway connection status. + VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" ) // VirtualNetworkGatewayConnectionType enumerates the values for virtual @@ -438,6 +481,10 @@ const ( // VirtualNetworkGatewaySkuNameStandard specifies the virtual network // gateway sku name standard state for virtual network gateway sku name. VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" + // VirtualNetworkGatewaySkuNameUltraPerformance specifies the virtual + // network gateway sku name ultra performance state for virtual network + // gateway sku name. + VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" ) // VirtualNetworkGatewaySkuTier enumerates the values for virtual network @@ -455,6 +502,10 @@ const ( // VirtualNetworkGatewaySkuTierStandard specifies the virtual network // gateway sku tier standard state for virtual network gateway sku tier. VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" + // VirtualNetworkGatewaySkuTierUltraPerformance specifies the virtual + // network gateway sku tier ultra performance state for virtual network + // gateway sku tier. + VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" ) // VirtualNetworkGatewayType enumerates the values for virtual network gateway @@ -475,15 +526,15 @@ const ( type VirtualNetworkPeeringState string const ( - // VirtualNetworkPeeringStateConnected specifies the virtual network - // peering state connected state for virtual network peering state. - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - // VirtualNetworkPeeringStateDisconnected specifies the virtual network - // peering state disconnected state for virtual network peering state. - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - // VirtualNetworkPeeringStateInitiated specifies the virtual network - // peering state initiated state for virtual network peering state. - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" + // Connected specifies the connected state for virtual network peering + // state. + Connected VirtualNetworkPeeringState = "Connected" + // Disconnected specifies the disconnected state for virtual network + // peering state. + Disconnected VirtualNetworkPeeringState = "Disconnected" + // Initiated specifies the initiated state for virtual network peering + // state. + Initiated VirtualNetworkPeeringState = "Initiated" ) // VpnType enumerates the values for vpn type. @@ -497,73 +548,103 @@ const ( ) // AddressSpace is addressSpace contains an array of IP address ranges that -// can be used by subnets +// can be used by subnets of the virtual network. type AddressSpace struct { AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` } -// ApplicationGateway is applicationGateways resource +// ApplicationGateway is application gateway resource type ApplicationGateway struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewayAuthenticationCertificate is authentication certificates -// of application gateway +// of an application gateway. type ApplicationGatewayAuthenticationCertificate struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// ApplicationGatewayAuthenticationCertificatePropertiesFormat is properties -// of Authentication certificates of application gateway +// ApplicationGatewayAuthenticationCertificatePropertiesFormat is +// authentication certificates properties of an application gateway. type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { Data *string `json:"data,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayBackendAddress is backend Address of application gateway +// ApplicationGatewayBackendAddress is backend address of an application +// gateway. type ApplicationGatewayBackendAddress struct { Fqdn *string `json:"fqdn,omitempty"` IPAddress *string `json:"ipAddress,omitempty"` } -// ApplicationGatewayBackendAddressPool is backend Address Pool of application -// gateway +// ApplicationGatewayBackendAddressPool is backend Address Pool of an +// application gateway. type ApplicationGatewayBackendAddressPool struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewayBackendAddressPoolPropertiesFormat is properties of -// Backend Address Pool of application gateway +// Backend Address Pool of an application gateway. type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } +// ApplicationGatewayBackendHealth is list of +// ApplicationGatewayBackendHealthPool resources. +type ApplicationGatewayBackendHealth struct { + autorest.Response `json:"-"` + BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` +} + +// ApplicationGatewayBackendHealthHTTPSettings is application gateway +// BackendHealthHttp settings. +type ApplicationGatewayBackendHealthHTTPSettings struct { + BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` + Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` +} + +// ApplicationGatewayBackendHealthPool is application gateway BackendHealth +// pool. +type ApplicationGatewayBackendHealthPool struct { + BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` + BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` +} + +// ApplicationGatewayBackendHealthServer is application gateway backendhealth +// http settings. +type ApplicationGatewayBackendHealthServer struct { + Address *string `json:"address,omitempty"` + IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` + Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` +} + // ApplicationGatewayBackendHTTPSettings is backend address pool settings of -// application gateway +// an application gateway. type ApplicationGatewayBackendHTTPSettings struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewayBackendHTTPSettingsPropertiesFormat is properties of -// Backend address pool settings of application gateway +// Backend address pool settings of an application gateway. type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { Port *int32 `json:"port,omitempty"` Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` @@ -575,16 +656,16 @@ type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { } // ApplicationGatewayFrontendIPConfiguration is frontend IP configuration of -// application gateway +// an application gateway. type ApplicationGatewayFrontendIPConfiguration struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewayFrontendIPConfigurationPropertiesFormat is properties of -// Frontend IP configuration of application gateway +// Frontend IP configuration of an application gateway. type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { PrivateIPAddress *string `json:"privateIPAddress,omitempty"` PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` @@ -593,31 +674,31 @@ type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayFrontendPort is frontend Port of application gateway +// ApplicationGatewayFrontendPort is frontend port of an application gateway. type ApplicationGatewayFrontendPort struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewayFrontendPortPropertiesFormat is properties of Frontend -// Port of application gateway +// port of an application gateway. type ApplicationGatewayFrontendPortPropertiesFormat struct { Port *int32 `json:"port,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayHTTPListener is http listener of application gateway +// ApplicationGatewayHTTPListener is http listener of an application gateway. type ApplicationGatewayHTTPListener struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// ApplicationGatewayHTTPListenerPropertiesFormat is properties of Http -// listener of application gateway +// ApplicationGatewayHTTPListenerPropertiesFormat is properties of HTTP +// listener of an application gateway. type ApplicationGatewayHTTPListenerPropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` FrontendPort *SubResource `json:"frontendPort,omitempty"` @@ -628,23 +709,24 @@ type ApplicationGatewayHTTPListenerPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayIPConfiguration is iP configuration of application gateway +// ApplicationGatewayIPConfiguration is iP configuration of an application +// gateway. Currently 1 public and 1 private IP configuration is allowed. type ApplicationGatewayIPConfiguration struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewayIPConfigurationPropertiesFormat is properties of IP -// configuration of application gateway +// configuration of an application gateway. type ApplicationGatewayIPConfigurationPropertiesFormat struct { Subnet *SubResource `json:"subnet,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayListResult is response for ListApplicationGateways Api -// service call +// ApplicationGatewayListResult is response for ListApplicationGateways API +// service call. type ApplicationGatewayListResult struct { autorest.Response `json:"-"` Value *[]ApplicationGateway `json:"value,omitempty"` @@ -663,17 +745,17 @@ func (client ApplicationGatewayListResult) ApplicationGatewayListResultPreparer( autorest.WithBaseURL(to.String(client.NextLink))) } -// ApplicationGatewayPathRule is path rule of URL path map of application -// gateway +// ApplicationGatewayPathRule is path rule of URL path map of an application +// gateway. type ApplicationGatewayPathRule struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// ApplicationGatewayPathRulePropertiesFormat is properties of probe of -// application gateway +// ApplicationGatewayPathRulePropertiesFormat is properties of probe of an +// application gateway. type ApplicationGatewayPathRulePropertiesFormat struct { Paths *[]string `json:"paths,omitempty"` BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` @@ -681,16 +763,16 @@ type ApplicationGatewayPathRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayProbe is probe of application gateway +// ApplicationGatewayProbe is probe of the application gateway. type ApplicationGatewayProbe struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// ApplicationGatewayProbePropertiesFormat is properties of probe of -// application gateway +// ApplicationGatewayProbePropertiesFormat is properties of probe of an +// application gateway. type ApplicationGatewayProbePropertiesFormat struct { Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` Host *string `json:"host,omitempty"` @@ -701,37 +783,38 @@ type ApplicationGatewayProbePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayPropertiesFormat is properties of Application Gateway +// ApplicationGatewayPropertiesFormat is properties of the application gateway. type ApplicationGatewayPropertiesFormat struct { - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - ResourceGUID *string `json:"resourceGuid,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` + Sku *ApplicationGatewaySku `json:"sku,omitempty"` + SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` + OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` + GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` + AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` + SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` + FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` + FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` + Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` + BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` + BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` + HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` + URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` + RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` + WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` + ResourceGUID *string `json:"resourceGuid,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayRequestRoutingRule is request routing rule of application -// gateway +// ApplicationGatewayRequestRoutingRule is request routing rule of an +// application gateway. type ApplicationGatewayRequestRoutingRule struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewayRequestRoutingRulePropertiesFormat is properties of -// Request routing rule of application gateway +// request routing rule of the application gateway. type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` @@ -741,23 +824,24 @@ type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewaySku is sKU of application gateway +// ApplicationGatewaySku is sKU of an application gateway type ApplicationGatewaySku struct { Name ApplicationGatewaySkuName `json:"name,omitempty"` Tier ApplicationGatewayTier `json:"tier,omitempty"` Capacity *int32 `json:"capacity,omitempty"` } -// ApplicationGatewaySslCertificate is sSL certificates of application gateway +// ApplicationGatewaySslCertificate is sSL certificates of an application +// gateway. type ApplicationGatewaySslCertificate struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewaySslCertificatePropertiesFormat is properties of SSL -// certificates of application gateway +// certificates of an application gateway. type ApplicationGatewaySslCertificatePropertiesFormat struct { Data *string `json:"data,omitempty"` Password *string `json:"password,omitempty"` @@ -765,21 +849,22 @@ type ApplicationGatewaySslCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewaySslPolicy is application gateway SSL policy +// ApplicationGatewaySslPolicy is application gateway SSL policy. type ApplicationGatewaySslPolicy struct { DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` } -// ApplicationGatewayURLPathMap is urlPathMap of application gateway +// ApplicationGatewayURLPathMap is urlPathMaps give a url path to the backend +// mapping information for PathBasedRouting. type ApplicationGatewayURLPathMap struct { - ID *string `json:"id,omitempty"` - Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ApplicationGatewayURLPathMapPropertiesFormat is properties of UrlPathMap of -// application gateway +// the application gateway. type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` @@ -787,8 +872,15 @@ type ApplicationGatewayURLPathMapPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// AuthorizationListResult is response for ListAuthorizations Api service -// callRetrieves all authorizations that belongs to an ExpressRouteCircuit +// ApplicationGatewayWebApplicationFirewallConfiguration is application +// gateway web application firewall configuration. +type ApplicationGatewayWebApplicationFirewallConfiguration struct { + Enabled *bool `json:"enabled,omitempty"` + FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` +} + +// AuthorizationListResult is response for ListAuthorizations API service call +// retrieves all authorizations that belongs to an ExpressRouteCircuit. type AuthorizationListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"` @@ -816,10 +908,10 @@ type AuthorizationPropertiesFormat struct { // AzureAsyncOperationResult is the response body contains the status of the // specified asynchronous operation, indicating whether it has succeeded, is -// inprogress, or has failed. Note that this status is distinct from the HTTP -// status code returned for the Get Operation Status operation itself. If the -// asynchronous operation succeeded, the response body includes the HTTP -// status code for the successful request. If the asynchronous operation +// in progress, or has failed. Note that this status is distinct from the +// HTTP status code returned for the Get Operation Status operation itself. +// If the asynchronous operation succeeded, the response body includes the +// HTTP status code for the successful request. If the asynchronous operation // failed, the response body includes the HTTP status code for the failed // request and error information regarding the failure. type AzureAsyncOperationResult struct { @@ -827,15 +919,16 @@ type AzureAsyncOperationResult struct { Error *Error `json:"error,omitempty"` } -// BackendAddressPool is pool of backend IP addresseses +// BackendAddressPool is pool of backend IP addresses. type BackendAddressPool struct { - ID *string `json:"id,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// BackendAddressPoolPropertiesFormat is properties of BackendAddressPool +// BackendAddressPoolPropertiesFormat is properties of the backend address +// pool. type BackendAddressPoolPropertiesFormat struct { BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` @@ -853,59 +946,52 @@ type BgpSettings struct { // ConnectionResetSharedKey is type ConnectionResetSharedKey struct { autorest.Response `json:"-"` - KeyLength *int64 `json:"keyLength,omitempty"` + KeyLength *int32 `json:"keyLength,omitempty"` } -// ConnectionSharedKey is response for GetConnectionSharedKey Api servive call +// ConnectionSharedKey is response for GetConnectionSharedKey API service call type ConnectionSharedKey struct { autorest.Response `json:"-"` Value *string `json:"value,omitempty"` } -// ConnectionSharedKeyResult is response for CheckConnectionSharedKey Api -// servive call -type ConnectionSharedKeyResult struct { - autorest.Response `json:"-"` - Value *string `json:"value,omitempty"` -} - -// DhcpOptions is dHCPOptions contains an array of DNS servers available to -// VMs deployed in the virtual networkStandard DHCP option for a subnet +// DhcpOptions is dhcpOptions contains an array of DNS servers available to +// VMs deployed in the virtual network. Standard DHCP option for a subnet // overrides VNET DHCP options. type DhcpOptions struct { DNSServers *[]string `json:"dnsServers,omitempty"` } -// DNSNameAvailabilityResult is response for CheckDnsNameAvailability Api -// servive call +// DNSNameAvailabilityResult is response for the CheckDnsNameAvailability API +// service call. type DNSNameAvailabilityResult struct { autorest.Response `json:"-"` Available *bool `json:"available,omitempty"` } -// EffectiveNetworkSecurityGroup is effective NetworkSecurityGroup +// EffectiveNetworkSecurityGroup is effective network security group. type EffectiveNetworkSecurityGroup struct { NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` } -// EffectiveNetworkSecurityGroupAssociation is effective NetworkSecurityGroup -// association +// EffectiveNetworkSecurityGroupAssociation is the effective network security +// group association. type EffectiveNetworkSecurityGroupAssociation struct { Subnet *SubResource `json:"subnet,omitempty"` NetworkInterface *SubResource `json:"networkInterface,omitempty"` } // EffectiveNetworkSecurityGroupListResult is response for list effective -// network security groups api servive call +// network security groups API service call. type EffectiveNetworkSecurityGroupListResult struct { autorest.Response `json:"-"` Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"` NextLink *string `json:"nextLink,omitempty"` } -// EffectiveNetworkSecurityRule is effective NetworkSecurityRules +// EffectiveNetworkSecurityRule is effective network security rules. type EffectiveNetworkSecurityRule struct { Name *string `json:"name,omitempty"` Protocol SecurityRuleProtocol `json:"protocol,omitempty"` @@ -930,8 +1016,8 @@ type EffectiveRoute struct { NextHopType RouteNextHopType `json:"nextHopType,omitempty"` } -// EffectiveRouteListResult is response for list effective route api servive -// call +// EffectiveRouteListResult is response for list effective route API service +// call. type EffectiveRouteListResult struct { autorest.Response `json:"-"` Value *[]EffectiveRoute `json:"value,omitempty"` @@ -956,19 +1042,19 @@ type ErrorDetails struct { // ExpressRouteCircuit is expressRouteCircuit resource type ExpressRouteCircuit struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` - Properties *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` + *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } -// ExpressRouteCircuitArpTable is the arp table associated with the -// ExpressRouteCircuit +// ExpressRouteCircuitArpTable is the ARP table associated with the +// ExpressRouteCircuit. type ExpressRouteCircuitArpTable struct { Age *int32 `json:"age,omitempty"` Interface *string `json:"interface,omitempty"` @@ -976,18 +1062,18 @@ type ExpressRouteCircuitArpTable struct { MacAddress *string `json:"macAddress,omitempty"` } -// ExpressRouteCircuitAuthorization is authorization in a ExpressRouteCircuit -// resource +// ExpressRouteCircuitAuthorization is authorization in an ExpressRouteCircuit +// resource. type ExpressRouteCircuitAuthorization struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Properties *AuthorizationPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + *AuthorizationPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// ExpressRouteCircuitListResult is response for ListExpressRouteCircuit Api -// service call +// ExpressRouteCircuitListResult is response for ListExpressRouteCircuit API +// service call. type ExpressRouteCircuitListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuit `json:"value,omitempty"` @@ -1006,16 +1092,16 @@ func (client ExpressRouteCircuitListResult) ExpressRouteCircuitListResultPrepare autorest.WithBaseURL(to.String(client.NextLink))) } -// ExpressRouteCircuitPeering is peering in a ExpressRouteCircuit resource +// ExpressRouteCircuitPeering is peering in an ExpressRouteCircuit resource. type ExpressRouteCircuitPeering struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// ExpressRouteCircuitPeeringConfig is specfies the peering config +// ExpressRouteCircuitPeeringConfig is specifies the peering configuration. type ExpressRouteCircuitPeeringConfig struct { AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` @@ -1023,8 +1109,8 @@ type ExpressRouteCircuitPeeringConfig struct { RoutingRegistryName *string `json:"routingRegistryName,omitempty"` } -// ExpressRouteCircuitPeeringListResult is response for ListPeering Api -// service callRetrieves all Peerings that belongs to an ExpressRouteCircuit +// ExpressRouteCircuitPeeringListResult is response for ListPeering API +// service call retrieves all peerings that belong to an ExpressRouteCircuit. type ExpressRouteCircuitPeeringListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"` @@ -1062,7 +1148,7 @@ type ExpressRouteCircuitPeeringPropertiesFormat struct { LastModifiedBy *string `json:"lastModifiedBy,omitempty"` } -// ExpressRouteCircuitPropertiesFormat is properties of ExpressRouteCircuit +// ExpressRouteCircuitPropertiesFormat is properties of ExpressRouteCircuit. type ExpressRouteCircuitPropertiesFormat struct { AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` @@ -1087,7 +1173,7 @@ type ExpressRouteCircuitRoutesTable struct { } // ExpressRouteCircuitRoutesTableSummary is the routes table associated with -// the ExpressRouteCircuit +// the ExpressRouteCircuit. type ExpressRouteCircuitRoutesTableSummary struct { Neighbor *string `json:"neighbor,omitempty"` V *int32 `json:"v,omitempty"` @@ -1097,7 +1183,7 @@ type ExpressRouteCircuitRoutesTableSummary struct { } // ExpressRouteCircuitsArpTableListResult is response for ListArpTable -// associated with the Express Route Circuits Api +// associated with the Express Route Circuits API. type ExpressRouteCircuitsArpTableListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"` @@ -1105,14 +1191,14 @@ type ExpressRouteCircuitsArpTableListResult struct { } // ExpressRouteCircuitServiceProviderProperties is contains -// ServiceProviderProperties in an ExpressRouteCircuit +// ServiceProviderProperties in an ExpressRouteCircuit. type ExpressRouteCircuitServiceProviderProperties struct { ServiceProviderName *string `json:"serviceProviderName,omitempty"` PeeringLocation *string `json:"peeringLocation,omitempty"` BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` } -// ExpressRouteCircuitSku is contains sku in an ExpressRouteCircuit +// ExpressRouteCircuitSku is contains SKU in an ExpressRouteCircuit. type ExpressRouteCircuitSku struct { Name *string `json:"name,omitempty"` Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` @@ -1120,7 +1206,7 @@ type ExpressRouteCircuitSku struct { } // ExpressRouteCircuitsRoutesTableListResult is response for ListRoutesTable -// associated with the Express Route Circuits Api +// associated with the Express Route Circuits API. type ExpressRouteCircuitsRoutesTableListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"` @@ -1128,14 +1214,14 @@ type ExpressRouteCircuitsRoutesTableListResult struct { } // ExpressRouteCircuitsRoutesTableSummaryListResult is response for -// ListRoutesTable associated with the Express Route Circuits Api +// ListRoutesTable associated with the Express Route Circuits API. type ExpressRouteCircuitsRoutesTableSummaryListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` NextLink *string `json:"nextLink,omitempty"` } -// ExpressRouteCircuitStats is contains Stats associated with the peering +// ExpressRouteCircuitStats is contains stats associated with the peering. type ExpressRouteCircuitStats struct { autorest.Response `json:"-"` PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` @@ -1144,25 +1230,25 @@ type ExpressRouteCircuitStats struct { SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` } -// ExpressRouteServiceProvider is expressRouteResourceProvider object +// ExpressRouteServiceProvider is a ExpressRouteResourceProvider object. type ExpressRouteServiceProvider struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` } -// ExpressRouteServiceProviderBandwidthsOffered is contains Bandwidths offered -// in ExpressRouteServiceProviders +// ExpressRouteServiceProviderBandwidthsOffered is contains bandwidths offered +// in ExpressRouteServiceProvider resources. type ExpressRouteServiceProviderBandwidthsOffered struct { OfferName *string `json:"offerName,omitempty"` ValueInMbps *int32 `json:"valueInMbps,omitempty"` } -// ExpressRouteServiceProviderListResult is response for -// ListExpressRouteServiceProvider Api service call +// ExpressRouteServiceProviderListResult is response for the +// ListExpressRouteServiceProvider API service call. type ExpressRouteServiceProviderListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteServiceProvider `json:"value,omitempty"` @@ -1182,23 +1268,23 @@ func (client ExpressRouteServiceProviderListResult) ExpressRouteServiceProviderL } // ExpressRouteServiceProviderPropertiesFormat is properties of -// ExpressRouteServiceProvider +// ExpressRouteServiceProvider. type ExpressRouteServiceProviderPropertiesFormat struct { PeeringLocations *[]string `json:"peeringLocations,omitempty"` BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// FrontendIPConfiguration is frontend IP address of the load balancer +// FrontendIPConfiguration is frontend IP address of the load balancer. type FrontendIPConfiguration struct { - ID *string `json:"id,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // FrontendIPConfigurationPropertiesFormat is properties of Frontend IP -// Configuration of the load balancer +// Configuration of the load balancer. type FrontendIPConfigurationPropertiesFormat struct { InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` @@ -1211,15 +1297,15 @@ type FrontendIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// InboundNatPool is inbound NAT pool of the loadbalancer +// InboundNatPool is inbound NAT pool of the load balancer. type InboundNatPool struct { - ID *string `json:"id,omitempty"` - Properties *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// InboundNatPoolPropertiesFormat is properties of Inbound NAT pool +// InboundNatPoolPropertiesFormat is properties of Inbound NAT pool. type InboundNatPoolPropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` Protocol TransportProtocol `json:"protocol,omitempty"` @@ -1229,15 +1315,15 @@ type InboundNatPoolPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// InboundNatRule is inbound NAT rule of the loadbalancer +// InboundNatRule is inbound NAT rule of the load balancer. type InboundNatRule struct { - ID *string `json:"id,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *InboundNatRulePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// InboundNatRulePropertiesFormat is properties of Inbound NAT rule +// InboundNatRulePropertiesFormat is properties of the inbound NAT rule. type InboundNatRulePropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` @@ -1249,19 +1335,19 @@ type InboundNatRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// Interface is a NetworkInterface in a resource group +// Interface is a network interface in a resource group. type Interface struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *InterfacePropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *InterfacePropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } -// InterfaceDNSSettings is dns settings of a network interface +// InterfaceDNSSettings is dNS settings of a network interface. type InterfaceDNSSettings struct { DNSServers *[]string `json:"dnsServers,omitempty"` AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"` @@ -1270,15 +1356,15 @@ type InterfaceDNSSettings struct { InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` } -// InterfaceIPConfiguration is iPConfiguration in a NetworkInterface +// InterfaceIPConfiguration is iPConfiguration in a network interface. type InterfaceIPConfiguration struct { - ID *string `json:"id,omitempty"` - Properties *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// InterfaceIPConfigurationPropertiesFormat is properties of IPConfiguration +// InterfaceIPConfigurationPropertiesFormat is properties of IP configuration. type InterfaceIPConfigurationPropertiesFormat struct { ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` @@ -1292,7 +1378,8 @@ type InterfaceIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// InterfaceListResult is response for ListNetworkInterface Api service call +// InterfaceListResult is response for the ListNetworkInterface API service +// call. type InterfaceListResult struct { autorest.Response `json:"-"` Value *[]Interface `json:"value,omitempty"` @@ -1313,18 +1400,19 @@ func (client InterfaceListResult) InterfaceListResultPreparer() (*http.Request, // InterfacePropertiesFormat is networkInterface properties. type InterfacePropertiesFormat struct { - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` - IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - Primary *bool `json:"primary,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - ResourceGUID *string `json:"resourceGuid,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` + IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Primary *bool `json:"primary,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + ResourceGUID *string `json:"resourceGuid,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } -// IPAddressAvailabilityResult is response for CheckIPAddressAvailability Api +// IPAddressAvailabilityResult is response for CheckIPAddressAvailability API // service call type IPAddressAvailabilityResult struct { autorest.Response `json:"-"` @@ -1334,13 +1422,13 @@ type IPAddressAvailabilityResult struct { // IPConfiguration is iPConfiguration type IPConfiguration struct { - ID *string `json:"id,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *IPConfigurationPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// IPConfigurationPropertiesFormat is properties of IPConfiguration +// IPConfigurationPropertiesFormat is properties of IP configuration. type IPConfigurationPropertiesFormat struct { PrivateIPAddress *string `json:"privateIPAddress,omitempty"` PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` @@ -1351,17 +1439,17 @@ type IPConfigurationPropertiesFormat struct { // LoadBalancer is loadBalancer resource type LoadBalancer struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *LoadBalancerPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } -// LoadBalancerListResult is response for ListLoadBalancers Api service call +// LoadBalancerListResult is response for ListLoadBalancers API service call. type LoadBalancerListResult struct { autorest.Response `json:"-"` Value *[]LoadBalancer `json:"value,omitempty"` @@ -1380,7 +1468,7 @@ func (client LoadBalancerListResult) LoadBalancerListResultPreparer() (*http.Req autorest.WithBaseURL(to.String(client.NextLink))) } -// LoadBalancerPropertiesFormat is properties of Load Balancer +// LoadBalancerPropertiesFormat is properties of the load balancer. type LoadBalancerPropertiesFormat struct { FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` @@ -1393,15 +1481,15 @@ type LoadBalancerPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// LoadBalancingRule is rules of the load balancer +// LoadBalancingRule is a loag balancing rule for a load balancer. type LoadBalancingRule struct { - ID *string `json:"id,omitempty"` - Properties *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// LoadBalancingRulePropertiesFormat is properties of the load balancer +// LoadBalancingRulePropertiesFormat is properties of the load balancer. type LoadBalancingRulePropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` @@ -1417,18 +1505,18 @@ type LoadBalancingRulePropertiesFormat struct { // LocalNetworkGateway is a common class for general resource information type LocalNetworkGateway struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } -// LocalNetworkGatewayListResult is response for ListLocalNetworkGateways Api -// service call +// LocalNetworkGatewayListResult is response for ListLocalNetworkGateways API +// service call. type LocalNetworkGatewayListResult struct { autorest.Response `json:"-"` Value *[]LocalNetworkGateway `json:"value,omitempty"` @@ -1456,15 +1544,15 @@ type LocalNetworkGatewayPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// OutboundNatRule is outbound NAT pool of the loadbalancer +// OutboundNatRule is outbound NAT pool of the load balancer. type OutboundNatRule struct { - ID *string `json:"id,omitempty"` - Properties *OutboundNatRulePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *OutboundNatRulePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// OutboundNatRulePropertiesFormat is outbound NAT pool of the loadbalancer +// OutboundNatRulePropertiesFormat is outbound NAT pool of the load balancer. type OutboundNatRulePropertiesFormat struct { AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"` @@ -1472,12 +1560,12 @@ type OutboundNatRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// Probe is load balancer Probe +// Probe is a load balancer probe. type Probe struct { - ID *string `json:"id,omitempty"` - Properties *ProbePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ProbePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // ProbePropertiesFormat is @@ -1491,28 +1579,28 @@ type ProbePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// PublicIPAddress is publicIPAddress resource +// PublicIPAddress is public IP address resource. type PublicIPAddress struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } -// PublicIPAddressDNSSettings is contains FQDN of the DNS record associated -// with the public IP address +// PublicIPAddressDNSSettings is contains the FQDN of the DNS record +// associated with the public IP address. type PublicIPAddressDNSSettings struct { DomainNameLabel *string `json:"domainNameLabel,omitempty"` Fqdn *string `json:"fqdn,omitempty"` ReverseFqdn *string `json:"reverseFqdn,omitempty"` } -// PublicIPAddressListResult is response for ListPublicIpAddresses Api service -// call +// PublicIPAddressListResult is response for ListPublicIpAddresses API service +// call. type PublicIPAddressListResult struct { autorest.Response `json:"-"` Value *[]PublicIPAddress `json:"value,omitempty"` @@ -1531,7 +1619,7 @@ func (client PublicIPAddressListResult) PublicIPAddressListResultPreparer() (*ht autorest.WithBaseURL(to.String(client.NextLink))) } -// PublicIPAddressPropertiesFormat is publicIpAddress properties +// PublicIPAddressPropertiesFormat is public IP address properties. type PublicIPAddressPropertiesFormat struct { PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` @@ -1552,15 +1640,15 @@ type Resource struct { Tags *map[string]*string `json:"tags,omitempty"` } -// ResourceNavigationLink is resourceNavigationLink resource +// ResourceNavigationLink is resourceNavigationLink resource. type ResourceNavigationLink struct { - ID *string `json:"id,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *ResourceNavigationLinkFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// ResourceNavigationLinkFormat is properties of ResourceNavigationLink +// ResourceNavigationLinkFormat is properties of ResourceNavigationLink. type ResourceNavigationLinkFormat struct { LinkedResourceType *string `json:"linkedResourceType,omitempty"` Link *string `json:"link,omitempty"` @@ -1569,14 +1657,14 @@ type ResourceNavigationLinkFormat struct { // Route is route resource type Route struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + *RoutePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// RouteListResult is response for ListRoute Api servive call +// RouteListResult is response for the ListRoute API service call type RouteListResult struct { autorest.Response `json:"-"` Value *[]Route `json:"value,omitempty"` @@ -1603,19 +1691,19 @@ type RoutePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// RouteTable is routeTable resource +// RouteTable is route table resource. type RouteTable struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *RouteTablePropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } -// RouteTableListResult is response for ListRouteTable Api servive call +// RouteTableListResult is response for the ListRouteTable API service call. type RouteTableListResult struct { autorest.Response `json:"-"` Value *[]RouteTable `json:"value,omitempty"` @@ -1641,20 +1729,20 @@ type RouteTablePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// SecurityGroup is networkSecurityGroup resource +// SecurityGroup is networkSecurityGroup resource. type SecurityGroup struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *SecurityGroupPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *SecurityGroupPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } -// SecurityGroupListResult is response for ListNetworkSecurityGroups Api -// servive call +// SecurityGroupListResult is response for ListNetworkSecurityGroups API +// service call. type SecurityGroupListResult struct { autorest.Response `json:"-"` Value *[]SecurityGroup `json:"value,omitempty"` @@ -1673,7 +1761,7 @@ func (client SecurityGroupListResult) SecurityGroupListResultPreparer() (*http.R autorest.WithBaseURL(to.String(client.NextLink))) } -// SecurityGroupPropertiesFormat is network Security Group resource +// SecurityGroupPropertiesFormat is network Security Group resource. type SecurityGroupPropertiesFormat struct { SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` @@ -1683,17 +1771,17 @@ type SecurityGroupPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// SecurityRule is network security rule +// SecurityRule is network security rule. type SecurityRule struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + *SecurityRulePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// SecurityRuleListResult is response for ListSecurityRule Api service -// callRetrieves all security rules that belongs to a network security group +// SecurityRuleListResult is response for ListSecurityRule API service call. +// Retrieves all security rules that belongs to a network security group. type SecurityRuleListResult struct { autorest.Response `json:"-"` Value *[]SecurityRule `json:"value,omitempty"` @@ -1732,16 +1820,16 @@ type String struct { Value *string `json:"value,omitempty"` } -// Subnet is subnet in a VirtualNework resource +// Subnet is subnet in a virtual network resource. type Subnet struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + *SubnetPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// SubnetListResult is response for ListSubnets Api service callRetrieves all +// SubnetListResult is response for ListSubnets API service callRetrieves all // subnet that belongs to a virtual network type SubnetListResult struct { autorest.Response `json:"-"` @@ -1776,7 +1864,16 @@ type SubResource struct { ID *string `json:"id,omitempty"` } -// Usage is describes Network Resource Usage. +// TunnelConnectionHealth is virtualNetworkGatewayConnection properties +type TunnelConnectionHealth struct { + Tunnel *string `json:"tunnel,omitempty"` + ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` + IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` + EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` + LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` +} + +// Usage is describes network resource usage. type Usage struct { Unit *string `json:"unit,omitempty"` CurrentValue *int64 `json:"currentValue,omitempty"` @@ -1784,13 +1881,13 @@ type Usage struct { Name *UsageName `json:"name,omitempty"` } -// UsageName is the Usage Names. +// UsageName is the usage names. type UsageName struct { Value *string `json:"value,omitempty"` LocalizedValue *string `json:"localizedValue,omitempty"` } -// UsagesListResult is the List Usages operation response. +// UsagesListResult is the list usages operation response. type UsagesListResult struct { autorest.Response `json:"-"` Value *[]Usage `json:"value,omitempty"` @@ -1809,45 +1906,45 @@ func (client UsagesListResult) UsagesListResultPreparer() (*http.Request, error) autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualNetwork is virtual Network resource +// VirtualNetwork is virtual Network resource. type VirtualNetwork struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } // VirtualNetworkGateway is a common class for general resource information type VirtualNetworkGateway struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } // VirtualNetworkGatewayConnection is a common class for general resource // information type VirtualNetworkGatewayConnection struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` } -// VirtualNetworkGatewayConnectionListResult is response for -// ListVirtualNetworkGatewayConnections Api service call +// VirtualNetworkGatewayConnectionListResult is response for the +// ListVirtualNetworkGatewayConnections API service call type VirtualNetworkGatewayConnectionListResult struct { autorest.Response `json:"-"` Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"` @@ -1867,7 +1964,7 @@ func (client VirtualNetworkGatewayConnectionListResult) VirtualNetworkGatewayCon } // VirtualNetworkGatewayConnectionPropertiesFormat is -// virtualNeworkGatewayConnection properties +// virtualNetworkGatewayConnection properties type VirtualNetworkGatewayConnectionPropertiesFormat struct { AuthorizationKey *string `json:"authorizationKey,omitempty"` VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` @@ -1877,6 +1974,7 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { RoutingWeight *int32 `json:"routingWeight,omitempty"` SharedKey *string `json:"sharedKey,omitempty"` ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` + TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` Peer *SubResource `json:"peer,omitempty"` @@ -1885,13 +1983,13 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualNetworkGatewayIPConfiguration is ipConfiguration for Virtual network -// gateway +// VirtualNetworkGatewayIPConfiguration is iP configuration for virtual +// network gateway type VirtualNetworkGatewayIPConfiguration struct { - ID *string `json:"id,omitempty"` - Properties *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // VirtualNetworkGatewayIPConfigurationPropertiesFormat is properties of @@ -1903,8 +2001,8 @@ type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualNetworkGatewayListResult is response for ListVirtualNetworkGateways -// Api service call +// VirtualNetworkGatewayListResult is response for the +// ListVirtualNetworkGateways API service call. type VirtualNetworkGatewayListResult struct { autorest.Response `json:"-"` Value *[]VirtualNetworkGateway `json:"value,omitempty"` @@ -1923,12 +2021,13 @@ func (client VirtualNetworkGatewayListResult) VirtualNetworkGatewayListResultPre autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualNetworkGatewayPropertiesFormat is virtualNeworkGateay properties +// VirtualNetworkGatewayPropertiesFormat is virtualNetworkGateway properties type VirtualNetworkGatewayPropertiesFormat struct { IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` VpnType VpnType `json:"vpnType,omitempty"` EnableBgp *bool `json:"enableBgp,omitempty"` + ActiveActive *bool `json:"activeActive,omitempty"` GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` @@ -1944,8 +2043,8 @@ type VirtualNetworkGatewaySku struct { Capacity *int32 `json:"capacity,omitempty"` } -// VirtualNetworkListResult is response for ListVirtualNetworks Api servive -// call +// VirtualNetworkListResult is response for the ListVirtualNetworks API +// service call. type VirtualNetworkListResult struct { autorest.Response `json:"-"` Value *[]VirtualNetwork `json:"value,omitempty"` @@ -1964,17 +2063,17 @@ func (client VirtualNetworkListResult) VirtualNetworkListResultPreparer() (*http autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualNetworkPeering is peerings in a VirtualNework resource +// VirtualNetworkPeering is peerings in a virtual network resource. type VirtualNetworkPeering struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Properties *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } -// VirtualNetworkPeeringListResult is response for ListSubnets Api service -// callRetrieves all subnet that belongs to a virtual network +// VirtualNetworkPeeringListResult is response for ListSubnets API service +// call. Retrieves all subnets that belong to a virtual network. type VirtualNetworkPeeringListResult struct { autorest.Response `json:"-"` Value *[]VirtualNetworkPeering `json:"value,omitempty"` @@ -2009,12 +2108,12 @@ type VirtualNetworkPropertiesFormat struct { AddressSpace *AddressSpace `json:"addressSpace,omitempty"` DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` Subnets *[]Subnet `json:"subnets,omitempty"` - VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"VirtualNetworkPeerings,omitempty"` + VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` ResourceGUID *string `json:"resourceGuid,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// VpnClientConfiguration is vpnClientConfiguration for P2S client +// VpnClientConfiguration is vpnClientConfiguration for P2S client. type VpnClientConfiguration struct { VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` @@ -2027,16 +2126,16 @@ type VpnClientParameters struct { } // VpnClientRevokedCertificate is vPN client revoked certificate of virtual -// network gateway +// network gateway. type VpnClientRevokedCertificate struct { - ID *string `json:"id,omitempty"` - Properties *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // VpnClientRevokedCertificatePropertiesFormat is properties of the revoked -// VPN client certificate of virtual network gateway +// VPN client certificate of virtual network gateway. type VpnClientRevokedCertificatePropertiesFormat struct { Thumbprint *string `json:"thumbprint,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -2045,10 +2144,10 @@ type VpnClientRevokedCertificatePropertiesFormat struct { // VpnClientRootCertificate is vPN client root certificate of virtual network // gateway type VpnClientRootCertificate struct { - ID *string `json:"id,omitempty"` - Properties *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + ID *string `json:"id,omitempty"` + *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` } // VpnClientRootCertificatePropertiesFormat is properties of SSL certificates diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go index 41a8d0e33a8..d8ef099a79c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // PublicIPAddressesClient is the the Microsoft Azure Network management API // provides a RESTful set of web services that interact with Microsoft Azure -// Networks service to manage your network resrources. The API has entities +// Networks service to manage your network resources. The API has entities // that capture the relationship between an end user and the Microsoft Azure // Networks service. type PublicIPAddressesClient struct { @@ -45,15 +46,43 @@ func NewPublicIPAddressesClientWithBaseURI(baseURI string, subscriptionID string return PublicIPAddressesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put PublicIPAddress operation creates/updates a -// stable/dynamic PublicIP address This method may poll for completion. -// Polling can be canceled by passing the cancel channel argument. The -// channel will be used to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a static or dynamic public IP address. +// This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling +// and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. publicIPAddressName is -// the name of the publicIpAddress. parameters is parameters supplied to the -// create/update PublicIPAddress operation +// the name of the public IP address. parameters is parameters supplied to +// the create or update public IP address operation. func (client PublicIPAddressesClient) CreateOrUpdate(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.NetworkSecurityGroup", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.RouteTable", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.RouteTable.RouteTablePropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.RouteTable.RouteTablePropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.IPConfigurations", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, + }}, + }}, + {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.PublicIPAddressesClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, publicIPAddressName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -115,10 +144,10 @@ func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Respons return } -// Delete the delete publicIpAddress operation deletes the specified -// publicIpAddress. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// Delete deletes the specified public IP address. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. publicIPAddressName is // the name of the subnet. @@ -182,11 +211,10 @@ func (client PublicIPAddressesClient) DeleteResponder(resp *http.Response) (resu return } -// Get the Get publicIpAddress operation retreives information about the -// specified pubicIpAddress +// Get gets the specified public IP address in a specified resource group. // // resourceGroupName is the name of the resource group. publicIPAddressName is -// the name of the subnet. expand is expand references resources. +// the name of the subnet. expand is expands referenced resources. func (client PublicIPAddressesClient) Get(resourceGroupName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { req, err := client.GetPreparer(resourceGroupName, publicIPAddressName, expand) if err != nil { @@ -249,8 +277,7 @@ func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result return } -// List the List publicIpAddress operation retrieves all the publicIpAddresses -// in a resource group. +// List gets all public IP addresses in a resource group. // // resourceGroupName is the name of the resource group. func (client PublicIPAddressesClient) List(resourceGroupName string) (result PublicIPAddressListResult, err error) { @@ -315,7 +342,7 @@ func (client PublicIPAddressesClient) ListResponder(resp *http.Response) (result func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { req, err := lastResults.PublicIPAddressListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -324,19 +351,18 @@ func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddres resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure responding to next results request") } return } -// ListAll the List publicIpAddress operation retrieves all the -// publicIpAddresses in a subscription. +// ListAll gets all the public IP addresses in a subscription. func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -398,7 +424,7 @@ func (client PublicIPAddressesClient) ListAllResponder(resp *http.Response) (res func (client PublicIPAddressesClient) ListAllNextResults(lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { req, err := lastResults.PublicIPAddressListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -407,12 +433,12 @@ func (client PublicIPAddressesClient) ListAllNextResults(lastResults PublicIPAdd resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routes.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routes.go index 8fd59b7b2b5..9aa1cf5054d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routes.go @@ -26,7 +26,7 @@ import ( // RoutesClient is the the Microsoft Azure Network management API provides a // RESTful set of web services that interact with Microsoft Azure Networks -// service to manage your network resrources. The API has entities that +// service to manage your network resources. The API has entities that // capture the relationship between an end user and the Microsoft Azure // Networks service. type RoutesClient struct { @@ -43,14 +43,15 @@ func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesCli return RoutesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put route operation creates/updates a route in the -// specified route table This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a route in the specified route table. +// This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling +// and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. routeTableName is the // name of the route table. routeName is the name of the route. -// routeParameters is parameters supplied to the create/update routeoperation +// routeParameters is parameters supplied to the create or update route +// operation. func (client RoutesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, routeName string, routeParameters Route, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, routeTableName, routeName, routeParameters, cancel) if err != nil { @@ -114,10 +115,10 @@ func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result return } -// Delete the delete route operation deletes the specified route from a route -// table. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Delete deletes the specified route from a route table. This method may poll +// for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. routeTableName is the // name of the route table. routeName is the name of the route. @@ -182,8 +183,7 @@ func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest return } -// Get the Get route operation retreives information about the specified route -// from the route table. +// Get gets the specified route from a route table. // // resourceGroupName is the name of the resource group. routeTableName is the // name of the route table. routeName is the name of the route. @@ -247,8 +247,7 @@ func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err return } -// List the List network security rule operation retrieves all the routes in a -// route table. +// List gets all routes in a route table. // // resourceGroupName is the name of the resource group. routeTableName is the // name of the route table. @@ -315,7 +314,7 @@ func (client RoutesClient) ListResponder(resp *http.Response) (result RouteListR func (client RoutesClient) ListNextResults(lastResults RouteListResult) (result RouteListResult, err error) { req, err := lastResults.RouteListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.RoutesClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.RoutesClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -324,12 +323,12 @@ func (client RoutesClient) ListNextResults(lastResults RouteListResult) (result resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go index f3473b908dc..b53e94ebaab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // RouteTablesClient is the the Microsoft Azure Network management API // provides a RESTful set of web services that interact with Microsoft Azure -// Networks service to manage your network resrources. The API has entities +// Networks service to manage your network resources. The API has entities // that capture the relationship between an end user and the Microsoft Azure // Networks service. type RouteTablesClient struct { @@ -44,15 +45,22 @@ func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) Rout return RouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put RouteTable operation creates/updates a route tablein -// the specified resource group. This method may poll for completion. Polling -// can be canceled by passing the cancel channel argument. The channel will -// be used to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate create or updates a route table in a specified resource +// group. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. parameters is parameters supplied to the -// create/update Route Table operation +// name of the route table. parameters is parameters supplied to the create +// or update route table operation. func (client RouteTablesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, parameters RouteTable, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.RouteTablePropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RouteTablePropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.RouteTablesClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, routeTableName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -114,10 +122,10 @@ func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (re return } -// Delete the Delete RouteTable operation deletes the specifed Route Table -// This method may poll for completion. Polling can be canceled by passing -// the cancel channel argument. The channel will be used to cancel polling -// and any outstanding HTTP requests. +// Delete deletes the specified route table. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. routeTableName is the // name of the route table. @@ -181,11 +189,10 @@ func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result aut return } -// Get the Get RouteTables operation retrieves information about the specified -// route table. +// Get gets the specified route table. // // resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. expand is expand references resources. +// name of the route table. expand is expands referenced resources. func (client RouteTablesClient) Get(resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) { req, err := client.GetPreparer(resourceGroupName, routeTableName, expand) if err != nil { @@ -248,7 +255,7 @@ func (client RouteTablesClient) GetResponder(resp *http.Response) (result RouteT return } -// List the list RouteTables returns all route tables in a resource group +// List gets all route tables in a resource group. // // resourceGroupName is the name of the resource group. func (client RouteTablesClient) List(resourceGroupName string) (result RouteTableListResult, err error) { @@ -313,7 +320,7 @@ func (client RouteTablesClient) ListResponder(resp *http.Response) (result Route func (client RouteTablesClient) ListNextResults(lastResults RouteTableListResult) (result RouteTableListResult, err error) { req, err := lastResults.RouteTableListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -322,18 +329,18 @@ func (client RouteTablesClient) ListNextResults(lastResults RouteTableListResult resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure responding to next results request") } return } -// ListAll the list RouteTables returns all route tables in a subscription +// ListAll gets all route tables in a subscription. func (client RouteTablesClient) ListAll() (result RouteTableListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -395,7 +402,7 @@ func (client RouteTablesClient) ListAllResponder(resp *http.Response) (result Ro func (client RouteTablesClient) ListAllNextResults(lastResults RouteTableListResult) (result RouteTableListResult, err error) { req, err := lastResults.RouteTableListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -404,12 +411,12 @@ func (client RouteTablesClient) ListAllNextResults(lastResults RouteTableListRes resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go index e6ccc5814e0..37898c4d089 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // SecurityGroupsClient is the the Microsoft Azure Network management API // provides a RESTful set of web services that interact with Microsoft Azure -// Networks service to manage your network resrources. The API has entities +// Networks service to manage your network resources. The API has entities // that capture the relationship between an end user and the Microsoft Azure // Networks service. type SecurityGroupsClient struct { @@ -45,17 +46,25 @@ func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) S return SecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put NetworkSecurityGroup operation creates/updates a -// network security groupin the specified resource group. This method may -// poll for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// CreateOrUpdate creates or updates a network security group in the specified +// resource group. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used +// to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. // networkSecurityGroupName is the name of the network security group. -// parameters is parameters supplied to the create/update Network Security -// Group operation +// parameters is parameters supplied to the create or update network security +// group operation. func (client SecurityGroupsClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SecurityGroupPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SecurityGroupPropertiesFormat.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.SecurityGroupPropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.SecurityGroupsClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkSecurityGroupName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -117,10 +126,10 @@ func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Delete the Delete NetworkSecurityGroup operation deletes the specifed -// network security group This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// Delete deletes the specified network security group. This method may poll +// for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. // networkSecurityGroupName is the name of the network security group. @@ -184,12 +193,11 @@ func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result return } -// Get the Get NetworkSecurityGroups operation retrieves information about the -// specified network security group. +// Get gets the specified network security group. // // resourceGroupName is the name of the resource group. // networkSecurityGroupName is the name of the network security group. expand -// is expand references resources. +// is expands referenced resources. func (client SecurityGroupsClient) Get(resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) { req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName, expand) if err != nil { @@ -252,8 +260,7 @@ func (client SecurityGroupsClient) GetResponder(resp *http.Response) (result Sec return } -// List the list NetworkSecurityGroups returns all network security groups in -// a resource group +// List gets all network security groups in a resource group. // // resourceGroupName is the name of the resource group. func (client SecurityGroupsClient) List(resourceGroupName string) (result SecurityGroupListResult, err error) { @@ -318,7 +325,7 @@ func (client SecurityGroupsClient) ListResponder(resp *http.Response) (result Se func (client SecurityGroupsClient) ListNextResults(lastResults SecurityGroupListResult) (result SecurityGroupListResult, err error) { req, err := lastResults.SecurityGroupListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -327,19 +334,18 @@ func (client SecurityGroupsClient) ListNextResults(lastResults SecurityGroupList resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure responding to next results request") } return } -// ListAll the list NetworkSecurityGroups returns all network security groups -// in a subscription +// ListAll gets all network security groups in a subscription. func (client SecurityGroupsClient) ListAll() (result SecurityGroupListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -401,7 +407,7 @@ func (client SecurityGroupsClient) ListAllResponder(resp *http.Response) (result func (client SecurityGroupsClient) ListAllNextResults(lastResults SecurityGroupListResult) (result SecurityGroupListResult, err error) { req, err := lastResults.SecurityGroupListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -410,12 +416,12 @@ func (client SecurityGroupsClient) ListAllNextResults(lastResults SecurityGroupL resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go index 3a2cff19c0d..9603c3c1fba 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // SecurityRulesClient is the the Microsoft Azure Network management API // provides a RESTful set of web services that interact with Microsoft Azure -// Networks service to manage your network resrources. The API has entities +// Networks service to manage your network resources. The API has entities // that capture the relationship between an end user and the Microsoft Azure // Networks service. type SecurityRulesClient struct { @@ -45,18 +46,26 @@ func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) Se return SecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put network security rule operation creates/updates a -// security rule in the specified network security group This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// CreateOrUpdate creates or updates a security rule in the specified network +// security group. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used +// to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. // networkSecurityGroupName is the name of the network security group. // securityRuleName is the name of the security rule. securityRuleParameters -// is parameters supplied to the create/update network security rule -// operation +// is parameters supplied to the create or update network security rule +// operation. func (client SecurityRulesClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: securityRuleParameters, + Constraints: []validation.Constraint{{Target: "securityRuleParameters.SecurityRulePropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "securityRuleParameters.SecurityRulePropertiesFormat.SourceAddressPrefix", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "securityRuleParameters.SecurityRulePropertiesFormat.DestinationAddressPrefix", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.SecurityRulesClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -119,10 +128,10 @@ func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) ( return } -// Delete the delete network security rule operation deletes the specified -// network security rule. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// Delete deletes the specified network security rule. This method may poll +// for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. // networkSecurityGroupName is the name of the network security group. @@ -188,8 +197,7 @@ func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result a return } -// Get the Get NetworkSecurityRule operation retreives information about the -// specified network security rule. +// Get get the specified network security rule. // // resourceGroupName is the name of the resource group. // networkSecurityGroupName is the name of the network security group. @@ -254,8 +262,7 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu return } -// List the List network security rule operation retrieves all the security -// rules in a network security group. +// List gets all security rules in a network security group. // // resourceGroupName is the name of the resource group. // networkSecurityGroupName is the name of the network security group. @@ -322,7 +329,7 @@ func (client SecurityRulesClient) ListResponder(resp *http.Response) (result Sec func (client SecurityRulesClient) ListNextResults(lastResults SecurityRuleListResult) (result SecurityRuleListResult, err error) { req, err := lastResults.SecurityRuleListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -331,12 +338,12 @@ func (client SecurityRulesClient) ListNextResults(lastResults SecurityRuleListRe resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go index 7a28d50fa2d..6230dbf03dc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // SubnetsClient is the the Microsoft Azure Network management API provides a // RESTful set of web services that interact with Microsoft Azure Networks -// service to manage your network resrources. The API has entities that +// service to manage your network resources. The API has entities that // capture the relationship between an end user and the Microsoft Azure // Networks service. type SubnetsClient struct { @@ -43,16 +44,34 @@ func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsC return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put Subnet operation creates/updates a subnet in -// thespecified virtual network This method may poll for completion. Polling -// can be canceled by passing the cancel channel argument. The channel will -// be used to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a subnet in the specified virtual +// network. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. subnetName is the name of the subnet. -// subnetParameters is parameters supplied to the create/update Subnet -// operation +// subnetParameters is parameters supplied to the create or update subnet +// operation. func (client SubnetsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: subnetParameters, + Constraints: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.NetworkSecurityGroup", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "subnetParameters.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}, + }}, + {Target: "subnetParameters.SubnetPropertiesFormat.RouteTable", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.RouteTable.RouteTablePropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.RouteTable.RouteTablePropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}}, + }}, + {Target: "subnetParameters.SubnetPropertiesFormat.IPConfigurations", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.SubnetsClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -115,10 +134,9 @@ func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result return } -// Delete the delete subnet operation deletes the specified subnet. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and -// any outstanding HTTP requests. +// Delete deletes the specified subnet. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The +// channel will be used to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. subnetName is the name of the subnet. @@ -183,12 +201,11 @@ func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autores return } -// Get the Get subnet operation retreives information about the specified -// subnet. +// Get gets the specified subnet by virtual network and resource group. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. subnetName is the name of the subnet. -// expand is expand references resources. +// expand is expands referenced resources. func (client SubnetsClient) Get(resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) { req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, subnetName, expand) if err != nil { @@ -252,8 +269,7 @@ func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, er return } -// List the List subnets operation retrieves all the subnets in a virtual -// network. +// List gets all subnets in a virtual network. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. @@ -320,7 +336,7 @@ func (client SubnetsClient) ListResponder(resp *http.Response) (result SubnetLis func (client SubnetsClient) ListNextResults(lastResults SubnetListResult) (result SubnetListResult, err error) { req, err := lastResults.SubnetListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -329,12 +345,12 @@ func (client SubnetsClient) ListNextResults(lastResults SubnetListResult) (resul resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/usages.go index 291172422c9..016de70e1c3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/usages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/usages.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // UsagesClient is the the Microsoft Azure Network management API provides a // RESTful set of web services that interact with Microsoft Azure Networks -// service to manage your network resrources. The API has entities that +// service to manage your network resources. The API has entities that // capture the relationship between an end user and the Microsoft Azure // Networks service. type UsagesClient struct { @@ -45,8 +46,14 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli // List lists compute usages for a subscription. // -// location is the location upon which resource usage is queried. +// location is the location where resource usage is queried. func (client UsagesClient) List(location string) (result UsagesListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.UsagesClient", "List") + } + req, err := client.ListPreparer(location) if err != nil { return result, autorest.NewErrorWithError(err, "network.UsagesClient", "List", nil, "Failure preparing request") @@ -108,7 +115,7 @@ func (client UsagesClient) ListResponder(resp *http.Response) (result UsagesList func (client UsagesClient) ListNextResults(lastResults UsagesListResult) (result UsagesListResult, err error) { req, err := lastResults.UsagesListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.UsagesClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.UsagesClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -117,12 +124,12 @@ func (client UsagesClient) ListNextResults(lastResults UsagesListResult) (result resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/version.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/version.go index 5a9c3b43f80..b0628fe0bd2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/version.go @@ -23,9 +23,9 @@ import ( ) const ( - major = "3" - minor = "2" - patch = "0" + major = "7" + minor = "0" + patch = "1" // Always begin a "tag" with a dash (as per http://semver.org) tag = "-beta" semVerFormat = "%s.%s.%s%s" @@ -34,7 +34,7 @@ const ( // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return fmt.Sprintf(userAgentFormat, Version(), "network", "2016-06-01") + return fmt.Sprintf(userAgentFormat, Version(), "network", "2016-09-01") } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go index 9a9ef51bf2b..d58a9d326fa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go @@ -21,13 +21,14 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // VirtualNetworkGatewayConnectionsClient is the the Microsoft Azure Network // management API provides a RESTful set of web services that interact with -// Microsoft Azure Networks service to manage your network resrources. The -// API has entities that capture the relationship between an end user and the +// Microsoft Azure Networks service to manage your network resources. The API +// has entities that capture the relationship between an end user and the // Microsoft Azure Networks service. type VirtualNetworkGatewayConnectionsClient struct { ManagementClient @@ -45,19 +46,46 @@ func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscr return VirtualNetworkGatewayConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put VirtualNetworkGatewayConnection operation -// creates/updates a virtual network gateway connection in the specified -// resource group through Network resource provider. This method may poll for -// completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// CreateOrUpdate creates or updates a virtual network gateway connection in +// the specified resource group. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will +// be used to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. // virtualNetworkGatewayConnectionName is the name of the virtual network -// gateway conenction. parameters is parameters supplied to the Begin Create -// or update Virtual Network Gateway connection operation through Network -// resource provider. +// gateway connection. parameters is parameters supplied to the create or +// update virtual network gateway connection operation. func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.IPConfigurations", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.IPConfigurations", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.LocalNetworkAddressSpace", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.ConnectionStatus", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.TunnelConnectionStatus", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.EgressBytesTransferred", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.IngressBytesTransferred", Name: validation.ReadOnly, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -119,11 +147,10 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(res return } -// Delete the Delete VirtualNetworkGatewayConnection operation deletes the -// specifed virtual network Gateway connection through Network resource -// provider. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Delete deletes the specified virtual network Gateway connection. This +// method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and +// any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. // virtualNetworkGatewayConnectionName is the name of the virtual network @@ -188,9 +215,7 @@ func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http. return } -// Get the Get VirtualNetworkGatewayConnection operation retrieves information -// about the specified virtual network gateway connection through Network -// resource provider. +// Get gets the specified virtual network gateway connection by resource group. // // resourceGroupName is the name of the resource group. // virtualNetworkGatewayConnectionName is the name of the virtual network @@ -259,10 +284,10 @@ func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Res // connection shared key through Network resource provider. // // resourceGroupName is the name of the resource group. -// connectionSharedKeyName is the virtual network gateway connection shared -// key name. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupName string, connectionSharedKeyName string) (result ConnectionSharedKeyResult, err error) { - req, err := client.GetSharedKeyPreparer(resourceGroupName, connectionSharedKeyName) +// virtualNetworkGatewayConnectionName is the virtual network gateway +// connection shared key name. +func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string) (result ConnectionSharedKey, err error) { + req, err := client.GetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName) if err != nil { return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", nil, "Failure preparing request") } @@ -282,11 +307,11 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupN } // GetSharedKeyPreparer prepares the GetSharedKey request. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resourceGroupName string, connectionSharedKeyName string) (*http.Request, error) { +func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectionSharedKeyName": autorest.Encode("path", connectionSharedKeyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } queryParameters := map[string]interface{}{ @@ -296,7 +321,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resour preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) } @@ -309,7 +334,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeySender(req *htt // GetSharedKeyResponder handles the response to the GetSharedKey request. The method always // closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKeyResult, err error) { +func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -386,7 +411,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ListResponder(resp *http.Re func (client VirtualNetworkGatewayConnectionsClient) ListNextResults(lastResults VirtualNetworkGatewayConnectionListResult) (result VirtualNetworkGatewayConnectionListResult, err error) { req, err := lastResults.VirtualNetworkGatewayConnectionListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -395,12 +420,12 @@ func (client VirtualNetworkGatewayConnectionsClient) ListNextResults(lastResults resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure responding to next results request") } return @@ -416,9 +441,18 @@ func (client VirtualNetworkGatewayConnectionsClient) ListNextResults(lastResults // resourceGroupName is the name of the resource group. // virtualNetworkGatewayConnectionName is the virtual network gateway // connection reset shared key Name. parameters is parameters supplied to the -// Begin Reset Virtual Network Gateway connection shared key operation -// through Network resource provider. +// begin reset virtual network gateway connection shared key operation +// through network resource provider. func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey") + } + req, err := client.ResetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", nil, "Failure preparing request") @@ -490,9 +524,15 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(res // resourceGroupName is the name of the resource group. // virtualNetworkGatewayConnectionName is the virtual network gateway // connection name. parameters is parameters supplied to the Begin Set -// Virtual Network Gateway conection Shared key operation throughNetwork +// Virtual Network Gateway connection Shared key operation throughNetwork // resource provider. func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey") + } + req, err := client.SetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go index 792b0455d8e..2a6ce4772df 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go @@ -21,12 +21,13 @@ package network import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // VirtualNetworkGatewaysClient is the the Microsoft Azure Network management // API provides a RESTful set of web services that interact with Microsoft -// Azure Networks service to manage your network resrources. The API has +// Azure Networks service to manage your network resources. The API has // entities that capture the relationship between an end user and the // Microsoft Azure Networks service. type VirtualNetworkGatewaysClient struct { @@ -45,17 +46,25 @@ func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID s return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put VirtualNetworkGateway operation creates/updates a -// virtual network gateway in the specified resource group through Network -// resource provider. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a virtual network gateway in the +// specified resource group. This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be +// used to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. // virtualNetworkGatewayName is the name of the virtual network gateway. -// parameters is parameters supplied to the Begin Create or update Virtual -// Network Gateway operation through Network resource provider. +// parameters is parameters supplied to create or update virtual network +// gateway operation. func (client VirtualNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.IPConfigurations", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate") + } + req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -117,9 +126,8 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Re return } -// Delete the Delete VirtualNetworkGateway operation deletes the specifed -// virtual network Gateway through Network resource provider. This method may -// poll for completion. Polling can be canceled by passing the cancel channel +// Delete deletes the specified virtual network gateway. This method may poll +// for completion. Polling can be canceled by passing the cancel channel // argument. The channel will be used to cancel polling and any outstanding // HTTP requests. // @@ -185,14 +193,13 @@ func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) return } -// Generatevpnclientpackage the Generatevpnclientpackage operation generates -// Vpn client package for P2S client of the virtual network gateway in the -// specified resource group through Network resource provider. +// Generatevpnclientpackage generates VPN client package for P2S client of the +// virtual network gateway in the specified resource group. // // resourceGroupName is the name of the resource group. // virtualNetworkGatewayName is the name of the virtual network gateway. -// parameters is parameters supplied to the Begin Generating Virtual Network -// Gateway Vpn client package operation through Network resource provider. +// parameters is parameters supplied to the generate virtual network gateway +// VPN client package operation. func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result String, err error) { req, err := client.GeneratevpnclientpackagePreparer(resourceGroupName, virtualNetworkGatewayName, parameters) if err != nil { @@ -254,8 +261,7 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(res return } -// Get the Get VirtualNetworkGateway operation retrieves information about the -// specified virtual network gateway through Network resource provider. +// Get gets the specified virtual network gateway by resource group. // // resourceGroupName is the name of the resource group. // virtualNetworkGatewayName is the name of the virtual network gateway. @@ -318,8 +324,7 @@ func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (re return } -// List the List VirtualNetworkGateways operation retrieves all the virtual -// network gateways stored. +// List gets all virtual network gateways by resource group. // // resourceGroupName is the name of the resource group. func (client VirtualNetworkGatewaysClient) List(resourceGroupName string) (result VirtualNetworkGatewayListResult, err error) { @@ -384,7 +389,7 @@ func (client VirtualNetworkGatewaysClient) ListResponder(resp *http.Response) (r func (client VirtualNetworkGatewaysClient) ListNextResults(lastResults VirtualNetworkGatewayListResult) (result VirtualNetworkGatewayListResult, err error) { req, err := lastResults.VirtualNetworkGatewayListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -393,29 +398,28 @@ func (client VirtualNetworkGatewaysClient) ListNextResults(lastResults VirtualNe resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to next results request") } return } -// Reset the Reset VirtualNetworkGateway operation resets the primary of the -// virtual network gateway in the specified resource group through Network -// resource provider. This method may poll for completion. Polling can be +// Reset resets the primary of the virtual network gateway in the specified +// resource group. This method may poll for completion. Polling can be // canceled by passing the cancel channel argument. The channel will be used // to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. // virtualNetworkGatewayName is the name of the virtual network gateway. -// parameters is parameters supplied to the Begin Reset Virtual Network -// Gateway operation through Network resource provider. -func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) { - req, err := client.ResetPreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel) +// gatewayVip is virtual network gateway vip address supplied to the begin +// reset of the active-active feature enabled gateway. +func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string, cancel <-chan struct{}) (result autorest.Response, err error) { + req, err := client.ResetPreparer(resourceGroupName, virtualNetworkGatewayName, gatewayVip, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request") } @@ -435,7 +439,7 @@ func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtu } // ResetPreparer prepares the Reset request. -func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (*http.Request, error) { +func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string, cancel <-chan struct{}) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -445,13 +449,14 @@ func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName strin queryParameters := map[string]interface{}{ "api-version": client.APIVersion, } + if len(gatewayVip) > 0 { + queryParameters["gatewayVip"] = autorest.Encode("query", gatewayVip) + } preparer := autorest.CreatePreparer( - autorest.AsJSON(), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters), - autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{Cancel: cancel}) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkpeerings.go index dd513a4c140..bfed897a3bf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkpeerings.go @@ -26,7 +26,7 @@ import ( // VirtualNetworkPeeringsClient is the the Microsoft Azure Network management // API provides a RESTful set of web services that interact with Microsoft -// Azure Networks service to manage your network resrources. The API has +// Azure Networks service to manage your network resources. The API has // entities that capture the relationship between an end user and the // Microsoft Azure Networks service. type VirtualNetworkPeeringsClient struct { @@ -45,16 +45,15 @@ func NewVirtualNetworkPeeringsClientWithBaseURI(baseURI string, subscriptionID s return VirtualNetworkPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the Put virtual network peering operation creates/updates a -// peering in the specified virtual network This method may poll for -// completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// CreateOrUpdate creates or updates a peering in the specified virtual +// network. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. virtualNetworkPeeringName is the name of // the peering. virtualNetworkPeeringParameters is parameters supplied to the -// create/update virtual network peering operation +// create or update virtual network peering operation. func (client VirtualNetworkPeeringsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, cancel) if err != nil { @@ -118,10 +117,10 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Re return } -// Delete the delete virtual network peering operation deletes the specified -// peering. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Delete deletes the specified virtual network peering. This method may poll +// for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. virtualNetworkPeeringName is the name of @@ -187,8 +186,7 @@ func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response) return } -// Get the Get virtual network peering operation retreives information about -// the specified virtual network peering. +// Get gets the specified virtual network peering. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. virtualNetworkPeeringName is the name of @@ -253,8 +251,7 @@ func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (re return } -// List the List virtual network peerings operation retrieves all the peerings -// in a virtual network. +// List gets all virtual network peerings in a virtual network. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. @@ -321,7 +318,7 @@ func (client VirtualNetworkPeeringsClient) ListResponder(resp *http.Response) (r func (client VirtualNetworkPeeringsClient) ListNextResults(lastResults VirtualNetworkPeeringListResult) (result VirtualNetworkPeeringListResult, err error) { req, err := lastResults.VirtualNetworkPeeringListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -330,12 +327,12 @@ func (client VirtualNetworkPeeringsClient) ListNextResults(lastResults VirtualNe resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go index a48b83180b6..9046437af2d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go @@ -26,7 +26,7 @@ import ( // VirtualNetworksClient is the the Microsoft Azure Network management API // provides a RESTful set of web services that interact with Microsoft Azure -// Networks service to manage your network resrources. The API has entities +// Networks service to manage your network resources. The API has entities // that capture the relationship between an end user and the Microsoft Azure // Networks service. type VirtualNetworksClient struct { @@ -45,7 +45,7 @@ func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string) return VirtualNetworksClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CheckIPAddressAvailability checks whether a private Ip address is available +// CheckIPAddressAvailability checks whether a private IP address is available // for use. // // resourceGroupName is the name of the resource group. virtualNetworkName is @@ -113,15 +113,14 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *ht return } -// CreateOrUpdate the Put VirtualNetwork operation creates/updates a virtual -// network in the specified resource group. This method may poll for -// completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// CreateOrUpdate creates or updates a virtual network in the specified +// resource group. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used +// to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. parameters is parameters supplied to the -// create/update Virtual Network operation +// create or update virtual network operation func (client VirtualNetworksClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, cancel <-chan struct{}) (result autorest.Response, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkName, parameters, cancel) if err != nil { @@ -184,10 +183,10 @@ func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) return } -// Delete the Delete VirtualNetwork operation deletes the specifed virtual -// network This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Delete deletes the specified virtual network. This method may poll for +// completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // // resourceGroupName is the name of the resource group. virtualNetworkName is // the name of the virtual network. @@ -251,11 +250,10 @@ func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result return } -// Get the Get VirtualNetwork operation retrieves information about the -// specified virtual network. +// Get gets the specified virtual network by resource group. // // resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. expand is expand references resources. +// the name of the virtual network. expand is expands referenced resources. func (client VirtualNetworksClient) Get(resourceGroupName string, virtualNetworkName string, expand string) (result VirtualNetwork, err error) { req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, expand) if err != nil { @@ -318,8 +316,7 @@ func (client VirtualNetworksClient) GetResponder(resp *http.Response) (result Vi return } -// List the list VirtualNetwork returns all Virtual Networks in a resource -// group +// List gets all virtual networks in a resource group. // // resourceGroupName is the name of the resource group. func (client VirtualNetworksClient) List(resourceGroupName string) (result VirtualNetworkListResult, err error) { @@ -384,7 +381,7 @@ func (client VirtualNetworksClient) ListResponder(resp *http.Response) (result V func (client VirtualNetworksClient) ListNextResults(lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, err error) { req, err := lastResults.VirtualNetworkListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", nil, "Failure preparing next results request") } if req == nil { return @@ -393,19 +390,18 @@ func (client VirtualNetworksClient) ListNextResults(lastResults VirtualNetworkLi resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure responding to next results request") } return } -// ListAll the list VirtualNetwork returns all Virtual Networks in a -// subscription +// ListAll gets all virtual networks in a subscription. func (client VirtualNetworksClient) ListAll() (result VirtualNetworkListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -467,7 +463,7 @@ func (client VirtualNetworksClient) ListAllResponder(resp *http.Response) (resul func (client VirtualNetworksClient) ListAllNextResults(lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, err error) { req, err := lastResults.VirtualNetworkListResultPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", nil, "Failure preparing next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", nil, "Failure preparing next results request") } if req == nil { return @@ -476,12 +472,12 @@ func (client VirtualNetworksClient) ListAllNextResults(lastResults VirtualNetwor resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure sending next results request request") + return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure responding to next results request request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure responding to next results request") } return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go index 39e50fe0f18..c895c3a949f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go @@ -21,6 +21,7 @@ package storage import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -40,12 +41,20 @@ func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) Account return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CheckNameAvailability checks that account name is valid and is not in use. +// CheckNameAvailability checks that the storage account name is valid and is +// not already in use. // // accountName is the name of the storage account within the specified // resource group. Storage account names must be between 3 and 24 characters // in length and use numbers and lower-case letters only. func (client AccountsClient) CheckNameAvailability(accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "accountName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "CheckNameAvailability") + } + req, err := client.CheckNameAvailabilityPreparer(accountName) if err != nil { return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", nil, "Failure preparing request") @@ -105,13 +114,13 @@ func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response) } // Create asynchronously creates a new storage account with the specified -// parameters. If an account is already created and subsequent create request -// is issued with different properties, the account properties will be -// updated. If an account is already created and subsequent create or update -// request is issued with exact same set of properties, the request will -// succeed. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// parameters. If an account is already created and a subsequent create +// request is issued with different properties, the account properties will +// be updated. If an account is already created and a subsequent create or +// update request is issued with the exact same set of properties, the +// request will succeed. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used +// to cancel polling and any outstanding HTTP requests. // // resourceGroupName is the name of the resource group within the user's // subscription. accountName is the name of the storage account within the @@ -119,6 +128,28 @@ func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response) // characters in length and use numbers and lower-case letters only. // parameters is the parameters to provide for the created account. func (client AccountsClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Sku.Tier", Name: validation.ReadOnly, Rule: true, Chain: nil}}}, + {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.AccountPropertiesCreateParameters.Encryption", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.Encryption.Services", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.Encryption.Services.Blob", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.Encryption.Services.Blob.LastEnabledTime", Name: validation.ReadOnly, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.AccountPropertiesCreateParameters.Encryption.KeySource", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "Create") + } + req, err := client.CreatePreparer(resourceGroupName, accountName, parameters, cancel) if err != nil { return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", nil, "Failure preparing request") @@ -174,7 +205,7 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result autore err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return @@ -187,6 +218,13 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result autore // specified resource group. Storage account names must be between 3 and 24 // characters in length and use numbers and lower-case letters only. func (client AccountsClient) Delete(resourceGroupName string, accountName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "Delete") + } + req, err := client.DeletePreparer(resourceGroupName, accountName) if err != nil { return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", nil, "Failure preparing request") @@ -245,14 +283,21 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore } // GetProperties returns the properties for the specified storage account -// including but not limited to name, account type, location, and account -// status. The ListKeys operation should be used to retrieve storage keys. +// including but not limited to name, SKU name, location, and account status. +// The ListKeys operation should be used to retrieve storage keys. // // resourceGroupName is the name of the resource group within the user's // subscription. accountName is the name of the storage account within the // specified resource group. Storage account names must be between 3 and 24 // characters in length and use numbers and lower-case letters only. func (client AccountsClient) GetProperties(resourceGroupName string, accountName string) (result Account, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "GetProperties") + } + req, err := client.GetPropertiesPreparer(resourceGroupName, accountName) if err != nil { return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", nil, "Failure preparing request") @@ -436,9 +481,18 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) ( // ListKeys lists the access keys for the specified storage account. // -// resourceGroupName is the name of the resource group. accountName is the -// name of the storage account. +// resourceGroupName is the name of the resource group within the user's +// subscription. accountName is the name of the storage account within the +// specified resource group. Storage account names must be between 3 and 24 +// characters in length and use numbers and lower-case letters only. func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountListKeysResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "ListKeys") + } + req, err := client.ListKeysPreparer(resourceGroupName, accountName) if err != nil { return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", nil, "Failure preparing request") @@ -497,15 +551,25 @@ func (client AccountsClient) ListKeysResponder(resp *http.Response) (result Acco return } -// RegenerateKey regenerates the access keys for the specified storage account. +// RegenerateKey regenerates one of the access keys for the specified storage +// account. // // resourceGroupName is the name of the resource group within the user's // subscription. accountName is the name of the storage account within the // specified resource group. Storage account names must be between 3 and 24 // characters in length and use numbers and lower-case letters only. -// regenerateKey is specifies name of the key which should be regenerated. -// key1 or key2 for the default keys +// regenerateKey is specifies name of the key which should be regenerated -- +// key1 or key2. func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: regenerateKey, + Constraints: []validation.Constraint{{Target: "regenerateKey.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "RegenerateKey") + } + req, err := client.RegenerateKeyPreparer(resourceGroupName, accountName, regenerateKey) if err != nil { return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", nil, "Failure preparing request") @@ -566,15 +630,15 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result return } -// Update the update operation can be used to update the account type, -// encryption, or tags for a storage account. It can also be used to map the +// Update the update operation can be used to update the SKU, encryption, +// access tier, or tags for a storage account. It can also be used to map the // account to a custom domain. Only one custom domain is supported per -// storage account and. replacement/change of custom domain is not supported. +// storage account; the replacement/change of custom domain is not supported. // In order to replace an old custom domain, the old value must be -// cleared/unregistered before a new value may be set. Update of multiple +// cleared/unregistered before a new value can be set. The update of multiple // properties is supported. This call does not change the storage keys for -// the account. If you want to change storage account keys, use the -// regenerate keys operation. The location and name of the storage account +// the account. If you want to change the storage account keys, use the +// regenerate keys operation. The location and name of the storage account // cannot be changed after creation. // // resourceGroupName is the name of the resource group within the user's @@ -583,6 +647,13 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result // characters in length and use numbers and lower-case letters only. // parameters is the parameters to provide for the updated account. func (client AccountsClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "Update") + } + req, err := client.UpdatePreparer(resourceGroupName, accountName, parameters) if err != nil { return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/models.go index a4a4d2be416..bff65ec6eb5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/models.go @@ -131,15 +131,15 @@ const ( // Account is the storage account. type Account struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Kind Kind `json:"kind,omitempty"` - Properties *AccountProperties `json:"properties,omitempty"` + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Kind Kind `json:"kind,omitempty"` + *AccountProperties `json:"properties,omitempty"` } // AccountCheckNameAvailabilityParameters is @@ -148,13 +148,14 @@ type AccountCheckNameAvailabilityParameters struct { Type *string `json:"type,omitempty"` } -// AccountCreateParameters is the parameters to provide for the account. +// AccountCreateParameters is the parameters used when creating a storage +// account. type AccountCreateParameters struct { - Sku *Sku `json:"sku,omitempty"` - Kind Kind `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *AccountPropertiesCreateParameters `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Kind Kind `json:"kind,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *AccountPropertiesCreateParameters `json:"properties,omitempty"` } // AccountKey is an access key for the storage account. @@ -164,13 +165,13 @@ type AccountKey struct { Permissions KeyPermission `json:"permissions,omitempty"` } -// AccountListKeysResult is the ListKeys operation response. +// AccountListKeysResult is the response from the ListKeys operation. type AccountListKeysResult struct { autorest.Response `json:"-"` Keys *[]AccountKey `json:"keys,omitempty"` } -// AccountListResult is the list storage accounts operation response. +// AccountListResult is the response from the List Storage Accounts operation. type AccountListResult struct { autorest.Response `json:"-"` Value *[]Account `json:"value,omitempty"` @@ -211,11 +212,12 @@ type AccountRegenerateKeyParameters struct { KeyName *string `json:"keyName,omitempty"` } -// AccountUpdateParameters is the parameters to provide for the account. +// AccountUpdateParameters is the parameters that can be provided when +// updating the storage account properties. type AccountUpdateParameters struct { - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Properties *AccountPropertiesUpdateParameters `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *AccountPropertiesUpdateParameters `json:"properties,omitempty"` } // CheckNameAvailabilityResult is the CheckNameAvailability operation response. @@ -233,25 +235,26 @@ type CustomDomain struct { UseSubDomain *bool `json:"useSubDomain,omitempty"` } -// Encryption is the encryption settings on the account. +// Encryption is the encryption settings on the storage account. type Encryption struct { Services *EncryptionServices `json:"services,omitempty"` KeySource *string `json:"keySource,omitempty"` } -// EncryptionService is an encrypted service. +// EncryptionService is a service that allows server-side encryption to be +// used. type EncryptionService struct { Enabled *bool `json:"enabled,omitempty"` LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"` } -// EncryptionServices is the encrypted services. +// EncryptionServices is a list of services that support encryption. type EncryptionServices struct { Blob *EncryptionService `json:"blob,omitempty"` } // Endpoints is the URIs that are used to perform a retrieval of a public -// blob, queue or table object. +// blob, queue, or table object. type Endpoints struct { Blob *string `json:"blob,omitempty"` Queue *string `json:"queue,omitempty"` @@ -282,13 +285,14 @@ type Usage struct { Name *UsageName `json:"name,omitempty"` } -// UsageListResult is the List Usages operation response. +// UsageListResult is the response from the List Usages operation. type UsageListResult struct { autorest.Response `json:"-"` Value *[]Usage `json:"value,omitempty"` } -// UsageName is the Usage Names. +// UsageName is the usage names that can be used; currently limited to +// StorageAccount. type UsageName struct { Value *string `json:"value,omitempty"` LocalizedValue *string `json:"localizedValue,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/version.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/version.go index 61b71b1703d..e0a181c11a5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/version.go @@ -23,9 +23,9 @@ import ( ) const ( - major = "3" - minor = "2" - patch = "0" + major = "7" + minor = "0" + patch = "1" // Always begin a "tag" with a dash (as per http://semver.org) tag = "-beta" semVerFormat = "%s.%s.%s%s" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md b/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md new file mode 100644 index 00000000000..0ab099848bb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md @@ -0,0 +1,5 @@ +# Azure Storage SDK for Go + +The `github.com/Azure/azure-sdk-for-go/storage` package is used to perform operations in Azure Storage Service. To manage your storage accounts (Azure Resource Manager / ARM), use the [github.com/Azure/azure-sdk-for-go/arm/storage](../arm/storage) package. For your classic storage accounts (Azure Service Management / ASM), use [github.com/Azure/azure-sdk-for-go/management/storageservice](../management/storageservice) package. + +This package includes support for [Azure Storage Emulator](https://azure.microsoft.com/documentation/articles/storage-use-emulator/) \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go index 4207cfec6e7..3dbaca52ade 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "net/http" "net/url" "strconv" @@ -256,6 +257,23 @@ const ( blobCopyStatusFailed = "failed" ) +// lease constants. +const ( + leaseHeaderPrefix = "x-ms-lease-" + leaseID = "x-ms-lease-id" + leaseAction = "x-ms-lease-action" + leaseBreakPeriod = "x-ms-lease-break-period" + leaseDuration = "x-ms-lease-duration" + leaseProposedID = "x-ms-proposed-lease-id" + leaseTime = "x-ms-lease-time" + + acquireLease = "acquire" + renewLease = "renew" + changeLease = "change" + releaseLease = "release" + breakLease = "break" +) + // BlockListType is used to filter out types of blocks in a Get Blocks List call // for a block blob. // @@ -284,6 +302,65 @@ const ( ContainerAccessTypeContainer ContainerAccessType = "container" ) +// ContainerAccessOptions are used when setting ACLs of containers (after creation) +type ContainerAccessOptions struct { + ContainerAccess ContainerAccessType + Timeout int + LeaseID string +} + +// AccessPolicyDetails are used for SETTING policies +type AccessPolicyDetails struct { + ID string + StartTime time.Time + ExpiryTime time.Time + CanRead bool + CanWrite bool + CanDelete bool +} + +// ContainerPermissions is used when setting permissions and Access Policies for containers. +type ContainerPermissions struct { + AccessOptions ContainerAccessOptions + AccessPolicy AccessPolicyDetails +} + +// AccessPolicyDetailsXML has specifics about an access policy +// annotated with XML details. +type AccessPolicyDetailsXML struct { + StartTime time.Time `xml:"Start"` + ExpiryTime time.Time `xml:"Expiry"` + Permission string `xml:"Permission"` +} + +// SignedIdentifier is a wrapper for a specific policy +type SignedIdentifier struct { + ID string `xml:"Id"` + AccessPolicy AccessPolicyDetailsXML `xml:"AccessPolicy"` +} + +// SignedIdentifiers part of the response from GetPermissions call. +type SignedIdentifiers struct { + SignedIdentifiers []SignedIdentifier `xml:"SignedIdentifier"` +} + +// AccessPolicy is the response type from the GetPermissions call. +type AccessPolicy struct { + SignedIdentifiersList SignedIdentifiers `xml:"SignedIdentifiers"` +} + +// ContainerAccessResponse is returned for the GetContainerPermissions function. +// This contains both the permission and access policy for the container. +type ContainerAccessResponse struct { + ContainerAccess ContainerAccessType + AccessPolicy SignedIdentifiers +} + +// ContainerAccessHeader references header used when setting/getting container ACL +const ( + ContainerAccessHeader string = "x-ms-blob-public-access" +) + // Maximum sizes (per REST API) for various concepts const ( MaxBlobBlockSize = 4 * 1024 * 1024 @@ -399,7 +476,7 @@ func (b BlobStorageClient) createContainer(name string, access ContainerAccessTy headers := b.client.getStandardHeaders() if access != "" { - headers["x-ms-blob-public-access"] = string(access) + headers[ContainerAccessHeader] = string(access) } return b.client.exec(verb, uri, headers, nil) } @@ -421,6 +498,101 @@ func (b BlobStorageClient) ContainerExists(name string) (bool, error) { return false, err } +// SetContainerPermissions sets up container permissions as per https://msdn.microsoft.com/en-us/library/azure/dd179391.aspx +func (b BlobStorageClient) SetContainerPermissions(container string, containerPermissions ContainerPermissions) (err error) { + params := url.Values{ + "restype": {"container"}, + "comp": {"acl"}, + } + + if containerPermissions.AccessOptions.Timeout > 0 { + params.Add("timeout", strconv.Itoa(containerPermissions.AccessOptions.Timeout)) + } + + uri := b.client.getEndpoint(blobServiceName, pathForContainer(container), params) + headers := b.client.getStandardHeaders() + if containerPermissions.AccessOptions.ContainerAccess != "" { + headers[ContainerAccessHeader] = string(containerPermissions.AccessOptions.ContainerAccess) + } + + if containerPermissions.AccessOptions.LeaseID != "" { + headers[leaseID] = containerPermissions.AccessOptions.LeaseID + } + + // generate the XML for the SharedAccessSignature if required. + accessPolicyXML, err := generateAccessPolicy(containerPermissions.AccessPolicy) + if err != nil { + return err + } + + var resp *storageResponse + if accessPolicyXML != "" { + headers["Content-Length"] = strconv.Itoa(len(accessPolicyXML)) + resp, err = b.client.exec("PUT", uri, headers, strings.NewReader(accessPolicyXML)) + } else { + resp, err = b.client.exec("PUT", uri, headers, nil) + } + + if err != nil { + return err + } + + if resp != nil { + defer func() { + err = resp.body.Close() + }() + + if resp.statusCode != http.StatusOK { + return errors.New("Unable to set permissions") + } + } + return nil +} + +// GetContainerPermissions gets the container permissions as per https://msdn.microsoft.com/en-us/library/azure/dd179469.aspx +// If timeout is 0 then it will not be passed to Azure +// leaseID will only be passed to Azure if populated +// Returns permissionResponse which is combined permissions and AccessPolicy +func (b BlobStorageClient) GetContainerPermissions(container string, timeout int, leaseID string) (permissionResponse *ContainerAccessResponse, err error) { + params := url.Values{"restype": {"container"}, + "comp": {"acl"}} + + if timeout > 0 { + params.Add("timeout", strconv.Itoa(timeout)) + } + + uri := b.client.getEndpoint(blobServiceName, pathForContainer(container), params) + headers := b.client.getStandardHeaders() + + if leaseID != "" { + headers[leaseID] = leaseID + } + + resp, err := b.client.exec("GET", uri, headers, nil) + if err != nil { + return nil, err + } + + // containerAccess. Blob, Container, empty + containerAccess := resp.headers.Get(http.CanonicalHeaderKey(ContainerAccessHeader)) + + defer func() { + err = resp.body.Close() + }() + + var out AccessPolicy + err = xmlUnmarshal(resp.body, &out.SignedIdentifiersList) + if err != nil { + return nil, err + } + + permissionResponse = &ContainerAccessResponse{} + permissionResponse.AccessPolicy = out.SignedIdentifiersList + permissionResponse.ContainerAccess = ContainerAccessType(containerAccess) + + return permissionResponse, nil +} + // DeleteContainer deletes the container with given name on the storage // account. If the container does not exist returns error. // @@ -560,6 +732,174 @@ func (b BlobStorageClient) getBlobRange(container, name, bytesRange string, extr return resp, err } +// leasePut is common PUT code for the various aquire/release/break etc functions. +func (b BlobStorageClient) leaseCommonPut(container string, name string, headers map[string]string, expectedStatus int) (http.Header, error) { + params := url.Values{"comp": {"lease"}} + uri := b.client.getEndpoint(blobServiceName, pathForBlob(container, name), params) + + resp, err := b.client.exec("PUT", uri, headers, nil) + if err != nil { + return nil, err + } + defer resp.body.Close() + + if err := checkRespCode(resp.statusCode, []int{expectedStatus}); err != nil { + return nil, err + } + + return resp.headers, nil +} + +// SnapshotBlob creates a snapshot for a blob as per https://msdn.microsoft.com/en-us/library/azure/ee691971.aspx +func (b BlobStorageClient) SnapshotBlob(container string, name string, timeout int, extraHeaders map[string]string) (snapshotTimestamp *time.Time, err error) { + headers := b.client.getStandardHeaders() + params := url.Values{"comp": {"snapshot"}} + + if timeout > 0 { + params.Add("timeout", strconv.Itoa(timeout)) + } + + for k, v := range extraHeaders { + headers[k] = v + } + + uri := b.client.getEndpoint(blobServiceName, pathForBlob(container, name), params) + resp, err := b.client.exec("PUT", uri, headers, nil) + if err != nil { + return nil, err + } + + if err := checkRespCode(resp.statusCode, []int{http.StatusCreated}); err != nil { + return nil, err + } + + snapshotResponse := resp.headers.Get(http.CanonicalHeaderKey("x-ms-snapshot")) + if snapshotResponse != "" { + snapshotTimestamp, err := time.Parse(time.RFC3339, snapshotResponse) + if err != nil { + return nil, err + } + + return &snapshotTimestamp, nil + } + + return nil, errors.New("Snapshot not created") +} + +// AcquireLease creates a lease for a blob as per https://msdn.microsoft.com/en-us/library/azure/ee691972.aspx +// returns leaseID acquired +func (b BlobStorageClient) AcquireLease(container string, name string, leaseTimeInSeconds int, proposedLeaseID string) (returnedLeaseID string, err error) { + headers := b.client.getStandardHeaders() + headers[leaseAction] = acquireLease + + if leaseTimeInSeconds > 0 { + headers[leaseDuration] = strconv.Itoa(leaseTimeInSeconds) + } + + if proposedLeaseID != "" { + headers[leaseProposedID] = proposedLeaseID + } + + respHeaders, err := b.leaseCommonPut(container, name, headers, http.StatusCreated) + if err != nil { + return "", err + } + + returnedLeaseID = respHeaders.Get(http.CanonicalHeaderKey(leaseID)) + + if returnedLeaseID != "" { + return returnedLeaseID, nil + } + + return "", errors.New("LeaseID not returned") +} + +// BreakLease breaks the lease for a blob as per https://msdn.microsoft.com/en-us/library/azure/ee691972.aspx +// Returns the timeout remaining in the lease in seconds +func (b BlobStorageClient) BreakLease(container string, name string) (breakTimeout int, err error) { + headers := b.client.getStandardHeaders() + headers[leaseAction] = breakLease + return b.breakLeaseCommon(container, name, headers) +} + +// BreakLeaseWithBreakPeriod breaks the lease for a blob as per https://msdn.microsoft.com/en-us/library/azure/ee691972.aspx +// breakPeriodInSeconds is used to determine how long until new lease can be created. +// Returns the timeout remaining in the lease in seconds +func (b BlobStorageClient) BreakLeaseWithBreakPeriod(container string, name string, breakPeriodInSeconds int) (breakTimeout int, err error) { + headers := b.client.getStandardHeaders() + headers[leaseAction] = breakLease + headers[leaseBreakPeriod] = strconv.Itoa(breakPeriodInSeconds) + return b.breakLeaseCommon(container, name, headers) +} + +// breakLeaseCommon is common code for both version of BreakLease (with and without break period) +func (b BlobStorageClient) breakLeaseCommon(container string, name string, headers map[string]string) (breakTimeout int, err error) { + + respHeaders, err := b.leaseCommonPut(container, name, headers, http.StatusAccepted) + if err != nil { + return 0, err + } + + breakTimeoutStr := respHeaders.Get(http.CanonicalHeaderKey(leaseTime)) + if breakTimeoutStr != "" { + breakTimeout, err = strconv.Atoi(breakTimeoutStr) + if err != nil { + return 0, err + } + } + + return breakTimeout, nil +} + +// ChangeLease changes a lease ID for a blob as per https://msdn.microsoft.com/en-us/library/azure/ee691972.aspx +// Returns the new LeaseID acquired +func (b BlobStorageClient) ChangeLease(container string, name string, currentLeaseID string, proposedLeaseID string) (newLeaseID string, err error) { + headers := b.client.getStandardHeaders() + headers[leaseAction] = changeLease + headers[leaseID] = currentLeaseID + headers[leaseProposedID] = proposedLeaseID + + respHeaders, err := b.leaseCommonPut(container, name, headers, http.StatusOK) + if err != nil { + return "", err + } + + newLeaseID = respHeaders.Get(http.CanonicalHeaderKey(leaseID)) + if newLeaseID != "" { + return newLeaseID, nil + } + + return "", errors.New("LeaseID not returned") +} + +// ReleaseLease releases the lease for a blob as per https://msdn.microsoft.com/en-us/library/azure/ee691972.aspx +func (b BlobStorageClient) ReleaseLease(container string, name string, currentLeaseID string) error { + headers := b.client.getStandardHeaders() + headers[leaseAction] = releaseLease + headers[leaseID] = currentLeaseID + + _, err := b.leaseCommonPut(container, name, headers, http.StatusOK) + if err != nil { + return err + } + + return nil +} + +// RenewLease renews the lease for a blob as per https://msdn.microsoft.com/en-us/library/azure/ee691972.aspx +func (b BlobStorageClient) RenewLease(container string, name string, currentLeaseID string) error { + headers := b.client.getStandardHeaders() + headers[leaseAction] = renewLease + headers[leaseID] = currentLeaseID + + _, err := b.leaseCommonPut(container, name, headers, http.StatusOK) + if err != nil { + return err + } + + return nil +} + // GetBlobProperties provides various information about the specified // blob. See https://msdn.microsoft.com/en-us/library/azure/dd179394.aspx func (b BlobStorageClient) GetBlobProperties(container, name string) (*BlobProperties, error) { @@ -961,15 +1301,20 @@ func (b BlobStorageClient) AppendBlock(container, name string, chunk []byte, ext // // See https://msdn.microsoft.com/en-us/library/azure/dd894037.aspx func (b BlobStorageClient) CopyBlob(container, name, sourceBlob string) error { - copyID, err := b.startBlobCopy(container, name, sourceBlob) + copyID, err := b.StartBlobCopy(container, name, sourceBlob) if err != nil { return err } - return b.waitForBlobCopy(container, name, copyID) + return b.WaitForBlobCopy(container, name, copyID) } -func (b BlobStorageClient) startBlobCopy(container, name, sourceBlob string) (string, error) { +// StartBlobCopy starts a blob copy operation. +// sourceBlob parameter must be a canonical URL to the blob (can be +// obtained using GetBlobURL method.) +// +// See https://msdn.microsoft.com/en-us/library/azure/dd894037.aspx +func (b BlobStorageClient) StartBlobCopy(container, name, sourceBlob string) (string, error) { uri := b.client.getEndpoint(blobServiceName, pathForBlob(container, name), url.Values{}) headers := b.client.getStandardHeaders() @@ -992,7 +1337,39 @@ func (b BlobStorageClient) startBlobCopy(container, name, sourceBlob string) (st return copyID, nil } -func (b BlobStorageClient) waitForBlobCopy(container, name, copyID string) error { +// AbortBlobCopy aborts a BlobCopy which has already been triggered by the StartBlobCopy function. +// copyID is generated from StartBlobCopy function. +// currentLeaseID is required IF the destination blob has an active lease on it. +// As defined in https://msdn.microsoft.com/en-us/library/azure/jj159098.aspx +func (b BlobStorageClient) AbortBlobCopy(container, name, copyID, currentLeaseID string, timeout int) error { + params := url.Values{"comp": {"copy"}, "copyid": {copyID}} + if timeout > 0 { + params.Add("timeout", strconv.Itoa(timeout)) + } + + uri := b.client.getEndpoint(blobServiceName, pathForBlob(container, name), params) + headers := b.client.getStandardHeaders() + headers["x-ms-copy-action"] = "abort" + + if currentLeaseID != "" { + headers[leaseID] = currentLeaseID + } + + resp, err := b.client.exec("PUT", uri, headers, nil) + if err != nil { + return err + } + defer resp.body.Close() + + if err := checkRespCode(resp.statusCode, []int{http.StatusNoContent}); err != nil { + return err + } + + return nil +} + +// WaitForBlobCopy loops until a BlobCopy operation is completed (or fails with error) +func (b BlobStorageClient) WaitForBlobCopy(container, name, copyID string) error { for { props, err := b.GetBlobProperties(container, name) if err != nil { @@ -1036,10 +1413,12 @@ func (b BlobStorageClient) DeleteBlob(container, name string, extraHeaders map[s // See https://msdn.microsoft.com/en-us/library/azure/dd179413.aspx func (b BlobStorageClient) DeleteBlobIfExists(container, name string, extraHeaders map[string]string) (bool, error) { resp, err := b.deleteBlob(container, name, extraHeaders) - if resp != nil && (resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound) { - return resp.statusCode == http.StatusAccepted, nil + if resp != nil { + defer resp.body.Close() + if resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound { + return resp.statusCode == http.StatusAccepted, nil + } } - defer resp.body.Close() return false, err } @@ -1065,17 +1444,18 @@ func pathForBlob(container, name string) string { return fmt.Sprintf("/%s/%s", container, name) } -// GetBlobSASURI creates an URL to the specified blob which contains the Shared -// Access Signature with specified permissions and expiration time. +// GetBlobSASURIWithSignedIPAndProtocol creates an URL to the specified blob which contains the Shared +// Access Signature with specified permissions and expiration time. Also includes signedIPRange and allowed procotols. +// If old API version is used but no signedIP is passed (ie empty string) then this should still work. +// We only populate the signedIP when it non-empty. // // See https://msdn.microsoft.com/en-us/library/azure/ee395415.aspx -func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Time, permissions string) (string, error) { +func (b BlobStorageClient) GetBlobSASURIWithSignedIPAndProtocol(container, name string, expiry time.Time, permissions string, signedIPRange string, HTTPSOnly bool) (string, error) { var ( signedPermissions = permissions blobURL = b.GetBlobURL(container, name) ) canonicalizedResource, err := b.client.buildCanonicalizedResource(blobURL) - if err != nil { return "", err } @@ -1087,7 +1467,6 @@ func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Tim // We need to replace + with %2b first to avoid being treated as a space (which is correct for query strings, but not the path component). canonicalizedResource = strings.Replace(canonicalizedResource, "+", "%2b", -1) - canonicalizedResource, err = url.QueryUnescape(canonicalizedResource) if err != nil { return "", err @@ -1096,7 +1475,11 @@ func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Tim signedExpiry := expiry.UTC().Format(time.RFC3339) signedResource := "b" - stringToSign, err := blobSASStringToSign(b.client.apiVersion, canonicalizedResource, signedExpiry, signedPermissions) + protocols := "https,http" + if HTTPSOnly { + protocols = "https" + } + stringToSign, err := blobSASStringToSign(b.client.apiVersion, canonicalizedResource, signedExpiry, signedPermissions, signedIPRange, protocols) if err != nil { return "", err } @@ -1110,6 +1493,13 @@ func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Tim "sig": {sig}, } + if b.client.apiVersion >= "2015-04-05" { + sasParams.Add("spr", protocols) + if signedIPRange != "" { + sasParams.Add("sip", signedIPRange) + } + } + sasURL, err := url.Parse(blobURL) if err != nil { return "", err @@ -1118,16 +1508,89 @@ func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Tim return sasURL.String(), nil } -func blobSASStringToSign(signedVersion, canonicalizedResource, signedExpiry, signedPermissions string) (string, error) { +// GetBlobSASURI creates an URL to the specified blob which contains the Shared +// Access Signature with specified permissions and expiration time. +// +// See https://msdn.microsoft.com/en-us/library/azure/ee395415.aspx +func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Time, permissions string) (string, error) { + url, err := b.GetBlobSASURIWithSignedIPAndProtocol(container, name, expiry, permissions, "", false) + return url, err +} + +func blobSASStringToSign(signedVersion, canonicalizedResource, signedExpiry, signedPermissions string, signedIP string, protocols string) (string, error) { var signedStart, signedIdentifier, rscc, rscd, rsce, rscl, rsct string if signedVersion >= "2015-02-21" { canonicalizedResource = "/blob" + canonicalizedResource } + // https://msdn.microsoft.com/en-us/library/azure/dn140255.aspx#Anchor_12 + if signedVersion >= "2015-04-05" { + return fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s", signedPermissions, signedStart, signedExpiry, canonicalizedResource, signedIdentifier, signedIP, protocols, signedVersion, rscc, rscd, rsce, rscl, rsct), nil + } + // reference: http://msdn.microsoft.com/en-us/library/azure/dn140255.aspx if signedVersion >= "2013-08-15" { return fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s", signedPermissions, signedStart, signedExpiry, canonicalizedResource, signedIdentifier, signedVersion, rscc, rscd, rsce, rscl, rsct), nil } + return "", errors.New("storage: not implemented SAS for versions earlier than 2013-08-15") } + +func generatePermissions(accessPolicy AccessPolicyDetails) (permissions string) { + // generate the permissions string (rwd). + // still want the end user API to have bool flags. + permissions = "" + + if accessPolicy.CanRead { + permissions += "r" + } + + if accessPolicy.CanWrite { + permissions += "w" + } + + if accessPolicy.CanDelete { + permissions += "d" + } + + return permissions +} + +// convertAccessPolicyToXMLStructs converts between AccessPolicyDetails which is a struct better for API usage to the +// AccessPolicy struct which will get converted to XML. +func convertAccessPolicyToXMLStructs(accessPolicy AccessPolicyDetails) SignedIdentifiers { + return SignedIdentifiers{ + SignedIdentifiers: []SignedIdentifier{ + { + ID: accessPolicy.ID, + AccessPolicy: AccessPolicyDetailsXML{ + StartTime: accessPolicy.StartTime.UTC().Round(time.Second), + ExpiryTime: accessPolicy.ExpiryTime.UTC().Round(time.Second), + Permission: generatePermissions(accessPolicy), + }, + }, + }, + } +} + +// generateAccessPolicy generates the XML access policy used as the payload for SetContainerPermissions. +func generateAccessPolicy(accessPolicy AccessPolicyDetails) (accessPolicyXML string, err error) { + + if accessPolicy.ID != "" { + signedIdentifiers := convertAccessPolicyToXMLStructs(accessPolicy) + body, _, err := xmlMarshal(signedIdentifiers) + if err != nil { + return "", err + } + + xmlByteArray, err := ioutil.ReadAll(body) + if err != nil { + return "", err + } + accessPolicyXML = string(xmlByteArray) + return accessPolicyXML, nil + } + + return "", nil +} 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 2816e03ec6c..77528511a47 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 @@ -128,6 +128,7 @@ func NewBasicClient(accountName, accountKey string) (Client, error) { return NewEmulatorClient() } return NewClient(accountName, accountKey, DefaultBaseURL, DefaultAPIVersion, defaultUseHTTPS) + } //NewEmulatorClient contructs a Client intended to only work with Azure @@ -305,7 +306,7 @@ func (c Client) buildCanonicalizedResourceTable(uri string) (string, error) { cr := "/" + c.getCanonicalizedAccountName() if len(u.Path) > 0 { - cr += u.Path + cr += u.EscapedPath() } return cr, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go index 4710fbad36f..f679395bde2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go @@ -1,9 +1,14 @@ package storage import ( + "encoding/xml" + "errors" "fmt" + "io" "net/http" "net/url" + "strconv" + "strings" ) // FileServiceClient contains operations for Microsoft Azure File Service. @@ -11,31 +16,486 @@ type FileServiceClient struct { client Client } -// pathForFileShare returns the URL path segment for a File Share resource -func pathForFileShare(name string) string { - return fmt.Sprintf("/%s", name) +// A Share is an entry in ShareListResponse. +type Share struct { + Name string `xml:"Name"` + Properties ShareProperties `xml:"Properties"` } -// CreateShare operation creates a new share under the specified account. If the -// share with the same name already exists, the operation fails. +// A Directory is an entry in DirsAndFilesListResponse. +type Directory struct { + Name string `xml:"Name"` +} + +// A File is an entry in DirsAndFilesListResponse. +type File struct { + Name string `xml:"Name"` + Properties FileProperties `xml:"Properties"` +} + +// ShareProperties contains various properties of a share returned from +// various endpoints like ListShares. +type ShareProperties struct { + LastModified string `xml:"Last-Modified"` + Etag string `xml:"Etag"` + Quota string `xml:"Quota"` +} + +// DirectoryProperties contains various properties of a directory returned +// from various endpoints like GetDirectoryProperties. +type DirectoryProperties struct { + LastModified string `xml:"Last-Modified"` + Etag string `xml:"Etag"` +} + +// FileProperties contains various properties of a file returned from +// various endpoints like ListDirsAndFiles. +type FileProperties struct { + CacheControl string `header:"x-ms-cache-control"` + ContentLength uint64 `xml:"Content-Length"` + ContentType string `header:"x-ms-content-type"` + CopyCompletionTime string + CopyID string + CopySource string + CopyProgress string + CopyStatusDesc string + CopyStatus string + Disposition string `header:"x-ms-content-disposition"` + Encoding string `header:"x-ms-content-encoding"` + Etag string + Language string `header:"x-ms-content-language"` + LastModified string + MD5 string `header:"x-ms-content-md5"` +} + +// FileStream contains file data returned from a call to GetFile. +type FileStream struct { + Body io.ReadCloser + Properties *FileProperties + Metadata map[string]string +} + +// ShareListResponse contains the response fields from +// ListShares call. // -// See https://msdn.microsoft.com/en-us/library/azure/dn167008.aspx -func (f FileServiceClient) CreateShare(name string) error { - resp, err := f.createShare(name) +// See https://msdn.microsoft.com/en-us/library/azure/dn167009.aspx +type ShareListResponse struct { + XMLName xml.Name `xml:"EnumerationResults"` + Xmlns string `xml:"xmlns,attr"` + Prefix string `xml:"Prefix"` + Marker string `xml:"Marker"` + NextMarker string `xml:"NextMarker"` + MaxResults int64 `xml:"MaxResults"` + Shares []Share `xml:"Shares>Share"` +} + +// ListSharesParameters defines the set of customizable parameters to make a +// List Shares call. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn167009.aspx +type ListSharesParameters struct { + Prefix string + Marker string + Include string + MaxResults uint + Timeout uint +} + +// DirsAndFilesListResponse contains the response fields from +// a List Files and Directories call. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166980.aspx +type DirsAndFilesListResponse struct { + XMLName xml.Name `xml:"EnumerationResults"` + Xmlns string `xml:"xmlns,attr"` + Marker string `xml:"Marker"` + MaxResults int64 `xml:"MaxResults"` + Directories []Directory `xml:"Entries>Directory"` + Files []File `xml:"Entries>File"` + NextMarker string `xml:"NextMarker"` +} + +// FileRanges contains a list of file range information for a file. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166984.aspx +type FileRanges struct { + ContentLength uint64 + LastModified string + ETag string + FileRanges []FileRange `xml:"Range"` +} + +// FileRange contains range information for a file. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166984.aspx +type FileRange struct { + Start uint64 `xml:"Start"` + End uint64 `xml:"End"` +} + +// ListDirsAndFilesParameters defines the set of customizable parameters to +// make a List Files and Directories call. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166980.aspx +type ListDirsAndFilesParameters struct { + Marker string + MaxResults uint + Timeout uint +} + +// ShareHeaders contains various properties of a file and is an entry +// in SetShareProperties +type ShareHeaders struct { + Quota string `header:"x-ms-share-quota"` +} + +type compType string + +const ( + compNone compType = "" + compList compType = "list" + compMetadata compType = "metadata" + compProperties compType = "properties" + compRangeList compType = "rangelist" +) + +func (ct compType) String() string { + return string(ct) +} + +type resourceType string + +const ( + resourceDirectory resourceType = "directory" + resourceFile resourceType = "" + resourceShare resourceType = "share" +) + +func (rt resourceType) String() string { + return string(rt) +} + +func (p ListSharesParameters) getParameters() url.Values { + out := url.Values{} + + if p.Prefix != "" { + out.Set("prefix", p.Prefix) + } + if p.Marker != "" { + out.Set("marker", p.Marker) + } + if p.Include != "" { + out.Set("include", p.Include) + } + if p.MaxResults != 0 { + out.Set("maxresults", fmt.Sprintf("%v", p.MaxResults)) + } + if p.Timeout != 0 { + out.Set("timeout", fmt.Sprintf("%v", p.Timeout)) + } + + return out +} + +func (p ListDirsAndFilesParameters) getParameters() url.Values { + out := url.Values{} + + if p.Marker != "" { + out.Set("marker", p.Marker) + } + if p.MaxResults != 0 { + out.Set("maxresults", fmt.Sprintf("%v", p.MaxResults)) + } + if p.Timeout != 0 { + out.Set("timeout", fmt.Sprintf("%v", p.Timeout)) + } + + return out +} + +func (fr FileRange) String() string { + return fmt.Sprintf("bytes=%d-%d", fr.Start, fr.End) +} + +// ToPathSegment returns the URL path segment for the specified values +func ToPathSegment(parts ...string) string { + join := strings.Join(parts, "/") + if join[0] != '/' { + join = fmt.Sprintf("/%s", join) + } + return join +} + +// returns url.Values for the specified types +func getURLInitValues(comp compType, res resourceType) url.Values { + values := url.Values{} + if comp != compNone { + values.Set("comp", comp.String()) + } + if res != resourceFile { + values.Set("restype", res.String()) + } + return values +} + +// ListDirsAndFiles returns a list of files or directories under the specified share or +// directory. It also contains a pagination token and other response details. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166980.aspx +func (f FileServiceClient) ListDirsAndFiles(path string, params ListDirsAndFilesParameters) (DirsAndFilesListResponse, error) { + q := mergeParams(params.getParameters(), getURLInitValues(compList, resourceDirectory)) + + var out DirsAndFilesListResponse + resp, err := f.listContent(path, q, nil) + if err != nil { + return out, err + } + + defer resp.body.Close() + err = xmlUnmarshal(resp.body, &out) + return out, err +} + +// ListFileRanges returns the list of valid ranges for a file. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166984.aspx +func (f FileServiceClient) ListFileRanges(path string, listRange *FileRange) (FileRanges, error) { + params := url.Values{"comp": {"rangelist"}} + + // add optional range to list + var headers map[string]string + if listRange != nil { + headers = make(map[string]string) + headers["Range"] = listRange.String() + } + + var out FileRanges + resp, err := f.listContent(path, params, headers) + if err != nil { + return out, err + } + + defer resp.body.Close() + var cl uint64 + cl, err = strconv.ParseUint(resp.headers.Get("x-ms-content-length"), 10, 64) + if err != nil { + return out, err + } + + out.ContentLength = cl + out.ETag = resp.headers.Get("ETag") + out.LastModified = resp.headers.Get("Last-Modified") + + err = xmlUnmarshal(resp.body, &out) + return out, err +} + +// ListShares returns the list of shares in a storage account along with +// pagination token and other response details. +// +// See https://msdn.microsoft.com/en-us/library/azure/dd179352.aspx +func (f FileServiceClient) ListShares(params ListSharesParameters) (ShareListResponse, error) { + q := mergeParams(params.getParameters(), url.Values{"comp": {"list"}}) + + var out ShareListResponse + resp, err := f.listContent("", q, nil) + if err != nil { + return out, err + } + + defer resp.body.Close() + err = xmlUnmarshal(resp.body, &out) + return out, err +} + +// retrieves directory or share content +func (f FileServiceClient) listContent(path string, params url.Values, extraHeaders map[string]string) (*storageResponse, error) { + if err := f.checkForStorageEmulator(); err != nil { + return nil, err + } + + uri := f.client.getEndpoint(fileServiceName, path, params) + headers := mergeHeaders(f.client.getStandardHeaders(), extraHeaders) + + resp, err := f.client.exec(http.MethodGet, uri, headers, nil) + if err != nil { + return nil, err + } + + if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + resp.body.Close() + return nil, err + } + + return resp, nil +} + +// CreateDirectory operation creates a new directory with optional metadata in the +// specified share. If a directory with the same name already exists, the operation fails. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166993.aspx +func (f FileServiceClient) CreateDirectory(path string, metadata map[string]string) error { + return f.createResource(path, resourceDirectory, mergeMDIntoExtraHeaders(metadata, nil)) +} + +// CreateFile operation creates a new file with optional metadata or replaces an existing one. +// Note that this only initializes the file, call PutRange to add content. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn194271.aspx +func (f FileServiceClient) CreateFile(path string, maxSize uint64, metadata map[string]string) error { + extraHeaders := map[string]string{ + "x-ms-content-length": strconv.FormatUint(maxSize, 10), + "x-ms-type": "file", + } + return f.createResource(path, resourceFile, mergeMDIntoExtraHeaders(metadata, extraHeaders)) +} + +// ClearRange releases the specified range of space in storage. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn194276.aspx +func (f FileServiceClient) ClearRange(path string, fileRange FileRange) error { + return f.modifyRange(path, nil, fileRange) +} + +// PutRange writes a range of bytes to a file. Note that the length of bytes must +// match (rangeEnd - rangeStart) + 1 with a maximum size of 4MB. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn194276.aspx +func (f FileServiceClient) PutRange(path string, bytes io.Reader, fileRange FileRange) error { + return f.modifyRange(path, bytes, fileRange) +} + +// modifies a range of bytes in the specified file +func (f FileServiceClient) modifyRange(path string, bytes io.Reader, fileRange FileRange) error { + if err := f.checkForStorageEmulator(); err != nil { + return err + } + if fileRange.End < fileRange.Start { + return errors.New("the value for rangeEnd must be greater than or equal to rangeStart") + } + if bytes != nil && fileRange.End-fileRange.Start > 4194304 { + return errors.New("range cannot exceed 4MB in size") + } + + uri := f.client.getEndpoint(fileServiceName, path, url.Values{"comp": {"range"}}) + + // default to clear + write := "clear" + cl := uint64(0) + + // if bytes is not nil then this is an update operation + if bytes != nil { + write = "update" + cl = (fileRange.End - fileRange.Start) + 1 + } + + extraHeaders := map[string]string{ + "Content-Length": strconv.FormatUint(cl, 10), + "Range": fileRange.String(), + "x-ms-write": write, + } + + headers := mergeHeaders(f.client.getStandardHeaders(), extraHeaders) + resp, err := f.client.exec(http.MethodPut, uri, headers, bytes) if err != nil { return err } + defer resp.body.Close() return checkRespCode(resp.statusCode, []int{http.StatusCreated}) } -// CreateShareIfNotExists creates a new share under the specified account if -// it does not exist. Returns true if container is newly created or false if -// container already exists. +// GetFile operation reads or downloads a file from the system, including its +// metadata and properties. +// +// See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-file +func (f FileServiceClient) GetFile(path string, fileRange *FileRange) (*FileStream, error) { + var extraHeaders map[string]string + if fileRange != nil { + extraHeaders = map[string]string{ + "Range": fileRange.String(), + } + } + + resp, err := f.getResourceNoClose(path, compNone, resourceFile, http.MethodGet, extraHeaders) + if err != nil { + return nil, err + } + + if err = checkRespCode(resp.statusCode, []int{http.StatusOK, http.StatusPartialContent}); err != nil { + resp.body.Close() + return nil, err + } + + props, err := getFileProps(resp.headers) + md := getFileMDFromHeaders(resp.headers) + return &FileStream{Body: resp.body, Properties: props, Metadata: md}, nil +} + +// CreateShare operation creates a new share with optional metadata under the specified account. +// If the share with the same name already exists, the operation fails. // // See https://msdn.microsoft.com/en-us/library/azure/dn167008.aspx -func (f FileServiceClient) CreateShareIfNotExists(name string) (bool, error) { - resp, err := f.createShare(name) +func (f FileServiceClient) CreateShare(name string, metadata map[string]string) error { + return f.createResource(ToPathSegment(name), resourceShare, mergeMDIntoExtraHeaders(metadata, nil)) +} + +// DirectoryExists returns true if the specified directory exists on the specified share. +func (f FileServiceClient) DirectoryExists(path string) (bool, error) { + return f.resourceExists(path, resourceDirectory) +} + +// FileExists returns true if the specified file exists. +func (f FileServiceClient) FileExists(path string) (bool, error) { + return f.resourceExists(path, resourceFile) +} + +// ShareExists returns true if a share with given name exists +// on the storage account, otherwise returns false. +func (f FileServiceClient) ShareExists(name string) (bool, error) { + return f.resourceExists(ToPathSegment(name), resourceShare) +} + +// returns true if the specified directory or share exists +func (f FileServiceClient) resourceExists(path string, res resourceType) (bool, error) { + if err := f.checkForStorageEmulator(); err != nil { + return false, err + } + + uri := f.client.getEndpoint(fileServiceName, path, getURLInitValues(compNone, res)) + headers := f.client.getStandardHeaders() + + resp, err := f.client.exec(http.MethodHead, uri, headers, nil) + if resp != nil { + defer resp.body.Close() + if resp.statusCode == http.StatusOK || resp.statusCode == http.StatusNotFound { + return resp.statusCode == http.StatusOK, nil + } + } + return false, err +} + +// GetDirectoryURL gets the canonical URL to the directory with the specified name +// in the specified share. This method does not create a publicly accessible URL if +// the file is private and this method does not check if the directory exists. +func (f FileServiceClient) GetDirectoryURL(path string) string { + return f.client.getEndpoint(fileServiceName, path, url.Values{}) +} + +// GetShareURL gets the canonical URL to the share with the specified name in the +// specified container. This method does not create a publicly accessible URL if +// the file is private and this method does not check if the share exists. +func (f FileServiceClient) GetShareURL(name string) string { + return f.client.getEndpoint(fileServiceName, ToPathSegment(name), url.Values{}) +} + +// CreateDirectoryIfNotExists creates a new directory on the specified share +// if it does not exist. Returns true if directory is newly created or false +// if the directory already exists. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166993.aspx +func (f FileServiceClient) CreateDirectoryIfNotExists(path string) (bool, error) { + resp, err := f.createResourceNoClose(path, resourceDirectory, nil) if resp != nil { defer resp.body.Close() if resp.statusCode == http.StatusCreated || resp.statusCode == http.StatusConflict { @@ -45,14 +505,175 @@ func (f FileServiceClient) CreateShareIfNotExists(name string) (bool, error) { return false, err } -// CreateShare creates a Azure File Share and returns its response -func (f FileServiceClient) createShare(name string) (*storageResponse, error) { +// CreateShareIfNotExists creates a new share under the specified account if +// it does not exist. Returns true if container is newly created or false if +// container already exists. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn167008.aspx +func (f FileServiceClient) CreateShareIfNotExists(name string) (bool, error) { + resp, err := f.createResourceNoClose(ToPathSegment(name), resourceShare, nil) + if resp != nil { + defer resp.body.Close() + if resp.statusCode == http.StatusCreated || resp.statusCode == http.StatusConflict { + return resp.statusCode == http.StatusCreated, nil + } + } + return false, err +} + +// creates a resource depending on the specified resource type +func (f FileServiceClient) createResource(path string, res resourceType, extraHeaders map[string]string) error { + resp, err := f.createResourceNoClose(path, res, extraHeaders) + if err != nil { + return err + } + defer resp.body.Close() + return checkRespCode(resp.statusCode, []int{http.StatusCreated}) +} + +// creates a resource depending on the specified resource type, doesn't close the response body +func (f FileServiceClient) createResourceNoClose(path string, res resourceType, extraHeaders map[string]string) (*storageResponse, error) { if err := f.checkForStorageEmulator(); err != nil { return nil, err } - uri := f.client.getEndpoint(fileServiceName, pathForFileShare(name), url.Values{"restype": {"share"}}) - headers := f.client.getStandardHeaders() - return f.client.exec("PUT", uri, headers, nil) + + values := getURLInitValues(compNone, res) + uri := f.client.getEndpoint(fileServiceName, path, values) + headers := mergeHeaders(f.client.getStandardHeaders(), extraHeaders) + + return f.client.exec(http.MethodPut, uri, headers, nil) +} + +// GetDirectoryProperties provides various information about the specified directory. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn194272.aspx +func (f FileServiceClient) GetDirectoryProperties(path string) (*DirectoryProperties, error) { + headers, err := f.getResourceHeaders(path, compNone, resourceDirectory, http.MethodHead) + if err != nil { + return nil, err + } + + return &DirectoryProperties{ + LastModified: headers.Get("Last-Modified"), + Etag: headers.Get("Etag"), + }, nil +} + +// GetFileProperties provides various information about the specified file. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166971.aspx +func (f FileServiceClient) GetFileProperties(path string) (*FileProperties, error) { + headers, err := f.getResourceHeaders(path, compNone, resourceFile, http.MethodHead) + if err != nil { + return nil, err + } + return getFileProps(headers) +} + +// returns file properties from the specified HTTP header +func getFileProps(header http.Header) (*FileProperties, error) { + size, err := strconv.ParseUint(header.Get("Content-Length"), 10, 64) + if err != nil { + return nil, err + } + + return &FileProperties{ + CacheControl: header.Get("Cache-Control"), + ContentLength: size, + ContentType: header.Get("Content-Type"), + CopyCompletionTime: header.Get("x-ms-copy-completion-time"), + CopyID: header.Get("x-ms-copy-id"), + CopyProgress: header.Get("x-ms-copy-progress"), + CopySource: header.Get("x-ms-copy-source"), + CopyStatus: header.Get("x-ms-copy-status"), + CopyStatusDesc: header.Get("x-ms-copy-status-description"), + Disposition: header.Get("Content-Disposition"), + Encoding: header.Get("Content-Encoding"), + Etag: header.Get("ETag"), + Language: header.Get("Content-Language"), + LastModified: header.Get("Last-Modified"), + MD5: header.Get("Content-MD5"), + }, nil +} + +// GetShareProperties provides various information about the specified +// file. See https://msdn.microsoft.com/en-us/library/azure/dn689099.aspx +func (f FileServiceClient) GetShareProperties(name string) (*ShareProperties, error) { + headers, err := f.getResourceHeaders(ToPathSegment(name), compNone, resourceShare, http.MethodHead) + if err != nil { + return nil, err + } + return &ShareProperties{ + LastModified: headers.Get("Last-Modified"), + Etag: headers.Get("Etag"), + Quota: headers.Get("x-ms-share-quota"), + }, nil +} + +// returns HTTP header data for the specified directory or share +func (f FileServiceClient) getResourceHeaders(path string, comp compType, res resourceType, verb string) (http.Header, error) { + resp, err := f.getResourceNoClose(path, comp, res, verb, nil) + if err != nil { + return nil, err + } + defer resp.body.Close() + + if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + return nil, err + } + + return resp.headers, nil +} + +// gets the specified resource, doesn't close the response body +func (f FileServiceClient) getResourceNoClose(path string, comp compType, res resourceType, verb string, extraHeaders map[string]string) (*storageResponse, error) { + if err := f.checkForStorageEmulator(); err != nil { + return nil, err + } + + params := getURLInitValues(comp, res) + uri := f.client.getEndpoint(fileServiceName, path, params) + headers := mergeHeaders(f.client.getStandardHeaders(), extraHeaders) + + return f.client.exec(verb, uri, headers, nil) +} + +// SetFileProperties operation sets system properties on the specified file. +// +// Some keys may be converted to Camel-Case before sending. All keys +// are returned in lower case by SetFileProperties. HTTP header names +// are case-insensitive so case munging should not matter to other +// applications either. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166975.aspx +func (f FileServiceClient) SetFileProperties(path string, props FileProperties) error { + return f.setResourceHeaders(path, compProperties, resourceFile, headersFromStruct(props)) +} + +// SetShareProperties replaces the ShareHeaders for the specified file. +// +// Some keys may be converted to Camel-Case before sending. All keys +// are returned in lower case by SetShareProperties. HTTP header names +// are case-insensitive so case munging should not matter to other +// applications either. +// +// See https://msdn.microsoft.com/en-us/library/azure/mt427368.aspx +func (f FileServiceClient) SetShareProperties(name string, shareHeaders ShareHeaders) error { + return f.setResourceHeaders(ToPathSegment(name), compProperties, resourceShare, headersFromStruct(shareHeaders)) +} + +// DeleteDirectory operation removes the specified empty directory. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn166969.aspx +func (f FileServiceClient) DeleteDirectory(path string) error { + return f.deleteResource(path, resourceDirectory) +} + +// DeleteFile operation immediately removes the file from the storage account. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn689085.aspx +func (f FileServiceClient) DeleteFile(path string) error { + return f.deleteResource(path, resourceFile) } // DeleteShare operation marks the specified share for deletion. The share @@ -61,12 +682,7 @@ func (f FileServiceClient) createShare(name string) (*storageResponse, error) { // // See https://msdn.microsoft.com/en-us/library/azure/dn689090.aspx func (f FileServiceClient) DeleteShare(name string) error { - resp, err := f.deleteShare(name) - if err != nil { - return err - } - defer resp.body.Close() - return checkRespCode(resp.statusCode, []int{http.StatusAccepted}) + return f.deleteResource(ToPathSegment(name), resourceShare) } // DeleteShareIfExists operation marks the specified share for deletion if it @@ -76,7 +692,7 @@ func (f FileServiceClient) DeleteShare(name string) error { // // See https://msdn.microsoft.com/en-us/library/azure/dn689090.aspx func (f FileServiceClient) DeleteShareIfExists(name string) (bool, error) { - resp, err := f.deleteShare(name) + resp, err := f.deleteResourceNoClose(ToPathSegment(name), resourceShare) if resp != nil { defer resp.body.Close() if resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound { @@ -86,14 +702,170 @@ func (f FileServiceClient) DeleteShareIfExists(name string) (bool, error) { return false, err } -// deleteShare makes the call to Delete Share operation endpoint and returns -// the response -func (f FileServiceClient) deleteShare(name string) (*storageResponse, error) { +// deletes the resource and returns the response +func (f FileServiceClient) deleteResource(path string, res resourceType) error { + resp, err := f.deleteResourceNoClose(path, res) + if err != nil { + return err + } + defer resp.body.Close() + return checkRespCode(resp.statusCode, []int{http.StatusAccepted}) +} + +// deletes the resource and returns the response, doesn't close the response body +func (f FileServiceClient) deleteResourceNoClose(path string, res resourceType) (*storageResponse, error) { if err := f.checkForStorageEmulator(); err != nil { return nil, err } - uri := f.client.getEndpoint(fileServiceName, pathForFileShare(name), url.Values{"restype": {"share"}}) - return f.client.exec("DELETE", uri, f.client.getStandardHeaders(), nil) + + values := getURLInitValues(compNone, res) + uri := f.client.getEndpoint(fileServiceName, path, values) + return f.client.exec(http.MethodDelete, uri, f.client.getStandardHeaders(), nil) +} + +// SetDirectoryMetadata replaces the metadata for the specified directory. +// +// Some keys may be converted to Camel-Case before sending. All keys +// are returned in lower case by GetDirectoryMetadata. HTTP header names +// are case-insensitive so case munging should not matter to other +// applications either. +// +// See https://msdn.microsoft.com/en-us/library/azure/mt427370.aspx +func (f FileServiceClient) SetDirectoryMetadata(path string, metadata map[string]string) error { + return f.setResourceHeaders(path, compMetadata, resourceDirectory, mergeMDIntoExtraHeaders(metadata, nil)) +} + +// SetFileMetadata replaces the metadata for the specified file. +// +// Some keys may be converted to Camel-Case before sending. All keys +// are returned in lower case by GetFileMetadata. HTTP header names +// are case-insensitive so case munging should not matter to other +// applications either. +// +// See https://msdn.microsoft.com/en-us/library/azure/dn689097.aspx +func (f FileServiceClient) SetFileMetadata(path string, metadata map[string]string) error { + return f.setResourceHeaders(path, compMetadata, resourceFile, mergeMDIntoExtraHeaders(metadata, nil)) +} + +// SetShareMetadata replaces the metadata for the specified Share. +// +// Some keys may be converted to Camel-Case before sending. All keys +// are returned in lower case by GetShareMetadata. HTTP header names +// are case-insensitive so case munging should not matter to other +// applications either. +// +// See https://msdn.microsoft.com/en-us/library/azure/dd179414.aspx +func (f FileServiceClient) SetShareMetadata(name string, metadata map[string]string) error { + return f.setResourceHeaders(ToPathSegment(name), compMetadata, resourceShare, mergeMDIntoExtraHeaders(metadata, nil)) +} + +// merges metadata into extraHeaders and returns extraHeaders +func mergeMDIntoExtraHeaders(metadata, extraHeaders map[string]string) map[string]string { + if metadata == nil && extraHeaders == nil { + return nil + } + if extraHeaders == nil { + extraHeaders = make(map[string]string) + } + for k, v := range metadata { + extraHeaders[userDefinedMetadataHeaderPrefix+k] = v + } + return extraHeaders +} + +// merges extraHeaders into headers and returns headers +func mergeHeaders(headers, extraHeaders map[string]string) map[string]string { + for k, v := range extraHeaders { + headers[k] = v + } + return headers +} + +// sets extra header data for the specified resource +func (f FileServiceClient) setResourceHeaders(path string, comp compType, res resourceType, extraHeaders map[string]string) error { + if err := f.checkForStorageEmulator(); err != nil { + return err + } + + params := getURLInitValues(comp, res) + uri := f.client.getEndpoint(fileServiceName, path, params) + headers := mergeHeaders(f.client.getStandardHeaders(), extraHeaders) + + resp, err := f.client.exec(http.MethodPut, uri, headers, nil) + if err != nil { + return err + } + defer resp.body.Close() + + return checkRespCode(resp.statusCode, []int{http.StatusOK}) +} + +// GetDirectoryMetadata returns all user-defined metadata for the specified directory. +// +// All metadata keys will be returned in lower case. (HTTP header +// names are case-insensitive.) +// +// See https://msdn.microsoft.com/en-us/library/azure/mt427371.aspx +func (f FileServiceClient) GetDirectoryMetadata(path string) (map[string]string, error) { + return f.getMetadata(path, resourceDirectory) +} + +// GetFileMetadata returns all user-defined metadata for the specified file. +// +// All metadata keys will be returned in lower case. (HTTP header +// names are case-insensitive.) +// +// See https://msdn.microsoft.com/en-us/library/azure/dn689098.aspx +func (f FileServiceClient) GetFileMetadata(path string) (map[string]string, error) { + return f.getMetadata(path, resourceFile) +} + +// GetShareMetadata returns all user-defined metadata for the specified share. +// +// All metadata keys will be returned in lower case. (HTTP header +// names are case-insensitive.) +// +// See https://msdn.microsoft.com/en-us/library/azure/dd179414.aspx +func (f FileServiceClient) GetShareMetadata(name string) (map[string]string, error) { + return f.getMetadata(ToPathSegment(name), resourceShare) +} + +// gets metadata for the specified resource +func (f FileServiceClient) getMetadata(path string, res resourceType) (map[string]string, error) { + if err := f.checkForStorageEmulator(); err != nil { + return nil, err + } + + headers, err := f.getResourceHeaders(path, compMetadata, res, http.MethodGet) + if err != nil { + return nil, err + } + + return getFileMDFromHeaders(headers), nil +} + +// returns a map of custom metadata values from the specified HTTP header +func getFileMDFromHeaders(header http.Header) map[string]string { + metadata := make(map[string]string) + for k, v := range header { + // Can't trust CanonicalHeaderKey() to munge case + // reliably. "_" is allowed in identifiers: + // https://msdn.microsoft.com/en-us/library/azure/dd179414.aspx + // https://msdn.microsoft.com/library/aa664670(VS.71).aspx + // http://tools.ietf.org/html/rfc7230#section-3.2 + // ...but "_" is considered invalid by + // CanonicalMIMEHeaderKey in + // https://golang.org/src/net/textproto/reader.go?s=14615:14659#L542 + // so k can be "X-Ms-Meta-Foo" or "x-ms-meta-foo_bar". + k = strings.ToLower(k) + if len(v) == 0 || !strings.HasPrefix(k, strings.ToLower(userDefinedMetadataHeaderPrefix)) { + continue + } + // metadata["foo"] = content of the last X-Ms-Meta-Foo header + k = k[len(userDefinedMetadataHeaderPrefix):] + metadata[k] = v[len(v)-1] + } + return metadata } //checkForStorageEmulator determines if the client is setup for use with diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go index 3ecf4aca0d2..0cd3578442e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go @@ -82,6 +82,24 @@ func (p PeekMessagesParameters) getParameters() url.Values { return out } +// UpdateMessageParameters is the set of options can be specified for Update Messsage +// operation. A zero struct does not use any preferences for the request. +type UpdateMessageParameters struct { + PopReceipt string + VisibilityTimeout int +} + +func (p UpdateMessageParameters) getParameters() url.Values { + out := url.Values{} + if p.PopReceipt != "" { + out.Set("popreceipt", p.PopReceipt) + } + if p.VisibilityTimeout != 0 { + out.Set("visibilitytimeout", strconv.Itoa(p.VisibilityTimeout)) + } + return out +} + // GetMessagesResponse represents a response returned from Get Messages // operation. type GetMessagesResponse struct { @@ -304,3 +322,23 @@ func (c QueueServiceClient) DeleteMessage(queue, messageID, popReceipt string) e defer resp.body.Close() return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) } + +// UpdateMessage operation deletes the specified message. +// +// See https://msdn.microsoft.com/en-us/library/azure/hh452234.aspx +func (c QueueServiceClient) UpdateMessage(queue string, messageID string, message string, params UpdateMessageParameters) error { + uri := c.client.getEndpoint(queueServiceName, pathForMessage(queue, messageID), params.getParameters()) + req := putMessageRequest{MessageText: message} + body, nn, err := xmlMarshal(req) + if err != nil { + return err + } + headers := c.client.getStandardHeaders() + headers["Content-Length"] = fmt.Sprintf("%d", nn) + resp, err := c.client.exec("PUT", uri, headers, body) + if err != nil { + return err + } + defer resp.body.Close() + return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/table_entities.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/table_entities.go index c81393e5f50..a26d9c6f581 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/table_entities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/table_entities.go @@ -10,6 +10,8 @@ import ( "reflect" ) +// Annotating as secure for gas scanning +/* #nosec */ const ( partitionKeyNode = "PartitionKey" rowKeyNode = "RowKey" @@ -98,6 +100,10 @@ func (c *TableServiceClient) QueryTableEntities(tableName AzureTable, previousCo resp, err := c.client.execTable("GET", uri, headers, nil) + if err != nil { + return nil, nil, err + } + contToken := extractContinuationTokenFromHeaders(resp.headers) if err != nil { 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 d71c6ce55d8..57ca1b6d937 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 @@ -77,7 +77,7 @@ func headersFromStruct(v interface{}) map[string]string { for i := 0; i < value.NumField(); i++ { key := value.Type().Field(i).Tag.Get("header") val := value.Field(i).String() - if val != "" { + if key != "" && val != "" { headers[key] = val } } diff --git a/vendor/github.com/Azure/go-ansiterm/README.md b/vendor/github.com/Azure/go-ansiterm/README.md index e25e3821016..261c041e7ab 100644 --- a/vendor/github.com/Azure/go-ansiterm/README.md +++ b/vendor/github.com/Azure/go-ansiterm/README.md @@ -7,3 +7,6 @@ For example the parser might receive "ESC, [, A" as a stream of three characters The parser (parser.go) is a partial implementation of this state machine (http://vt100.net/emu/vt500_parser.png). There are also two event handler implementations, one for tests (test_event_handler.go) to validate that the expected events are being produced and called, the other is a Windows implementation (winterm/win_event_handler.go). See parser_test.go for examples exercising the state machine and generating appropriate function calls. + +----- +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/vendor/github.com/Azure/go-ansiterm/constants.go b/vendor/github.com/Azure/go-ansiterm/constants.go index ebfce8a8d38..96504a33bc9 100644 --- a/vendor/github.com/Azure/go-ansiterm/constants.go +++ b/vendor/github.com/Azure/go-ansiterm/constants.go @@ -124,32 +124,32 @@ func getByteRange(start byte, end byte) []byte { return bytes } -var ToGroundBytes = getToGroundBytes() -var Executors = getExecuteBytes() +var toGroundBytes = getToGroundBytes() +var executors = getExecuteBytes() // SPACE 20+A0 hex Always and everywhere a blank space // Intermediate 20-2F hex !"#$%&'()*+,-./ -var Intermeds = getByteRange(0x20, 0x2F) +var intermeds = getByteRange(0x20, 0x2F) // Parameters 30-3F hex 0123456789:;<=>? // CSI Parameters 30-39, 3B hex 0123456789; -var CsiParams = getByteRange(0x30, 0x3F) +var csiParams = getByteRange(0x30, 0x3F) -var CsiCollectables = append(getByteRange(0x30, 0x39), getByteRange(0x3B, 0x3F)...) +var csiCollectables = append(getByteRange(0x30, 0x39), getByteRange(0x3B, 0x3F)...) // Uppercase 40-5F hex @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ -var UpperCase = getByteRange(0x40, 0x5F) +var upperCase = getByteRange(0x40, 0x5F) // Lowercase 60-7E hex `abcdefghijlkmnopqrstuvwxyz{|}~ -var LowerCase = getByteRange(0x60, 0x7E) +var lowerCase = getByteRange(0x60, 0x7E) // Alphabetics 40-7E hex (all of upper and lower case) -var Alphabetics = append(UpperCase, LowerCase...) +var alphabetics = append(upperCase, lowerCase...) -var Printables = getByteRange(0x20, 0x7F) +var printables = getByteRange(0x20, 0x7F) -var EscapeIntermediateToGroundBytes = getByteRange(0x30, 0x7E) -var EscapeToGroundBytes = getEscapeToGroundBytes() +var escapeIntermediateToGroundBytes = getByteRange(0x30, 0x7E) +var escapeToGroundBytes = getEscapeToGroundBytes() // See http://www.vt100.net/emu/vt500_parser.png for description of the complex // byte ranges below diff --git a/vendor/github.com/Azure/go-ansiterm/context.go b/vendor/github.com/Azure/go-ansiterm/context.go index d55cc2aec79..8d66e777c03 100644 --- a/vendor/github.com/Azure/go-ansiterm/context.go +++ b/vendor/github.com/Azure/go-ansiterm/context.go @@ -1,6 +1,6 @@ package ansiterm -type AnsiContext struct { +type ansiContext struct { currentChar byte paramBuffer []byte interBuffer []byte diff --git a/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go b/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go index 9fd4bd28e23..1bd6057da8a 100644 --- a/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go +++ b/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go @@ -1,41 +1,41 @@ package ansiterm -type CsiEntryState struct { - BaseState +type csiEntryState struct { + baseState } -func (csiState CsiEntryState) Handle(b byte) (s State, e error) { +func (csiState csiEntryState) Handle(b byte) (s state, e error) { logger.Infof("CsiEntry::Handle %#x", b) - nextState, err := csiState.BaseState.Handle(b) + nextState, err := csiState.baseState.Handle(b) if nextState != nil || err != nil { return nextState, err } switch { - case sliceContains(Alphabetics, b): - return csiState.parser.Ground, nil - case sliceContains(CsiCollectables, b): - return csiState.parser.CsiParam, nil - case sliceContains(Executors, b): + case sliceContains(alphabetics, b): + return csiState.parser.ground, nil + case sliceContains(csiCollectables, b): + return csiState.parser.csiParam, nil + case sliceContains(executors, b): return csiState, csiState.parser.execute() } return csiState, nil } -func (csiState CsiEntryState) Transition(s State) error { +func (csiState csiEntryState) Transition(s state) error { logger.Infof("CsiEntry::Transition %s --> %s", csiState.Name(), s.Name()) - csiState.BaseState.Transition(s) + csiState.baseState.Transition(s) switch s { - case csiState.parser.Ground: + case csiState.parser.ground: return csiState.parser.csiDispatch() - case csiState.parser.CsiParam: + case csiState.parser.csiParam: switch { - case sliceContains(CsiParams, csiState.parser.context.currentChar): + case sliceContains(csiParams, csiState.parser.context.currentChar): csiState.parser.collectParam() - case sliceContains(Intermeds, csiState.parser.context.currentChar): + case sliceContains(intermeds, csiState.parser.context.currentChar): csiState.parser.collectInter() } } @@ -43,7 +43,7 @@ func (csiState CsiEntryState) Transition(s State) error { return nil } -func (csiState CsiEntryState) Enter() error { +func (csiState csiEntryState) Enter() error { csiState.parser.clear() return nil } diff --git a/vendor/github.com/Azure/go-ansiterm/csi_param_state.go b/vendor/github.com/Azure/go-ansiterm/csi_param_state.go index 27807dd35b9..4be35c5fd2a 100644 --- a/vendor/github.com/Azure/go-ansiterm/csi_param_state.go +++ b/vendor/github.com/Azure/go-ansiterm/csi_param_state.go @@ -1,36 +1,36 @@ package ansiterm -type CsiParamState struct { - BaseState +type csiParamState struct { + baseState } -func (csiState CsiParamState) Handle(b byte) (s State, e error) { +func (csiState csiParamState) Handle(b byte) (s state, e error) { logger.Infof("CsiParam::Handle %#x", b) - nextState, err := csiState.BaseState.Handle(b) + nextState, err := csiState.baseState.Handle(b) if nextState != nil || err != nil { return nextState, err } switch { - case sliceContains(Alphabetics, b): - return csiState.parser.Ground, nil - case sliceContains(CsiCollectables, b): + case sliceContains(alphabetics, b): + return csiState.parser.ground, nil + case sliceContains(csiCollectables, b): csiState.parser.collectParam() return csiState, nil - case sliceContains(Executors, b): + case sliceContains(executors, b): return csiState, csiState.parser.execute() } return csiState, nil } -func (csiState CsiParamState) Transition(s State) error { +func (csiState csiParamState) Transition(s state) error { logger.Infof("CsiParam::Transition %s --> %s", csiState.Name(), s.Name()) - csiState.BaseState.Transition(s) + csiState.baseState.Transition(s) switch s { - case csiState.parser.Ground: + case csiState.parser.ground: return csiState.parser.csiDispatch() } diff --git a/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go b/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go index b14e0ce9773..2189eb6b6b0 100644 --- a/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go +++ b/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go @@ -1,34 +1,34 @@ package ansiterm -type EscapeIntermediateState struct { - BaseState +type escapeIntermediateState struct { + baseState } -func (escState EscapeIntermediateState) Handle(b byte) (s State, e error) { - logger.Infof("EscapeIntermediateState::Handle %#x", b) - nextState, err := escState.BaseState.Handle(b) +func (escState escapeIntermediateState) Handle(b byte) (s state, e error) { + logger.Infof("escapeIntermediateState::Handle %#x", b) + nextState, err := escState.baseState.Handle(b) if nextState != nil || err != nil { return nextState, err } switch { - case sliceContains(Intermeds, b): + case sliceContains(intermeds, b): return escState, escState.parser.collectInter() - case sliceContains(Executors, b): + case sliceContains(executors, b): return escState, escState.parser.execute() - case sliceContains(EscapeIntermediateToGroundBytes, b): - return escState.parser.Ground, nil + case sliceContains(escapeIntermediateToGroundBytes, b): + return escState.parser.ground, nil } return escState, nil } -func (escState EscapeIntermediateState) Transition(s State) error { - logger.Infof("EscapeIntermediateState::Transition %s --> %s", escState.Name(), s.Name()) - escState.BaseState.Transition(s) +func (escState escapeIntermediateState) Transition(s state) error { + logger.Infof("escapeIntermediateState::Transition %s --> %s", escState.Name(), s.Name()) + escState.baseState.Transition(s) switch s { - case escState.parser.Ground: + case escState.parser.ground: return escState.parser.escDispatch() } diff --git a/vendor/github.com/Azure/go-ansiterm/escape_state.go b/vendor/github.com/Azure/go-ansiterm/escape_state.go index 232dd8e0d17..7b1b9ad3f12 100644 --- a/vendor/github.com/Azure/go-ansiterm/escape_state.go +++ b/vendor/github.com/Azure/go-ansiterm/escape_state.go @@ -1,47 +1,47 @@ package ansiterm -type EscapeState struct { - BaseState +type escapeState struct { + baseState } -func (escState EscapeState) Handle(b byte) (s State, e error) { - logger.Infof("EscapeState::Handle %#x", b) - nextState, err := escState.BaseState.Handle(b) +func (escState escapeState) Handle(b byte) (s state, e error) { + logger.Infof("escapeState::Handle %#x", b) + nextState, err := escState.baseState.Handle(b) if nextState != nil || err != nil { return nextState, err } switch { case b == ANSI_ESCAPE_SECONDARY: - return escState.parser.CsiEntry, nil + return escState.parser.csiEntry, nil case b == ANSI_OSC_STRING_ENTRY: - return escState.parser.OscString, nil - case sliceContains(Executors, b): + return escState.parser.oscString, nil + case sliceContains(executors, b): return escState, escState.parser.execute() - case sliceContains(EscapeToGroundBytes, b): - return escState.parser.Ground, nil - case sliceContains(Intermeds, b): - return escState.parser.EscapeIntermediate, nil + case sliceContains(escapeToGroundBytes, b): + return escState.parser.ground, nil + case sliceContains(intermeds, b): + return escState.parser.escapeIntermediate, nil } return escState, nil } -func (escState EscapeState) Transition(s State) error { +func (escState escapeState) Transition(s state) error { logger.Infof("Escape::Transition %s --> %s", escState.Name(), s.Name()) - escState.BaseState.Transition(s) + escState.baseState.Transition(s) switch s { - case escState.parser.Ground: + case escState.parser.ground: return escState.parser.escDispatch() - case escState.parser.EscapeIntermediate: + case escState.parser.escapeIntermediate: return escState.parser.collectInter() } return nil } -func (escState EscapeState) Enter() error { +func (escState escapeState) Enter() error { escState.parser.clear() return nil } diff --git a/vendor/github.com/Azure/go-ansiterm/ground_state.go b/vendor/github.com/Azure/go-ansiterm/ground_state.go index d600e3e4ae6..52451e94693 100644 --- a/vendor/github.com/Azure/go-ansiterm/ground_state.go +++ b/vendor/github.com/Azure/go-ansiterm/ground_state.go @@ -1,22 +1,22 @@ package ansiterm -type GroundState struct { - BaseState +type groundState struct { + baseState } -func (gs GroundState) Handle(b byte) (s State, e error) { +func (gs groundState) Handle(b byte) (s state, e error) { gs.parser.context.currentChar = b - nextState, err := gs.BaseState.Handle(b) + nextState, err := gs.baseState.Handle(b) if nextState != nil || err != nil { return nextState, err } switch { - case sliceContains(Printables, b): + case sliceContains(printables, b): return gs, gs.parser.print() - case sliceContains(Executors, b): + case sliceContains(executors, b): return gs, gs.parser.execute() } diff --git a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go index 4490e3cdf6b..24062d420eb 100644 --- a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go +++ b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go @@ -1,19 +1,19 @@ package ansiterm -type OscStringState struct { - BaseState +type oscStringState struct { + baseState } -func (oscState OscStringState) Handle(b byte) (s State, e error) { +func (oscState oscStringState) Handle(b byte) (s state, e error) { logger.Infof("OscString::Handle %#x", b) - nextState, err := oscState.BaseState.Handle(b) + nextState, err := oscState.baseState.Handle(b) if nextState != nil || err != nil { return nextState, err } switch { case isOscStringTerminator(b): - return oscState.parser.Ground, nil + return oscState.parser.ground, nil } return oscState, nil diff --git a/vendor/github.com/Azure/go-ansiterm/parser.go b/vendor/github.com/Azure/go-ansiterm/parser.go index ef5e0ad1998..169f68dbefc 100644 --- a/vendor/github.com/Azure/go-ansiterm/parser.go +++ b/vendor/github.com/Azure/go-ansiterm/parser.go @@ -2,7 +2,6 @@ package ansiterm import ( "errors" - "fmt" "io/ioutil" "os" @@ -12,18 +11,18 @@ import ( var logger *logrus.Logger type AnsiParser struct { - currState State + currState state eventHandler AnsiEventHandler - context *AnsiContext - CsiEntry State - CsiParam State - DcsEntry State - Escape State - EscapeIntermediate State - Error State - Ground State - OscString State - stateMap []State + context *ansiContext + csiEntry state + csiParam state + dcsEntry state + escape state + escapeIntermediate state + error state + ground state + oscString state + stateMap []state } func CreateParser(initialState string, evtHandler AnsiEventHandler) *AnsiParser { @@ -41,27 +40,27 @@ func CreateParser(initialState string, evtHandler AnsiEventHandler) *AnsiParser parser := &AnsiParser{ eventHandler: evtHandler, - context: &AnsiContext{}, + context: &ansiContext{}, } - parser.CsiEntry = CsiEntryState{BaseState{name: "CsiEntry", parser: parser}} - parser.CsiParam = CsiParamState{BaseState{name: "CsiParam", parser: parser}} - parser.DcsEntry = DcsEntryState{BaseState{name: "DcsEntry", parser: parser}} - parser.Escape = EscapeState{BaseState{name: "Escape", parser: parser}} - parser.EscapeIntermediate = EscapeIntermediateState{BaseState{name: "EscapeIntermediate", parser: parser}} - parser.Error = ErrorState{BaseState{name: "Error", parser: parser}} - parser.Ground = GroundState{BaseState{name: "Ground", parser: parser}} - parser.OscString = OscStringState{BaseState{name: "OscString", parser: parser}} + parser.csiEntry = csiEntryState{baseState{name: "CsiEntry", parser: parser}} + parser.csiParam = csiParamState{baseState{name: "CsiParam", parser: parser}} + parser.dcsEntry = dcsEntryState{baseState{name: "DcsEntry", parser: parser}} + parser.escape = escapeState{baseState{name: "Escape", parser: parser}} + parser.escapeIntermediate = escapeIntermediateState{baseState{name: "EscapeIntermediate", parser: parser}} + parser.error = errorState{baseState{name: "Error", parser: parser}} + parser.ground = groundState{baseState{name: "Ground", parser: parser}} + parser.oscString = oscStringState{baseState{name: "OscString", parser: parser}} - parser.stateMap = []State{ - parser.CsiEntry, - parser.CsiParam, - parser.DcsEntry, - parser.Escape, - parser.EscapeIntermediate, - parser.Error, - parser.Ground, - parser.OscString, + parser.stateMap = []state{ + parser.csiEntry, + parser.csiParam, + parser.dcsEntry, + parser.escape, + parser.escapeIntermediate, + parser.error, + parser.ground, + parser.oscString, } parser.currState = getState(initialState, parser.stateMap) @@ -70,7 +69,7 @@ func CreateParser(initialState string, evtHandler AnsiEventHandler) *AnsiParser return parser } -func getState(name string, states []State) State { +func getState(name string, states []state) state { for _, el := range states { if el.Name() == name { return el @@ -99,7 +98,7 @@ func (ap *AnsiParser) handle(b byte) error { if newState == nil { logger.Warning("newState is nil") - return errors.New(fmt.Sprintf("New state of 'nil' is invalid.")) + return errors.New("New state of 'nil' is invalid.") } if newState != ap.currState { @@ -111,7 +110,7 @@ func (ap *AnsiParser) handle(b byte) error { return nil } -func (ap *AnsiParser) changeState(newState State) error { +func (ap *AnsiParser) changeState(newState state) error { logger.Infof("ChangeState %s --> %s", ap.currState.Name(), newState.Name()) // Exit old state diff --git a/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go b/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go index 438802097dd..8b69a67a5aa 100644 --- a/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go +++ b/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go @@ -31,7 +31,7 @@ func parseParams(bytes []byte) ([]string, error) { return params, nil } -func parseCmd(context AnsiContext) (string, error) { +func parseCmd(context ansiContext) (string, error) { return string(context.currentChar), nil } diff --git a/vendor/github.com/Azure/go-ansiterm/parser_actions.go b/vendor/github.com/Azure/go-ansiterm/parser_actions.go index 260e6aae3c5..58750a2d2b1 100644 --- a/vendor/github.com/Azure/go-ansiterm/parser_actions.go +++ b/vendor/github.com/Azure/go-ansiterm/parser_actions.go @@ -113,7 +113,7 @@ func (ap *AnsiParser) print() error { } func (ap *AnsiParser) clear() error { - ap.context = &AnsiContext{} + ap.context = &ansiContext{} return nil } diff --git a/vendor/github.com/Azure/go-ansiterm/parser_test_helpers.go b/vendor/github.com/Azure/go-ansiterm/parser_test_helpers.go deleted file mode 100644 index 562f215d342..00000000000 --- a/vendor/github.com/Azure/go-ansiterm/parser_test_helpers.go +++ /dev/null @@ -1,114 +0,0 @@ -package ansiterm - -import ( - "fmt" - "testing" -) - -func getStateNames() []string { - parser, _ := createTestParser("Ground") - - stateNames := []string{} - for _, state := range parser.stateMap { - stateNames = append(stateNames, state.Name()) - } - - return stateNames -} - -func stateTransitionHelper(t *testing.T, start string, end string, bytes []byte) { - for _, b := range bytes { - bytes := []byte{byte(b)} - parser, _ := createTestParser(start) - parser.Parse(bytes) - validateState(t, parser.currState, end) - } -} - -func anyToXHelper(t *testing.T, bytes []byte, expectedState string) { - for _, s := range getStateNames() { - stateTransitionHelper(t, s, expectedState, bytes) - } -} - -func funcCallParamHelper(t *testing.T, bytes []byte, start string, expected string, expectedCalls []string) { - parser, evtHandler := createTestParser(start) - parser.Parse(bytes) - validateState(t, parser.currState, expected) - validateFuncCalls(t, evtHandler.FunctionCalls, expectedCalls) -} - -func parseParamsHelper(t *testing.T, bytes []byte, expectedParams []string) { - params, err := parseParams(bytes) - - if err != nil { - t.Errorf("Parameter parse error: %v", err) - return - } - - if len(params) != len(expectedParams) { - t.Errorf("Parsed parameters: %v", params) - t.Errorf("Expected parameters: %v", expectedParams) - t.Errorf("Parameter length failure: %d != %d", len(params), len(expectedParams)) - return - } - - for i, v := range expectedParams { - if v != params[i] { - t.Errorf("Parsed parameters: %v", params) - t.Errorf("Expected parameters: %v", expectedParams) - t.Errorf("Parameter parse failure: %s != %s at position %d", v, params[i], i) - } - } -} - -func cursorSingleParamHelper(t *testing.T, command byte, funcName string) { - funcCallParamHelper(t, []byte{command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1])", funcName)}) - funcCallParamHelper(t, []byte{'0', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1])", funcName)}) - funcCallParamHelper(t, []byte{'2', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([2])", funcName)}) - funcCallParamHelper(t, []byte{'2', '3', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([23])", funcName)}) - funcCallParamHelper(t, []byte{'2', ';', '3', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([2])", funcName)}) - funcCallParamHelper(t, []byte{'2', ';', '3', ';', '4', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([2])", funcName)}) -} - -func cursorTwoParamHelper(t *testing.T, command byte, funcName string) { - funcCallParamHelper(t, []byte{command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1 1])", funcName)}) - funcCallParamHelper(t, []byte{'0', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1 1])", funcName)}) - funcCallParamHelper(t, []byte{'2', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([2 1])", funcName)}) - funcCallParamHelper(t, []byte{'2', '3', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([23 1])", funcName)}) - funcCallParamHelper(t, []byte{'2', ';', '3', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([2 3])", funcName)}) - funcCallParamHelper(t, []byte{'2', ';', '3', ';', '4', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([2 3])", funcName)}) -} - -func eraseHelper(t *testing.T, command byte, funcName string) { - funcCallParamHelper(t, []byte{command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([0])", funcName)}) - funcCallParamHelper(t, []byte{'0', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([0])", funcName)}) - funcCallParamHelper(t, []byte{'1', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1])", funcName)}) - funcCallParamHelper(t, []byte{'2', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([2])", funcName)}) - funcCallParamHelper(t, []byte{'3', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([3])", funcName)}) - funcCallParamHelper(t, []byte{'4', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([0])", funcName)}) - funcCallParamHelper(t, []byte{'1', ';', '2', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1])", funcName)}) -} - -func scrollHelper(t *testing.T, command byte, funcName string) { - funcCallParamHelper(t, []byte{command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1])", funcName)}) - funcCallParamHelper(t, []byte{'0', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1])", funcName)}) - funcCallParamHelper(t, []byte{'1', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([1])", funcName)}) - funcCallParamHelper(t, []byte{'5', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([5])", funcName)}) - funcCallParamHelper(t, []byte{'4', ';', '6', command}, "CsiEntry", "Ground", []string{fmt.Sprintf("%s([4])", funcName)}) -} - -func clearOnStateChangeHelper(t *testing.T, start string, end string, bytes []byte) { - p, _ := createTestParser(start) - fillContext(p.context) - p.Parse(bytes) - validateState(t, p.currState, end) - validateEmptyContext(t, p.context) -} - -func c0Helper(t *testing.T, bytes []byte, expectedState string, expectedCalls []string) { - parser, evtHandler := createTestParser("Ground") - parser.Parse(bytes) - validateState(t, parser.currState, expectedState) - validateFuncCalls(t, evtHandler.FunctionCalls, expectedCalls) -} diff --git a/vendor/github.com/Azure/go-ansiterm/parser_test_utilities.go b/vendor/github.com/Azure/go-ansiterm/parser_test_utilities.go deleted file mode 100644 index 51d1d49bf03..00000000000 --- a/vendor/github.com/Azure/go-ansiterm/parser_test_utilities.go +++ /dev/null @@ -1,66 +0,0 @@ -package ansiterm - -import ( - "testing" -) - -func createTestParser(s string) (*AnsiParser, *TestAnsiEventHandler) { - evtHandler := CreateTestAnsiEventHandler() - parser := CreateParser(s, evtHandler) - - return parser, evtHandler -} - -func validateState(t *testing.T, actualState State, expectedStateName string) { - actualName := "Nil" - - if actualState != nil { - actualName = actualState.Name() - } - - if actualName != expectedStateName { - t.Errorf("Invalid State: '%s' != '%s'", actualName, expectedStateName) - } -} - -func validateFuncCalls(t *testing.T, actualCalls []string, expectedCalls []string) { - actualCount := len(actualCalls) - expectedCount := len(expectedCalls) - - if actualCount != expectedCount { - t.Errorf("Actual calls: %v", actualCalls) - t.Errorf("Expected calls: %v", expectedCalls) - t.Errorf("Call count error: %d != %d", actualCount, expectedCount) - return - } - - for i, v := range actualCalls { - if v != expectedCalls[i] { - t.Errorf("Actual calls: %v", actualCalls) - t.Errorf("Expected calls: %v", expectedCalls) - t.Errorf("Mismatched calls: %s != %s with lengths %d and %d", v, expectedCalls[i], len(v), len(expectedCalls[i])) - } - } -} - -func fillContext(context *AnsiContext) { - context.currentChar = 'A' - context.paramBuffer = []byte{'C', 'D', 'E'} - context.interBuffer = []byte{'F', 'G', 'H'} -} - -func validateEmptyContext(t *testing.T, context *AnsiContext) { - var expectedCurrChar byte = 0x0 - if context.currentChar != expectedCurrChar { - t.Errorf("Currentchar mismatch '%#x' != '%#x'", context.currentChar, expectedCurrChar) - } - - if len(context.paramBuffer) != 0 { - t.Errorf("Non-empty parameter buffer: %v", context.paramBuffer) - } - - if len(context.paramBuffer) != 0 { - t.Errorf("Non-empty intermediate buffer: %v", context.interBuffer) - } - -} diff --git a/vendor/github.com/Azure/go-ansiterm/states.go b/vendor/github.com/Azure/go-ansiterm/states.go index 0cbdcb3c834..f2ea1fcd12d 100644 --- a/vendor/github.com/Azure/go-ansiterm/states.go +++ b/vendor/github.com/Azure/go-ansiterm/states.go @@ -1,52 +1,52 @@ package ansiterm -type StateId int +type stateID int -type State interface { +type state interface { Enter() error Exit() error - Handle(byte) (State, error) + Handle(byte) (state, error) Name() string - Transition(State) error + Transition(state) error } -type BaseState struct { +type baseState struct { name string parser *AnsiParser } -func (base BaseState) Enter() error { +func (base baseState) Enter() error { return nil } -func (base BaseState) Exit() error { +func (base baseState) Exit() error { return nil } -func (base BaseState) Handle(b byte) (s State, e error) { +func (base baseState) Handle(b byte) (s state, e error) { switch { case b == CSI_ENTRY: - return base.parser.CsiEntry, nil + return base.parser.csiEntry, nil case b == DCS_ENTRY: - return base.parser.DcsEntry, nil + return base.parser.dcsEntry, nil case b == ANSI_ESCAPE_PRIMARY: - return base.parser.Escape, nil + return base.parser.escape, nil case b == OSC_STRING: - return base.parser.OscString, nil - case sliceContains(ToGroundBytes, b): - return base.parser.Ground, nil + return base.parser.oscString, nil + case sliceContains(toGroundBytes, b): + return base.parser.ground, nil } return nil, nil } -func (base BaseState) Name() string { +func (base baseState) Name() string { return base.name } -func (base BaseState) Transition(s State) error { - if s == base.parser.Ground { +func (base baseState) Transition(s state) error { + if s == base.parser.ground { execBytes := []byte{0x18} execBytes = append(execBytes, 0x1A) execBytes = append(execBytes, getByteRange(0x80, 0x8F)...) @@ -62,10 +62,10 @@ func (base BaseState) Transition(s State) error { return nil } -type DcsEntryState struct { - BaseState +type dcsEntryState struct { + baseState } -type ErrorState struct { - BaseState +type errorState struct { + baseState } diff --git a/vendor/github.com/Azure/go-ansiterm/test_event_handler.go b/vendor/github.com/Azure/go-ansiterm/test_event_handler.go deleted file mode 100644 index 60f9f30b98d..00000000000 --- a/vendor/github.com/Azure/go-ansiterm/test_event_handler.go +++ /dev/null @@ -1,173 +0,0 @@ -package ansiterm - -import ( - "fmt" - "strconv" -) - -type TestAnsiEventHandler struct { - FunctionCalls []string -} - -func CreateTestAnsiEventHandler() *TestAnsiEventHandler { - evtHandler := TestAnsiEventHandler{} - evtHandler.FunctionCalls = make([]string, 0) - return &evtHandler -} - -func (h *TestAnsiEventHandler) recordCall(call string, params []string) { - s := fmt.Sprintf("%s(%v)", call, params) - h.FunctionCalls = append(h.FunctionCalls, s) -} - -func (h *TestAnsiEventHandler) Print(b byte) error { - h.recordCall("Print", []string{string(b)}) - return nil -} - -func (h *TestAnsiEventHandler) Execute(b byte) error { - h.recordCall("Execute", []string{string(b)}) - return nil -} - -func (h *TestAnsiEventHandler) CUU(param int) error { - h.recordCall("CUU", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) CUD(param int) error { - h.recordCall("CUD", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) CUF(param int) error { - h.recordCall("CUF", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) CUB(param int) error { - h.recordCall("CUB", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) CNL(param int) error { - h.recordCall("CNL", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) CPL(param int) error { - h.recordCall("CPL", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) CHA(param int) error { - h.recordCall("CHA", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) VPA(param int) error { - h.recordCall("VPA", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) CUP(x int, y int) error { - xS, yS := strconv.Itoa(x), strconv.Itoa(y) - h.recordCall("CUP", []string{xS, yS}) - return nil -} - -func (h *TestAnsiEventHandler) HVP(x int, y int) error { - xS, yS := strconv.Itoa(x), strconv.Itoa(y) - h.recordCall("HVP", []string{xS, yS}) - return nil -} - -func (h *TestAnsiEventHandler) DECTCEM(visible bool) error { - h.recordCall("DECTCEM", []string{strconv.FormatBool(visible)}) - return nil -} - -func (h *TestAnsiEventHandler) DECOM(visible bool) error { - h.recordCall("DECOM", []string{strconv.FormatBool(visible)}) - return nil -} - -func (h *TestAnsiEventHandler) DECCOLM(use132 bool) error { - h.recordCall("DECOLM", []string{strconv.FormatBool(use132)}) - return nil -} - -func (h *TestAnsiEventHandler) ED(param int) error { - h.recordCall("ED", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) EL(param int) error { - h.recordCall("EL", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) IL(param int) error { - h.recordCall("IL", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) DL(param int) error { - h.recordCall("DL", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) ICH(param int) error { - h.recordCall("ICH", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) DCH(param int) error { - h.recordCall("DCH", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) SGR(params []int) error { - strings := []string{} - for _, v := range params { - strings = append(strings, strconv.Itoa(v)) - } - - h.recordCall("SGR", strings) - return nil -} - -func (h *TestAnsiEventHandler) SU(param int) error { - h.recordCall("SU", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) SD(param int) error { - h.recordCall("SD", []string{strconv.Itoa(param)}) - return nil -} - -func (h *TestAnsiEventHandler) DA(params []string) error { - h.recordCall("DA", params) - return nil -} - -func (h *TestAnsiEventHandler) DECSTBM(top int, bottom int) error { - topS, bottomS := strconv.Itoa(top), strconv.Itoa(bottom) - h.recordCall("DECSTBM", []string{topS, bottomS}) - return nil -} - -func (h *TestAnsiEventHandler) RI() error { - h.recordCall("RI", nil) - return nil -} - -func (h *TestAnsiEventHandler) IND() error { - h.recordCall("IND", nil) - return nil -} - -func (h *TestAnsiEventHandler) Flush() error { - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go b/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go index 78fe92fe65f..daf2f069615 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go @@ -9,7 +9,7 @@ import ( "strings" "syscall" - . "github.com/Azure/go-ansiterm" + "github.com/Azure/go-ansiterm" ) // Windows keyboard constants @@ -85,17 +85,17 @@ func newAnsiCommand(command []byte) *ansiCommand { if lastCharIndex != 0 { start := 1 // skip if double char escape sequence - if command[0] == ANSI_ESCAPE_PRIMARY && command[1] == ANSI_ESCAPE_SECONDARY { + if command[0] == ansiterm.ANSI_ESCAPE_PRIMARY && command[1] == ansiterm.ANSI_ESCAPE_SECONDARY { start++ } // convert this to GetNextParam method - ac.Parameters = strings.Split(string(command[start:lastCharIndex]), ANSI_PARAMETER_SEP) + ac.Parameters = strings.Split(string(command[start:lastCharIndex]), ansiterm.ANSI_PARAMETER_SEP) } return ac } -func (ac *ansiCommand) paramAsSHORT(index int, defaultValue SHORT) SHORT { +func (ac *ansiCommand) paramAsSHORT(index int, defaultValue int16) int16 { if index < 0 || index >= len(ac.Parameters) { return defaultValue } @@ -105,7 +105,7 @@ func (ac *ansiCommand) paramAsSHORT(index int, defaultValue SHORT) SHORT { return defaultValue } - return SHORT(param) + return int16(param) } func (ac *ansiCommand) String() string { @@ -119,12 +119,12 @@ func (ac *ansiCommand) String() string { // See http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html. func isAnsiCommandChar(b byte) bool { switch { - case ANSI_COMMAND_FIRST <= b && b <= ANSI_COMMAND_LAST && b != ANSI_ESCAPE_SECONDARY: + case ansiterm.ANSI_COMMAND_FIRST <= b && b <= ansiterm.ANSI_COMMAND_LAST && b != ansiterm.ANSI_ESCAPE_SECONDARY: return true - case b == ANSI_CMD_G1 || b == ANSI_CMD_OSC || b == ANSI_CMD_DECPAM || b == ANSI_CMD_DECPNM: + case b == ansiterm.ANSI_CMD_G1 || b == ansiterm.ANSI_CMD_OSC || b == ansiterm.ANSI_CMD_DECPAM || b == ansiterm.ANSI_CMD_DECPNM: // non-CSI escape sequence terminator return true - case b == ANSI_CMD_STR_TERM || b == ANSI_BEL: + case b == ansiterm.ANSI_CMD_STR_TERM || b == ansiterm.ANSI_BEL: // String escape sequence terminator return true } @@ -132,11 +132,11 @@ func isAnsiCommandChar(b byte) bool { } func isXtermOscSequence(command []byte, current byte) bool { - return (len(command) >= 2 && command[0] == ANSI_ESCAPE_PRIMARY && command[1] == ANSI_CMD_OSC && current != ANSI_BEL) + return (len(command) >= 2 && command[0] == ansiterm.ANSI_ESCAPE_PRIMARY && command[1] == ansiterm.ANSI_CMD_OSC && current != ansiterm.ANSI_BEL) } func isCharacterSelectionCmdChar(b byte) bool { - return (b == ANSI_CMD_G0 || b == ANSI_CMD_G1 || b == ANSI_CMD_G2 || b == ANSI_CMD_G3) + return (b == ansiterm.ANSI_CMD_G0 || b == ansiterm.ANSI_CMD_G1 || b == ansiterm.ANSI_CMD_G2 || b == ansiterm.ANSI_CMD_G3) } // bytesToHex converts a slice of bytes to a human-readable string. @@ -150,7 +150,7 @@ func bytesToHex(b []byte) string { // ensureInRange adjusts the passed value, if necessary, to ensure it is within // the passed min / max range. -func ensureInRange(n SHORT, min SHORT, max SHORT) SHORT { +func ensureInRange(n int16, min int16, max int16) int16 { if n < min { return min } else if n > max { diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/api.go b/vendor/github.com/Azure/go-ansiterm/winterm/api.go index 1f2f3853cc4..462d92f8ef9 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/api.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/api.go @@ -66,21 +66,21 @@ const ( // -- The attributes are combined to produce various colors (e.g., Blue + Green will create Cyan). // Clearing all foreground or background colors results in black; setting all creates white. // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682088(v=vs.85).aspx#_win32_character_attributes. - FOREGROUND_BLUE WORD = 0x0001 - FOREGROUND_GREEN WORD = 0x0002 - FOREGROUND_RED WORD = 0x0004 - FOREGROUND_INTENSITY WORD = 0x0008 - FOREGROUND_MASK WORD = 0x000F + FOREGROUND_BLUE uint16 = 0x0001 + FOREGROUND_GREEN uint16 = 0x0002 + FOREGROUND_RED uint16 = 0x0004 + FOREGROUND_INTENSITY uint16 = 0x0008 + FOREGROUND_MASK uint16 = 0x000F - BACKGROUND_BLUE WORD = 0x0010 - BACKGROUND_GREEN WORD = 0x0020 - BACKGROUND_RED WORD = 0x0040 - BACKGROUND_INTENSITY WORD = 0x0080 - BACKGROUND_MASK WORD = 0x00F0 + BACKGROUND_BLUE uint16 = 0x0010 + BACKGROUND_GREEN uint16 = 0x0020 + BACKGROUND_RED uint16 = 0x0040 + BACKGROUND_INTENSITY uint16 = 0x0080 + BACKGROUND_MASK uint16 = 0x00F0 - COMMON_LVB_MASK WORD = 0xFF00 - COMMON_LVB_REVERSE_VIDEO WORD = 0x4000 - COMMON_LVB_UNDERSCORE WORD = 0x8000 + COMMON_LVB_MASK uint16 = 0xFF00 + COMMON_LVB_REVERSE_VIDEO uint16 = 0x4000 + COMMON_LVB_UNDERSCORE uint16 = 0x8000 // Input event types // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683499(v=vs.85).aspx. @@ -104,60 +104,53 @@ const ( ) // Windows API Console types -// -- See https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx for core types (e.g., SHORT) // -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682101(v=vs.85).aspx for Console specific types (e.g., COORD) // -- See https://msdn.microsoft.com/en-us/library/aa296569(v=vs.60).aspx for comments on alignment type ( - SHORT int16 - BOOL int32 - WORD uint16 - WCHAR uint16 - DWORD uint32 - CHAR_INFO struct { - UnicodeChar WCHAR - Attributes WORD + UnicodeChar uint16 + Attributes uint16 } CONSOLE_CURSOR_INFO struct { - Size DWORD - Visible BOOL + Size uint32 + Visible int32 } CONSOLE_SCREEN_BUFFER_INFO struct { Size COORD CursorPosition COORD - Attributes WORD + Attributes uint16 Window SMALL_RECT MaximumWindowSize COORD } COORD struct { - X SHORT - Y SHORT + X int16 + Y int16 } SMALL_RECT struct { - Left SHORT - Top SHORT - Right SHORT - Bottom SHORT + Left int16 + Top int16 + Right int16 + Bottom int16 } // INPUT_RECORD is a C/C++ union of which KEY_EVENT_RECORD is one case, it is also the largest // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683499(v=vs.85).aspx. INPUT_RECORD struct { - EventType WORD + EventType uint16 KeyEvent KEY_EVENT_RECORD } KEY_EVENT_RECORD struct { - KeyDown BOOL - RepeatCount WORD - VirtualKeyCode WORD - VirtualScanCode WORD - UnicodeChar WCHAR - ControlKeyState DWORD + KeyDown int32 + RepeatCount uint16 + VirtualKeyCode uint16 + VirtualScanCode uint16 + UnicodeChar uint16 + ControlKeyState uint32 } WINDOW_BUFFER_SIZE struct { @@ -165,12 +158,12 @@ type ( } ) -// boolToBOOL converts a Go bool into a Windows BOOL. -func boolToBOOL(f bool) BOOL { +// boolToBOOL converts a Go bool into a Windows int32. +func boolToBOOL(f bool) int32 { if f { - return BOOL(1) + return int32(1) } else { - return BOOL(0) + return int32(0) } } @@ -242,7 +235,7 @@ func SetConsoleScreenBufferSize(handle uintptr, coord COORD) error { // SetConsoleTextAttribute sets the attributes of characters written to the // console screen buffer by the WriteFile or WriteConsole function. // See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686047(v=vs.85).aspx. -func SetConsoleTextAttribute(handle uintptr, attribute WORD) error { +func SetConsoleTextAttribute(handle uintptr, attribute uint16) error { r1, r2, err := setConsoleTextAttributeProc.Call(handle, uintptr(attribute), 0) use(attribute) return checkError(r1, r2, err) @@ -280,7 +273,7 @@ func ReadConsoleInput(handle uintptr, buffer []INPUT_RECORD, count *uint32) erro // It returns true if the handle was signaled; false otherwise. // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx. func WaitForSingleObject(handle uintptr, msWait uint32) (bool, error) { - r1, _, err := waitForSingleObjectProc.Call(handle, uintptr(DWORD(msWait))) + r1, _, err := waitForSingleObjectProc.Call(handle, uintptr(uint32(msWait))) switch r1 { case WAIT_ABANDONED, WAIT_TIMEOUT: return false, nil @@ -320,8 +313,8 @@ func checkError(r1, r2 uintptr, err error) error { // coordToPointer converts a COORD into a uintptr (by fooling the type system). func coordToPointer(c COORD) uintptr { - // Note: This code assumes the two SHORTs are correctly laid out; the "cast" to DWORD is just to get a pointer to pass. - return uintptr(*((*DWORD)(unsafe.Pointer(&c)))) + // Note: This code assumes the two SHORTs are correctly laid out; the "cast" to uint32 is just to get a pointer to pass. + return uintptr(*((*uint32)(unsafe.Pointer(&c)))) } // use is a no-op, but the compiler cannot see that it is. diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go b/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go index 94665db6fb0..cbec8f728f4 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go @@ -2,9 +2,7 @@ package winterm -import ( - . "github.com/Azure/go-ansiterm" -) +import "github.com/Azure/go-ansiterm" const ( FOREGROUND_COLOR_MASK = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE @@ -13,83 +11,83 @@ const ( // collectAnsiIntoWindowsAttributes modifies the passed Windows text mode flags to reflect the // request represented by the passed ANSI mode. -func collectAnsiIntoWindowsAttributes(windowsMode WORD, inverted bool, baseMode WORD, ansiMode SHORT) (WORD, bool) { +func collectAnsiIntoWindowsAttributes(windowsMode uint16, inverted bool, baseMode uint16, ansiMode int16) (uint16, bool) { switch ansiMode { // Mode styles - case ANSI_SGR_BOLD: + case ansiterm.ANSI_SGR_BOLD: windowsMode = windowsMode | FOREGROUND_INTENSITY - case ANSI_SGR_DIM, ANSI_SGR_BOLD_DIM_OFF: + case ansiterm.ANSI_SGR_DIM, ansiterm.ANSI_SGR_BOLD_DIM_OFF: windowsMode &^= FOREGROUND_INTENSITY - case ANSI_SGR_UNDERLINE: + case ansiterm.ANSI_SGR_UNDERLINE: windowsMode = windowsMode | COMMON_LVB_UNDERSCORE - case ANSI_SGR_REVERSE: + case ansiterm.ANSI_SGR_REVERSE: inverted = true - case ANSI_SGR_REVERSE_OFF: + case ansiterm.ANSI_SGR_REVERSE_OFF: inverted = false - case ANSI_SGR_UNDERLINE_OFF: + case ansiterm.ANSI_SGR_UNDERLINE_OFF: windowsMode &^= COMMON_LVB_UNDERSCORE // Foreground colors - case ANSI_SGR_FOREGROUND_DEFAULT: + case ansiterm.ANSI_SGR_FOREGROUND_DEFAULT: windowsMode = (windowsMode &^ FOREGROUND_MASK) | (baseMode & FOREGROUND_MASK) - case ANSI_SGR_FOREGROUND_BLACK: + case ansiterm.ANSI_SGR_FOREGROUND_BLACK: windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) - case ANSI_SGR_FOREGROUND_RED: + case ansiterm.ANSI_SGR_FOREGROUND_RED: windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED - case ANSI_SGR_FOREGROUND_GREEN: + case ansiterm.ANSI_SGR_FOREGROUND_GREEN: windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_GREEN - case ANSI_SGR_FOREGROUND_YELLOW: + case ansiterm.ANSI_SGR_FOREGROUND_YELLOW: windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_GREEN - case ANSI_SGR_FOREGROUND_BLUE: + case ansiterm.ANSI_SGR_FOREGROUND_BLUE: windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_BLUE - case ANSI_SGR_FOREGROUND_MAGENTA: + case ansiterm.ANSI_SGR_FOREGROUND_MAGENTA: windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_BLUE - case ANSI_SGR_FOREGROUND_CYAN: + case ansiterm.ANSI_SGR_FOREGROUND_CYAN: windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_GREEN | FOREGROUND_BLUE - case ANSI_SGR_FOREGROUND_WHITE: + case ansiterm.ANSI_SGR_FOREGROUND_WHITE: windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE // Background colors - case ANSI_SGR_BACKGROUND_DEFAULT: + case ansiterm.ANSI_SGR_BACKGROUND_DEFAULT: // Black with no intensity windowsMode = (windowsMode &^ BACKGROUND_MASK) | (baseMode & BACKGROUND_MASK) - case ANSI_SGR_BACKGROUND_BLACK: + case ansiterm.ANSI_SGR_BACKGROUND_BLACK: windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) - case ANSI_SGR_BACKGROUND_RED: + case ansiterm.ANSI_SGR_BACKGROUND_RED: windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED - case ANSI_SGR_BACKGROUND_GREEN: + case ansiterm.ANSI_SGR_BACKGROUND_GREEN: windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_GREEN - case ANSI_SGR_BACKGROUND_YELLOW: + case ansiterm.ANSI_SGR_BACKGROUND_YELLOW: windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_GREEN - case ANSI_SGR_BACKGROUND_BLUE: + case ansiterm.ANSI_SGR_BACKGROUND_BLUE: windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_BLUE - case ANSI_SGR_BACKGROUND_MAGENTA: + case ansiterm.ANSI_SGR_BACKGROUND_MAGENTA: windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_BLUE - case ANSI_SGR_BACKGROUND_CYAN: + case ansiterm.ANSI_SGR_BACKGROUND_CYAN: windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_GREEN | BACKGROUND_BLUE - case ANSI_SGR_BACKGROUND_WHITE: + case ansiterm.ANSI_SGR_BACKGROUND_WHITE: windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE } @@ -97,6 +95,6 @@ func collectAnsiIntoWindowsAttributes(windowsMode WORD, inverted bool, baseMode } // invertAttributes inverts the foreground and background colors of a Windows attributes value -func invertAttributes(windowsMode WORD) WORD { +func invertAttributes(windowsMode uint16) uint16 { return (COMMON_LVB_MASK & windowsMode) | ((FOREGROUND_MASK & windowsMode) << 4) | ((BACKGROUND_MASK & windowsMode) >> 4) } diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go b/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go index e4b1c255a46..f015723ade7 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go @@ -3,11 +3,11 @@ package winterm const ( - Horizontal = iota - Vertical + horizontal = iota + vertical ) -func (h *WindowsAnsiEventHandler) getCursorWindow(info *CONSOLE_SCREEN_BUFFER_INFO) SMALL_RECT { +func (h *windowsAnsiEventHandler) getCursorWindow(info *CONSOLE_SCREEN_BUFFER_INFO) SMALL_RECT { if h.originMode { sr := h.effectiveSr(info.Window) return SMALL_RECT{ @@ -27,7 +27,7 @@ func (h *WindowsAnsiEventHandler) getCursorWindow(info *CONSOLE_SCREEN_BUFFER_IN } // setCursorPosition sets the cursor to the specified position, bounded to the screen size -func (h *WindowsAnsiEventHandler) setCursorPosition(position COORD, window SMALL_RECT) error { +func (h *windowsAnsiEventHandler) setCursorPosition(position COORD, window SMALL_RECT) error { position.X = ensureInRange(position.X, window.Left, window.Right) position.Y = ensureInRange(position.Y, window.Top, window.Bottom) err := SetConsoleCursorPosition(h.fd, position) @@ -38,15 +38,15 @@ func (h *WindowsAnsiEventHandler) setCursorPosition(position COORD, window SMALL return err } -func (h *WindowsAnsiEventHandler) moveCursorVertical(param int) error { - return h.moveCursor(Vertical, param) +func (h *windowsAnsiEventHandler) moveCursorVertical(param int) error { + return h.moveCursor(vertical, param) } -func (h *WindowsAnsiEventHandler) moveCursorHorizontal(param int) error { - return h.moveCursor(Horizontal, param) +func (h *windowsAnsiEventHandler) moveCursorHorizontal(param int) error { + return h.moveCursor(horizontal, param) } -func (h *WindowsAnsiEventHandler) moveCursor(moveMode int, param int) error { +func (h *windowsAnsiEventHandler) moveCursor(moveMode int, param int) error { info, err := GetConsoleScreenBufferInfo(h.fd) if err != nil { return err @@ -54,10 +54,10 @@ func (h *WindowsAnsiEventHandler) moveCursor(moveMode int, param int) error { position := info.CursorPosition switch moveMode { - case Horizontal: - position.X += SHORT(param) - case Vertical: - position.Y += SHORT(param) + case horizontal: + position.X += int16(param) + case vertical: + position.Y += int16(param) } if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil { @@ -67,7 +67,7 @@ func (h *WindowsAnsiEventHandler) moveCursor(moveMode int, param int) error { return nil } -func (h *WindowsAnsiEventHandler) moveCursorLine(param int) error { +func (h *windowsAnsiEventHandler) moveCursorLine(param int) error { info, err := GetConsoleScreenBufferInfo(h.fd) if err != nil { return err @@ -75,7 +75,7 @@ func (h *WindowsAnsiEventHandler) moveCursorLine(param int) error { position := info.CursorPosition position.X = 0 - position.Y += SHORT(param) + position.Y += int16(param) if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil { return err @@ -84,14 +84,14 @@ func (h *WindowsAnsiEventHandler) moveCursorLine(param int) error { return nil } -func (h *WindowsAnsiEventHandler) moveCursorColumn(param int) error { +func (h *windowsAnsiEventHandler) moveCursorColumn(param int) error { info, err := GetConsoleScreenBufferInfo(h.fd) if err != nil { return err } position := info.CursorPosition - position.X = SHORT(param) - 1 + position.X = int16(param) - 1 if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil { return err diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go b/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go index f02a5b261b5..244b5fa25ef 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go @@ -2,11 +2,9 @@ package winterm -import ( - . "github.com/Azure/go-ansiterm" -) +import "github.com/Azure/go-ansiterm" -func (h *WindowsAnsiEventHandler) clearRange(attributes WORD, fromCoord COORD, toCoord COORD) error { +func (h *windowsAnsiEventHandler) clearRange(attributes uint16, fromCoord COORD, toCoord COORD) error { // Ignore an invalid (negative area) request if toCoord.Y < fromCoord.Y { return nil @@ -60,7 +58,7 @@ func (h *WindowsAnsiEventHandler) clearRange(attributes WORD, fromCoord COORD, t return nil } -func (h *WindowsAnsiEventHandler) clearRect(attributes WORD, fromCoord COORD, toCoord COORD) error { +func (h *windowsAnsiEventHandler) clearRect(attributes uint16, fromCoord COORD, toCoord COORD) error { region := SMALL_RECT{Top: fromCoord.Y, Left: fromCoord.X, Bottom: toCoord.Y, Right: toCoord.X} width := toCoord.X - fromCoord.X + 1 height := toCoord.Y - fromCoord.Y + 1 @@ -72,7 +70,7 @@ func (h *WindowsAnsiEventHandler) clearRect(attributes WORD, fromCoord COORD, to buffer := make([]CHAR_INFO, size) - char := CHAR_INFO{WCHAR(FILL_CHARACTER), attributes} + char := CHAR_INFO{ansiterm.FILL_CHARACTER, attributes} for i := 0; i < int(size); i++ { buffer[i] = char } diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go b/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go index ed1998245c0..706d270577e 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go @@ -3,9 +3,9 @@ package winterm // effectiveSr gets the current effective scroll region in buffer coordinates -func (h *WindowsAnsiEventHandler) effectiveSr(window SMALL_RECT) scrollRegion { - top := AddInRange(window.Top, h.sr.top, window.Top, window.Bottom) - bottom := AddInRange(window.Top, h.sr.bottom, window.Top, window.Bottom) +func (h *windowsAnsiEventHandler) effectiveSr(window SMALL_RECT) scrollRegion { + top := addInRange(window.Top, h.sr.top, window.Top, window.Bottom) + bottom := addInRange(window.Top, h.sr.bottom, window.Top, window.Bottom) if top >= bottom { top = window.Top bottom = window.Bottom @@ -13,7 +13,7 @@ func (h *WindowsAnsiEventHandler) effectiveSr(window SMALL_RECT) scrollRegion { return scrollRegion{top: top, bottom: bottom} } -func (h *WindowsAnsiEventHandler) scrollUp(param int) error { +func (h *windowsAnsiEventHandler) scrollUp(param int) error { info, err := GetConsoleScreenBufferInfo(h.fd) if err != nil { return err @@ -23,11 +23,11 @@ func (h *WindowsAnsiEventHandler) scrollUp(param int) error { return h.scroll(param, sr, info) } -func (h *WindowsAnsiEventHandler) scrollDown(param int) error { +func (h *windowsAnsiEventHandler) scrollDown(param int) error { return h.scrollUp(-param) } -func (h *WindowsAnsiEventHandler) deleteLines(param int) error { +func (h *windowsAnsiEventHandler) deleteLines(param int) error { info, err := GetConsoleScreenBufferInfo(h.fd) if err != nil { return err @@ -44,12 +44,12 @@ func (h *WindowsAnsiEventHandler) deleteLines(param int) error { } } -func (h *WindowsAnsiEventHandler) insertLines(param int) error { +func (h *windowsAnsiEventHandler) insertLines(param int) error { return h.deleteLines(-param) } // scroll scrolls the provided scroll region by param lines. The scroll region is in buffer coordinates. -func (h *WindowsAnsiEventHandler) scroll(param int, sr scrollRegion, info *CONSOLE_SCREEN_BUFFER_INFO) error { +func (h *windowsAnsiEventHandler) scroll(param int, sr scrollRegion, info *CONSOLE_SCREEN_BUFFER_INFO) error { logger.Infof("scroll: scrollTop: %d, scrollBottom: %d", sr.top, sr.bottom) logger.Infof("scroll: windowTop: %d, windowBottom: %d", info.Window.Top, info.Window.Bottom) @@ -64,7 +64,7 @@ func (h *WindowsAnsiEventHandler) scroll(param int, sr scrollRegion, info *CONSO // Origin to which area should be copied destOrigin := COORD{ X: 0, - Y: sr.top - SHORT(param), + Y: sr.top - int16(param), } char := CHAR_INFO{ @@ -78,7 +78,7 @@ func (h *WindowsAnsiEventHandler) scroll(param int, sr scrollRegion, info *CONSO return nil } -func (h *WindowsAnsiEventHandler) deleteCharacters(param int) error { +func (h *windowsAnsiEventHandler) deleteCharacters(param int) error { info, err := GetConsoleScreenBufferInfo(h.fd) if err != nil { return err @@ -86,12 +86,12 @@ func (h *WindowsAnsiEventHandler) deleteCharacters(param int) error { return h.scrollLine(param, info.CursorPosition, info) } -func (h *WindowsAnsiEventHandler) insertCharacters(param int) error { +func (h *windowsAnsiEventHandler) insertCharacters(param int) error { return h.deleteCharacters(-param) } // scrollLine scrolls a line horizontally starting at the provided position by a number of columns. -func (h *WindowsAnsiEventHandler) scrollLine(columns int, position COORD, info *CONSOLE_SCREEN_BUFFER_INFO) error { +func (h *windowsAnsiEventHandler) scrollLine(columns int, position COORD, info *CONSOLE_SCREEN_BUFFER_INFO) error { // Copy from and clip to the scroll region (full buffer width) scrollRect := SMALL_RECT{ Top: position.Y, @@ -102,7 +102,7 @@ func (h *WindowsAnsiEventHandler) scrollLine(columns int, position COORD, info * // Origin to which area should be copied destOrigin := COORD{ - X: position.X - SHORT(columns), + X: position.X - int16(columns), Y: position.Y, } diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go b/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go index 2f963ff132d..afa7635d77b 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go @@ -4,6 +4,6 @@ package winterm // AddInRange increments a value by the passed quantity while ensuring the values // always remain within the supplied min / max range. -func AddInRange(n SHORT, increment SHORT, min SHORT, max SHORT) SHORT { +func addInRange(n int16, increment int16, min int16, max int16) int16 { return ensureInRange(n+increment, min, max) } diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go b/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go index 2d492b32e42..4d858ed6111 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go @@ -8,19 +8,19 @@ import ( "os" "strconv" - . "github.com/Azure/go-ansiterm" + "github.com/Azure/go-ansiterm" "github.com/Sirupsen/logrus" ) var logger *logrus.Logger -type WindowsAnsiEventHandler struct { +type windowsAnsiEventHandler struct { fd uintptr file *os.File infoReset *CONSOLE_SCREEN_BUFFER_INFO sr scrollRegion buffer bytes.Buffer - attributes WORD + attributes uint16 inverted bool wrapNext bool drewMarginByte bool @@ -30,10 +30,10 @@ type WindowsAnsiEventHandler struct { curPos COORD } -func CreateWinEventHandler(fd uintptr, file *os.File) AnsiEventHandler { +func CreateWinEventHandler(fd uintptr, file *os.File) ansiterm.AnsiEventHandler { logFile := ioutil.Discard - if isDebugEnv := os.Getenv(LogEnv); isDebugEnv == "1" { + if isDebugEnv := os.Getenv(ansiterm.LogEnv); isDebugEnv == "1" { logFile, _ = os.Create("winEventHandler.log") } @@ -48,7 +48,7 @@ func CreateWinEventHandler(fd uintptr, file *os.File) AnsiEventHandler { return nil } - return &WindowsAnsiEventHandler{ + return &windowsAnsiEventHandler{ fd: fd, file: file, infoReset: infoReset, @@ -57,8 +57,8 @@ func CreateWinEventHandler(fd uintptr, file *os.File) AnsiEventHandler { } type scrollRegion struct { - top SHORT - bottom SHORT + top int16 + bottom int16 } // simulateLF simulates a LF or CR+LF by scrolling if necessary to handle the @@ -68,7 +68,7 @@ type scrollRegion struct { // // In the false case, the caller should ensure that a carriage return // and line feed are inserted or that the text is otherwise wrapped. -func (h *WindowsAnsiEventHandler) simulateLF(includeCR bool) (bool, error) { +func (h *windowsAnsiEventHandler) simulateLF(includeCR bool) (bool, error) { if h.wrapNext { if err := h.Flush(); err != nil { return false, err @@ -89,24 +89,25 @@ func (h *WindowsAnsiEventHandler) simulateLF(includeCR bool) (bool, error) { h.updatePos(pos) } return false, nil - } else { - // A custom scroll region is active. Scroll the window manually to simulate - // the LF. - if err := h.Flush(); err != nil { - return false, err - } - logger.Info("Simulating LF inside scroll region") - if err := h.scrollUp(1); err != nil { - return false, err - } - if includeCR { - pos.X = 0 - if err := SetConsoleCursorPosition(h.fd, pos); err != nil { - return false, err - } - } - return true, nil } + + // A custom scroll region is active. Scroll the window manually to simulate + // the LF. + if err := h.Flush(); err != nil { + return false, err + } + logger.Info("Simulating LF inside scroll region") + if err := h.scrollUp(1); err != nil { + return false, err + } + if includeCR { + pos.X = 0 + if err := SetConsoleCursorPosition(h.fd, pos); err != nil { + return false, err + } + } + return true, nil + } else if pos.Y < info.Window.Bottom { // Let Windows handle the LF. pos.Y++ @@ -133,7 +134,7 @@ func (h *WindowsAnsiEventHandler) simulateLF(includeCR bool) (bool, error) { } // executeLF executes a LF without a CR. -func (h *WindowsAnsiEventHandler) executeLF() error { +func (h *windowsAnsiEventHandler) executeLF() error { handled, err := h.simulateLF(false) if err != nil { return err @@ -145,7 +146,7 @@ func (h *WindowsAnsiEventHandler) executeLF() error { if err != nil { return err } - h.buffer.WriteByte(ANSI_LINE_FEED) + h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED) if pos.X != 0 { if err := h.Flush(); err != nil { return err @@ -159,7 +160,7 @@ func (h *WindowsAnsiEventHandler) executeLF() error { return nil } -func (h *WindowsAnsiEventHandler) Print(b byte) error { +func (h *windowsAnsiEventHandler) Print(b byte) error { if h.wrapNext { h.buffer.WriteByte(h.marginByte) h.clearWrap() @@ -182,9 +183,9 @@ func (h *WindowsAnsiEventHandler) Print(b byte) error { return nil } -func (h *WindowsAnsiEventHandler) Execute(b byte) error { +func (h *windowsAnsiEventHandler) Execute(b byte) error { switch b { - case ANSI_TAB: + case ansiterm.ANSI_TAB: logger.Info("Execute(TAB)") // Move to the next tab stop, but preserve auto-wrap if already set. if !h.wrapNext { @@ -205,11 +206,11 @@ func (h *WindowsAnsiEventHandler) Execute(b byte) error { } return nil - case ANSI_BEL: - h.buffer.WriteByte(ANSI_BEL) + case ansiterm.ANSI_BEL: + h.buffer.WriteByte(ansiterm.ANSI_BEL) return nil - case ANSI_BACKSPACE: + case ansiterm.ANSI_BACKSPACE: if h.wrapNext { if err := h.Flush(); err != nil { return err @@ -223,15 +224,15 @@ func (h *WindowsAnsiEventHandler) Execute(b byte) error { if pos.X > 0 { pos.X-- h.updatePos(pos) - h.buffer.WriteByte(ANSI_BACKSPACE) + h.buffer.WriteByte(ansiterm.ANSI_BACKSPACE) } return nil - case ANSI_VERTICAL_TAB, ANSI_FORM_FEED: + case ansiterm.ANSI_VERTICAL_TAB, ansiterm.ANSI_FORM_FEED: // Treat as true LF. return h.executeLF() - case ANSI_LINE_FEED: + case ansiterm.ANSI_LINE_FEED: // Simulate a CR and LF for now since there is no way in go-ansiterm // to tell if the LF should include CR (and more things break when it's // missing than when it's incorrectly added). @@ -239,9 +240,9 @@ func (h *WindowsAnsiEventHandler) Execute(b byte) error { if handled || err != nil { return err } - return h.buffer.WriteByte(ANSI_LINE_FEED) + return h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED) - case ANSI_CARRIAGE_RETURN: + case ansiterm.ANSI_CARRIAGE_RETURN: if h.wrapNext { if err := h.Flush(); err != nil { return err @@ -255,7 +256,7 @@ func (h *WindowsAnsiEventHandler) Execute(b byte) error { if pos.X != 0 { pos.X = 0 h.updatePos(pos) - h.buffer.WriteByte(ANSI_CARRIAGE_RETURN) + h.buffer.WriteByte(ansiterm.ANSI_CARRIAGE_RETURN) } return nil @@ -264,7 +265,7 @@ func (h *WindowsAnsiEventHandler) Execute(b byte) error { } } -func (h *WindowsAnsiEventHandler) CUU(param int) error { +func (h *windowsAnsiEventHandler) CUU(param int) error { if err := h.Flush(); err != nil { return err } @@ -273,7 +274,7 @@ func (h *WindowsAnsiEventHandler) CUU(param int) error { return h.moveCursorVertical(-param) } -func (h *WindowsAnsiEventHandler) CUD(param int) error { +func (h *windowsAnsiEventHandler) CUD(param int) error { if err := h.Flush(); err != nil { return err } @@ -282,7 +283,7 @@ func (h *WindowsAnsiEventHandler) CUD(param int) error { return h.moveCursorVertical(param) } -func (h *WindowsAnsiEventHandler) CUF(param int) error { +func (h *windowsAnsiEventHandler) CUF(param int) error { if err := h.Flush(); err != nil { return err } @@ -291,7 +292,7 @@ func (h *WindowsAnsiEventHandler) CUF(param int) error { return h.moveCursorHorizontal(param) } -func (h *WindowsAnsiEventHandler) CUB(param int) error { +func (h *windowsAnsiEventHandler) CUB(param int) error { if err := h.Flush(); err != nil { return err } @@ -300,7 +301,7 @@ func (h *WindowsAnsiEventHandler) CUB(param int) error { return h.moveCursorHorizontal(-param) } -func (h *WindowsAnsiEventHandler) CNL(param int) error { +func (h *windowsAnsiEventHandler) CNL(param int) error { if err := h.Flush(); err != nil { return err } @@ -309,7 +310,7 @@ func (h *WindowsAnsiEventHandler) CNL(param int) error { return h.moveCursorLine(param) } -func (h *WindowsAnsiEventHandler) CPL(param int) error { +func (h *windowsAnsiEventHandler) CPL(param int) error { if err := h.Flush(); err != nil { return err } @@ -318,7 +319,7 @@ func (h *WindowsAnsiEventHandler) CPL(param int) error { return h.moveCursorLine(-param) } -func (h *WindowsAnsiEventHandler) CHA(param int) error { +func (h *windowsAnsiEventHandler) CHA(param int) error { if err := h.Flush(); err != nil { return err } @@ -327,7 +328,7 @@ func (h *WindowsAnsiEventHandler) CHA(param int) error { return h.moveCursorColumn(param) } -func (h *WindowsAnsiEventHandler) VPA(param int) error { +func (h *windowsAnsiEventHandler) VPA(param int) error { if err := h.Flush(); err != nil { return err } @@ -339,11 +340,11 @@ func (h *WindowsAnsiEventHandler) VPA(param int) error { } window := h.getCursorWindow(info) position := info.CursorPosition - position.Y = window.Top + SHORT(param) - 1 + position.Y = window.Top + int16(param) - 1 return h.setCursorPosition(position, window) } -func (h *WindowsAnsiEventHandler) CUP(row int, col int) error { +func (h *windowsAnsiEventHandler) CUP(row int, col int) error { if err := h.Flush(); err != nil { return err } @@ -355,11 +356,11 @@ func (h *WindowsAnsiEventHandler) CUP(row int, col int) error { } window := h.getCursorWindow(info) - position := COORD{window.Left + SHORT(col) - 1, window.Top + SHORT(row) - 1} + position := COORD{window.Left + int16(col) - 1, window.Top + int16(row) - 1} return h.setCursorPosition(position, window) } -func (h *WindowsAnsiEventHandler) HVP(row int, col int) error { +func (h *windowsAnsiEventHandler) HVP(row int, col int) error { if err := h.Flush(); err != nil { return err } @@ -368,7 +369,7 @@ func (h *WindowsAnsiEventHandler) HVP(row int, col int) error { return h.CUP(row, col) } -func (h *WindowsAnsiEventHandler) DECTCEM(visible bool) error { +func (h *windowsAnsiEventHandler) DECTCEM(visible bool) error { if err := h.Flush(); err != nil { return err } @@ -377,7 +378,7 @@ func (h *WindowsAnsiEventHandler) DECTCEM(visible bool) error { return nil } -func (h *WindowsAnsiEventHandler) DECOM(enable bool) error { +func (h *windowsAnsiEventHandler) DECOM(enable bool) error { if err := h.Flush(); err != nil { return err } @@ -387,7 +388,7 @@ func (h *WindowsAnsiEventHandler) DECOM(enable bool) error { return h.CUP(1, 1) } -func (h *WindowsAnsiEventHandler) DECCOLM(use132 bool) error { +func (h *windowsAnsiEventHandler) DECCOLM(use132 bool) error { if err := h.Flush(); err != nil { return err } @@ -400,7 +401,7 @@ func (h *WindowsAnsiEventHandler) DECCOLM(use132 bool) error { if err != nil { return err } - targetWidth := SHORT(80) + targetWidth := int16(80) if use132 { targetWidth = 132 } @@ -426,7 +427,7 @@ func (h *WindowsAnsiEventHandler) DECCOLM(use132 bool) error { return SetConsoleCursorPosition(h.fd, COORD{0, 0}) } -func (h *WindowsAnsiEventHandler) ED(param int) error { +func (h *windowsAnsiEventHandler) ED(param int) error { if err := h.Flush(); err != nil { return err } @@ -485,7 +486,7 @@ func (h *WindowsAnsiEventHandler) ED(param int) error { return nil } -func (h *WindowsAnsiEventHandler) EL(param int) error { +func (h *windowsAnsiEventHandler) EL(param int) error { if err := h.Flush(); err != nil { return err } @@ -526,7 +527,7 @@ func (h *WindowsAnsiEventHandler) EL(param int) error { return nil } -func (h *WindowsAnsiEventHandler) IL(param int) error { +func (h *windowsAnsiEventHandler) IL(param int) error { if err := h.Flush(); err != nil { return err } @@ -535,7 +536,7 @@ func (h *WindowsAnsiEventHandler) IL(param int) error { return h.insertLines(param) } -func (h *WindowsAnsiEventHandler) DL(param int) error { +func (h *windowsAnsiEventHandler) DL(param int) error { if err := h.Flush(); err != nil { return err } @@ -544,7 +545,7 @@ func (h *WindowsAnsiEventHandler) DL(param int) error { return h.deleteLines(param) } -func (h *WindowsAnsiEventHandler) ICH(param int) error { +func (h *windowsAnsiEventHandler) ICH(param int) error { if err := h.Flush(); err != nil { return err } @@ -553,7 +554,7 @@ func (h *WindowsAnsiEventHandler) ICH(param int) error { return h.insertCharacters(param) } -func (h *WindowsAnsiEventHandler) DCH(param int) error { +func (h *windowsAnsiEventHandler) DCH(param int) error { if err := h.Flush(); err != nil { return err } @@ -562,7 +563,7 @@ func (h *WindowsAnsiEventHandler) DCH(param int) error { return h.deleteCharacters(param) } -func (h *WindowsAnsiEventHandler) SGR(params []int) error { +func (h *windowsAnsiEventHandler) SGR(params []int) error { if err := h.Flush(); err != nil { return err } @@ -579,13 +580,13 @@ func (h *WindowsAnsiEventHandler) SGR(params []int) error { } else { for _, attr := range params { - if attr == ANSI_SGR_RESET { + if attr == ansiterm.ANSI_SGR_RESET { h.attributes = h.infoReset.Attributes h.inverted = false continue } - h.attributes, h.inverted = collectAnsiIntoWindowsAttributes(h.attributes, h.inverted, h.infoReset.Attributes, SHORT(attr)) + h.attributes, h.inverted = collectAnsiIntoWindowsAttributes(h.attributes, h.inverted, h.infoReset.Attributes, int16(attr)) } } @@ -601,7 +602,7 @@ func (h *WindowsAnsiEventHandler) SGR(params []int) error { return nil } -func (h *WindowsAnsiEventHandler) SU(param int) error { +func (h *windowsAnsiEventHandler) SU(param int) error { if err := h.Flush(); err != nil { return err } @@ -610,7 +611,7 @@ func (h *WindowsAnsiEventHandler) SU(param int) error { return h.scrollUp(param) } -func (h *WindowsAnsiEventHandler) SD(param int) error { +func (h *windowsAnsiEventHandler) SD(param int) error { if err := h.Flush(); err != nil { return err } @@ -619,29 +620,29 @@ func (h *WindowsAnsiEventHandler) SD(param int) error { return h.scrollDown(param) } -func (h *WindowsAnsiEventHandler) DA(params []string) error { +func (h *windowsAnsiEventHandler) DA(params []string) error { logger.Infof("DA: [%v]", params) // DA cannot be implemented because it must send data on the VT100 input stream, // which is not available to go-ansiterm. return nil } -func (h *WindowsAnsiEventHandler) DECSTBM(top int, bottom int) error { +func (h *windowsAnsiEventHandler) DECSTBM(top int, bottom int) error { if err := h.Flush(); err != nil { return err } logger.Infof("DECSTBM: [%d, %d]", top, bottom) // Windows is 0 indexed, Linux is 1 indexed - h.sr.top = SHORT(top - 1) - h.sr.bottom = SHORT(bottom - 1) + h.sr.top = int16(top - 1) + h.sr.bottom = int16(bottom - 1) // This command also moves the cursor to the origin. h.clearWrap() return h.CUP(1, 1) } -func (h *WindowsAnsiEventHandler) RI() error { +func (h *windowsAnsiEventHandler) RI() error { if err := h.Flush(); err != nil { return err } @@ -656,17 +657,17 @@ func (h *WindowsAnsiEventHandler) RI() error { sr := h.effectiveSr(info.Window) if info.CursorPosition.Y == sr.top { return h.scrollDown(1) - } else { - return h.moveCursorVertical(-1) } + + return h.moveCursorVertical(-1) } -func (h *WindowsAnsiEventHandler) IND() error { +func (h *windowsAnsiEventHandler) IND() error { logger.Info("IND: []") return h.executeLF() } -func (h *WindowsAnsiEventHandler) Flush() error { +func (h *windowsAnsiEventHandler) Flush() error { h.curInfo = nil if h.buffer.Len() > 0 { logger.Infof("Flush: [%s]", h.buffer.Bytes()) @@ -683,7 +684,7 @@ func (h *WindowsAnsiEventHandler) Flush() error { return err } - charInfo := []CHAR_INFO{{UnicodeChar: WCHAR(h.marginByte), Attributes: info.Attributes}} + charInfo := []CHAR_INFO{{UnicodeChar: uint16(h.marginByte), Attributes: info.Attributes}} size := COORD{1, 1} position := COORD{0, 0} region := SMALL_RECT{Left: info.CursorPosition.X, Top: info.CursorPosition.Y, Right: info.CursorPosition.X, Bottom: info.CursorPosition.Y} @@ -697,7 +698,7 @@ func (h *WindowsAnsiEventHandler) Flush() error { // cacheConsoleInfo ensures that the current console screen information has been queried // since the last call to Flush(). It must be called before accessing h.curInfo or h.curPos. -func (h *WindowsAnsiEventHandler) getCurrentInfo() (COORD, *CONSOLE_SCREEN_BUFFER_INFO, error) { +func (h *windowsAnsiEventHandler) getCurrentInfo() (COORD, *CONSOLE_SCREEN_BUFFER_INFO, error) { if h.curInfo == nil { info, err := GetConsoleScreenBufferInfo(h.fd) if err != nil { @@ -709,7 +710,7 @@ func (h *WindowsAnsiEventHandler) getCurrentInfo() (COORD, *CONSOLE_SCREEN_BUFFE return h.curPos, h.curInfo, nil } -func (h *WindowsAnsiEventHandler) updatePos(pos COORD) { +func (h *windowsAnsiEventHandler) updatePos(pos COORD) { if h.curInfo == nil { panic("failed to call getCurrentInfo before calling updatePos") } @@ -719,7 +720,7 @@ func (h *WindowsAnsiEventHandler) updatePos(pos COORD) { // clearWrap clears the state where the cursor is in the margin // waiting for the next character before wrapping the line. This must // be done before most operations that act on the cursor. -func (h *WindowsAnsiEventHandler) clearWrap() { +func (h *windowsAnsiEventHandler) clearWrap() { h.wrapNext = false h.drewMarginByte = false } 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 ebf754eab4f..3af1b48d270 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go @@ -19,93 +19,103 @@ var environments = map[string]Environment{ // 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"` - StorageEndpointSuffix string `json:"storageEndpointSuffix"` - SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"` - TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"` - KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"` - ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"` + 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"` + 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"` } var ( // PublicCloud is the default public Azure cloud environment PublicCloud = Environment{ - Name: "AzurePublicCloud", - ManagementPortalURL: "https://manage.windowsazure.com/", - PublishSettingsURL: "https://manage.windowsazure.com/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.windows.net/", - ResourceManagerEndpoint: "https://management.azure.com/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.com/", - GalleryEndpoint: "https://gallery.azure.com/", - KeyVaultEndpoint: "https://vault.azure.net/", - GraphEndpoint: "https://graph.windows.net/", - StorageEndpointSuffix: "core.windows.net", - SQLDatabaseDNSSuffix: "database.windows.net", - TrafficManagerDNSSuffix: "trafficmanager.net", - KeyVaultDNSSuffix: "vault.azure.net", - ServiceBusEndpointSuffix: "servicebus.azure.com", + Name: "AzurePublicCloud", + ManagementPortalURL: "https://manage.windowsazure.com/", + PublishSettingsURL: "https://manage.windowsazure.com/publishsettings/index", + ServiceManagementEndpoint: "https://management.core.windows.net/", + ResourceManagerEndpoint: "https://management.azure.com/", + ActiveDirectoryEndpoint: "https://login.microsoftonline.com/", + GalleryEndpoint: "https://gallery.azure.com/", + KeyVaultEndpoint: "https://vault.azure.net/", + GraphEndpoint: "https://graph.windows.net/", + StorageEndpointSuffix: "core.windows.net", + SQLDatabaseDNSSuffix: "database.windows.net", + TrafficManagerDNSSuffix: "trafficmanager.net", + KeyVaultDNSSuffix: "vault.azure.net", + ServiceBusEndpointSuffix: "servicebus.azure.com", + ServiceManagementVMDNSSuffix: "cloudapp.net", + ResourceManagerVMDNSSuffix: "cloudapp.azure.com", } // USGovernmentCloud is the cloud environment for the US Government USGovernmentCloud = Environment{ - Name: "AzureUSGovernmentCloud", - ManagementPortalURL: "https://manage.windowsazure.us/", - PublishSettingsURL: "https://manage.windowsazure.us/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.usgovcloudapi.net/", - ResourceManagerEndpoint: "https://management.usgovcloudapi.net/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.com/", - GalleryEndpoint: "https://gallery.usgovcloudapi.net/", - KeyVaultEndpoint: "https://vault.usgovcloudapi.net/", - GraphEndpoint: "https://graph.usgovcloudapi.net/", - StorageEndpointSuffix: "core.usgovcloudapi.net", - SQLDatabaseDNSSuffix: "database.usgovcloudapi.net", - TrafficManagerDNSSuffix: "usgovtrafficmanager.net", - KeyVaultDNSSuffix: "vault.usgovcloudapi.net", - ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net", + Name: "AzureUSGovernmentCloud", + ManagementPortalURL: "https://manage.windowsazure.us/", + PublishSettingsURL: "https://manage.windowsazure.us/publishsettings/index", + ServiceManagementEndpoint: "https://management.core.usgovcloudapi.net/", + ResourceManagerEndpoint: "https://management.usgovcloudapi.net/", + ActiveDirectoryEndpoint: "https://login.microsoftonline.com/", + GalleryEndpoint: "https://gallery.usgovcloudapi.net/", + KeyVaultEndpoint: "https://vault.usgovcloudapi.net/", + GraphEndpoint: "https://graph.usgovcloudapi.net/", + StorageEndpointSuffix: "core.usgovcloudapi.net", + SQLDatabaseDNSSuffix: "database.usgovcloudapi.net", + TrafficManagerDNSSuffix: "usgovtrafficmanager.net", + KeyVaultDNSSuffix: "vault.usgovcloudapi.net", + ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net", + ServiceManagementVMDNSSuffix: "usgovcloudapp.net", + ResourceManagerVMDNSSuffix: "cloudapp.windowsazure.us", } // ChinaCloud is the cloud environment operated in China ChinaCloud = Environment{ - Name: "AzureChinaCloud", - ManagementPortalURL: "https://manage.chinacloudapi.com/", - PublishSettingsURL: "https://manage.chinacloudapi.com/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.chinacloudapi.cn/", - ResourceManagerEndpoint: "https://management.chinacloudapi.cn/", - ActiveDirectoryEndpoint: "https://login.chinacloudapi.cn/?api-version=1.0", - GalleryEndpoint: "https://gallery.chinacloudapi.cn/", - KeyVaultEndpoint: "https://vault.azure.cn/", - GraphEndpoint: "https://graph.chinacloudapi.cn/", - StorageEndpointSuffix: "core.chinacloudapi.cn", - SQLDatabaseDNSSuffix: "database.chinacloudapi.cn", - TrafficManagerDNSSuffix: "trafficmanager.cn", - KeyVaultDNSSuffix: "vault.azure.cn", - ServiceBusEndpointSuffix: "servicebus.chinacloudapi.net", + Name: "AzureChinaCloud", + ManagementPortalURL: "https://manage.chinacloudapi.com/", + PublishSettingsURL: "https://manage.chinacloudapi.com/publishsettings/index", + ServiceManagementEndpoint: "https://management.core.chinacloudapi.cn/", + ResourceManagerEndpoint: "https://management.chinacloudapi.cn/", + ActiveDirectoryEndpoint: "https://login.chinacloudapi.cn/?api-version=1.0", + GalleryEndpoint: "https://gallery.chinacloudapi.cn/", + KeyVaultEndpoint: "https://vault.azure.cn/", + GraphEndpoint: "https://graph.chinacloudapi.cn/", + StorageEndpointSuffix: "core.chinacloudapi.cn", + SQLDatabaseDNSSuffix: "database.chinacloudapi.cn", + TrafficManagerDNSSuffix: "trafficmanager.cn", + KeyVaultDNSSuffix: "vault.azure.cn", + ServiceBusEndpointSuffix: "servicebus.chinacloudapi.net", + ServiceManagementVMDNSSuffix: "chinacloudapp.cn", + ResourceManagerVMDNSSuffix: "cloudapp.azure.cn", } // GermanCloud is the cloud environment operated in Germany GermanCloud = Environment{ - Name: "AzureGermanCloud", - ManagementPortalURL: "http://portal.microsoftazure.de/", - PublishSettingsURL: "https://manage.microsoftazure.de/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.cloudapi.de/", - ResourceManagerEndpoint: "https://management.microsoftazure.de/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.de/", - GalleryEndpoint: "https://gallery.cloudapi.de/", - KeyVaultEndpoint: "https://vault.microsoftazure.de/", - GraphEndpoint: "https://graph.cloudapi.de/", - StorageEndpointSuffix: "core.cloudapi.de", - SQLDatabaseDNSSuffix: "database.cloudapi.de", - TrafficManagerDNSSuffix: "azuretrafficmanager.de", - KeyVaultDNSSuffix: "vault.microsoftazure.de", - ServiceBusEndpointSuffix: "servicebus.cloudapi.de", + Name: "AzureGermanCloud", + ManagementPortalURL: "http://portal.microsoftazure.de/", + PublishSettingsURL: "https://manage.microsoftazure.de/publishsettings/index", + ServiceManagementEndpoint: "https://management.core.cloudapi.de/", + ResourceManagerEndpoint: "https://management.microsoftazure.de/", + ActiveDirectoryEndpoint: "https://login.microsoftonline.de/", + GalleryEndpoint: "https://gallery.cloudapi.de/", + KeyVaultEndpoint: "https://vault.microsoftazure.de/", + GraphEndpoint: "https://graph.cloudapi.de/", + StorageEndpointSuffix: "core.cloudapi.de", + SQLDatabaseDNSSuffix: "database.cloudapi.de", + TrafficManagerDNSSuffix: "azuretrafficmanager.de", + KeyVaultDNSSuffix: "vault.microsoftazure.de", + ServiceBusEndpointSuffix: "servicebus.cloudapi.de", + ServiceManagementVMDNSSuffix: "azurecloudapp.de", + ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de", } ) @@ -121,8 +131,13 @@ func EnvironmentFromName(name string) (Environment, error) { // OAuthConfigForTenant returns an OAuthConfig with tenant specific urls func (env Environment) OAuthConfigForTenant(tenantID string) (*OAuthConfig, error) { + return OAuthConfigForTenant(env.ActiveDirectoryEndpoint, tenantID) +} + +// OAuthConfigForTenant returns an OAuthConfig with tenant specific urls for target cloud auth endpoint +func OAuthConfigForTenant(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, error) { template := "%s/oauth2/%s?api-version=%s" - u, err := url.Parse(env.ActiveDirectoryEndpoint) + u, err := url.Parse(activeDirectoryEndpoint) if err != nil { return nil, err } diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/token.go b/vendor/github.com/Azure/go-autorest/autorest/azure/token.go index db9a8fa02ae..d2d38162cd7 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/token.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/token.go @@ -91,7 +91,7 @@ type ServicePrincipalNoSecret struct { // SetAuthenticationValues is a method of the interface ServicePrincipalSecret // It only returns an error for the ServicePrincipalNoSecret type func (noSecret *ServicePrincipalNoSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - return fmt.Errorf("Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token.") + return fmt.Errorf("Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token") } // ServicePrincipalSecret is an interface that allows various secret mechanism to fill the form @@ -138,7 +138,7 @@ func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalTo token := jwt.New(jwt.SigningMethodRS256) token.Header["x5t"] = thumbprint token.Claims = jwt.MapClaims{ - "aud": spt.oauthConfig.TokenEndpoint, + "aud": spt.oauthConfig.TokenEndpoint.String(), "iss": spt.clientID, "sub": spt.clientID, "jti": base64.URLEncoding.EncodeToString(jti), diff --git a/vendor/github.com/Azure/go-autorest/autorest/client.go b/vendor/github.com/Azure/go-autorest/autorest/client.go index 95e9a203d88..b55b3d10353 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/client.go +++ b/vendor/github.com/Azure/go-autorest/autorest/client.go @@ -20,9 +20,6 @@ const ( // DefaultRetryAttempts is number of attempts for retry status codes (5xx). DefaultRetryAttempts = 3 - - // DefaultRetryDuration is a resonable delay for retry. - defaultRetryInterval = 30 * time.Second ) var statusCodesForRetry = []int{ @@ -130,6 +127,9 @@ type Client struct { // RetryAttempts sets the default number of retry attempts for client. RetryAttempts int + // RetryDuration sets the delay duration for retries. + RetryDuration time.Duration + // UserAgent, if not empty, will be set as the HTTP User-Agent header on all requests sent // through the Do method. UserAgent string @@ -144,6 +144,7 @@ func NewClientWithUserAgent(ua string) Client { PollingDelay: DefaultPollingDelay, PollingDuration: DefaultPollingDuration, RetryAttempts: DefaultRetryAttempts, + RetryDuration: 30 * time.Second, UserAgent: ua, } } @@ -163,7 +164,7 @@ func (c Client) Do(r *http.Request) (*http.Response, error) { return nil, NewErrorWithError(err, "autorest/Client", "Do", nil, "Preparing request failed") } resp, err := SendWithSender(c.sender(), r, - DoRetryForStatusCodes(c.RetryAttempts, defaultRetryInterval, statusCodesForRetry...)) + DoRetryForStatusCodes(c.RetryAttempts, c.RetryDuration, statusCodesForRetry...)) Respond(resp, c.ByInspecting()) return resp, err diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/time.go b/vendor/github.com/Azure/go-autorest/autorest/date/time.go index fd3c5854e79..c1af6296348 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/date/time.go +++ b/vendor/github.com/Azure/go-autorest/autorest/date/time.go @@ -1,12 +1,17 @@ package date import ( + "regexp" "time" ) +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. const ( - rfc3339JSON = `"` + time.RFC3339Nano + `"` - rfc3339 = time.RFC3339Nano + azureUtcFormatJSON = `"2006-01-02T15:04:05.999999999"` + azureUtcFormat = "2006-01-02T15:04:05.999999999" + rfc3339JSON = `"` + time.RFC3339Nano + `"` + rfc3339 = time.RFC3339Nano + tzOffsetRegex = `(Z|z|\+|-)(\d+:\d+)*"*$` ) // Time defines a type similar to time.Time but assumes a layout of RFC3339 date-time (i.e., @@ -36,7 +41,14 @@ func (t Time) MarshalJSON() (json []byte, err error) { // UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC3339 date-time // (i.e., 2006-01-02T15:04:05Z). func (t *Time) UnmarshalJSON(data []byte) (err error) { - t.Time, err = ParseTime(rfc3339JSON, string(data)) + timeFormat := azureUtcFormatJSON + match, err := regexp.Match(tzOffsetRegex, data) + if err != nil { + return err + } else if match { + timeFormat = rfc3339JSON + } + t.Time, err = ParseTime(timeFormat, string(data)) return err } @@ -49,7 +61,14 @@ func (t Time) MarshalText() (text []byte, err error) { // UnmarshalText reconstitutes a Time saved as a byte array conforming to RFC3339 date-time // (i.e., 2006-01-02T15:04:05Z). func (t *Time) UnmarshalText(data []byte) (err error) { - t.Time, err = ParseTime(rfc3339, string(data)) + timeFormat := azureUtcFormat + match, err := regexp.Match(tzOffsetRegex, data) + if err != nil { + return err + } else if match { + timeFormat = rfc3339 + } + t.Time, err = ParseTime(timeFormat, string(data)) return err } diff --git a/vendor/github.com/Azure/go-autorest/autorest/preparer.go b/vendor/github.com/Azure/go-autorest/autorest/preparer.go index 0f18c2aced8..5b2c52704a2 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/preparer.go +++ b/vendor/github.com/Azure/go-autorest/autorest/preparer.go @@ -4,7 +4,9 @@ import ( "bytes" "encoding/json" "fmt" + "io" "io/ioutil" + "mime/multipart" "net/http" "net/url" "strings" @@ -197,6 +199,64 @@ func WithFormData(v url.Values) PrepareDecorator { } } +// WithMultiPartFormData returns a PrepareDecoratore that "URL encodes" (e.g., bar=baz&foo=quux) form parameters +// into the http.Request body. +func WithMultiPartFormData(formDataParameters map[string]interface{}) PrepareDecorator { + return func(p Preparer) Preparer { + return PreparerFunc(func(r *http.Request) (*http.Request, error) { + r, err := p.Prepare(r) + if err == nil { + var body bytes.Buffer + writer := multipart.NewWriter(&body) + for key, value := range formDataParameters { + if rc, ok := value.(io.ReadCloser); ok { + var fd io.Writer + if fd, err = writer.CreateFormFile(key, key); err != nil { + return r, err + } + if _, err = io.Copy(fd, rc); err != nil { + return r, err + } + } else { + if err = writer.WriteField(key, ensureValueString(value)); err != nil { + return r, err + } + } + } + if err = writer.Close(); err != nil { + return r, err + } + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set(http.CanonicalHeaderKey(headerContentType), writer.FormDataContentType()) + r.Body = ioutil.NopCloser(bytes.NewReader(body.Bytes())) + r.ContentLength = int64(body.Len()) + return r, err + } + return r, err + }) + } +} + +// WithFile returns a PrepareDecorator that sends file in request body. +func WithFile(f io.ReadCloser) PrepareDecorator { + return func(p Preparer) Preparer { + return PreparerFunc(func(r *http.Request) (*http.Request, error) { + r, err := p.Prepare(r) + if err == nil { + b, err := ioutil.ReadAll(f) + if err != nil { + return r, err + } + r.Body = ioutil.NopCloser(bytes.NewReader(b)) + r.ContentLength = int64(len(b)) + } + return r, err + }) + } +} + // WithBool returns a PrepareDecorator that encodes the passed bool into the body of the request // and sets the Content-Length header. func WithBool(v bool) PrepareDecorator { diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility.go b/vendor/github.com/Azure/go-autorest/autorest/utility.go index b7f4a723b1c..78067148b28 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/utility.go +++ b/vendor/github.com/Azure/go-autorest/autorest/utility.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "net/url" + "reflect" "sort" "strings" ) @@ -106,6 +107,22 @@ func ensureValueString(value interface{}) string { } } +// MapToValues method converts map[string]interface{} to url.Values. +func MapToValues(m map[string]interface{}) url.Values { + v := url.Values{} + for key, value := range m { + x := reflect.ValueOf(value) + if x.Kind() == reflect.Array || x.Kind() == reflect.Slice { + for i := 0; i < x.Len(); i++ { + v.Add(key, ensureValueString(x.Index(i))) + } + } else { + v.Add(key, ensureValueString(value)) + } + } + return v +} + // String method converts interface v to string. If interface is a list, it // joins list elements using separator. func String(v interface{}, sep ...string) string { diff --git a/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go b/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go new file mode 100644 index 00000000000..d7b0eadc554 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go @@ -0,0 +1,373 @@ +/* +Package validation provides methods for validating parameter value using reflection. +*/ +package validation + +import ( + "fmt" + "reflect" + "regexp" + "strings" +) + +// Constraint stores constraint name, target field name +// Rule and chain validations. +type Constraint struct { + + // Target field name for validation. + Target string + + // Constraint name e.g. minLength, MaxLength, Pattern, etc. + Name string + + // Rule for constraint e.g. greater than 10, less than 5 etc. + Rule interface{} + + // Chain Validations for struct type + Chain []Constraint +} + +// Validation stores parameter-wise validation. +type Validation struct { + TargetValue interface{} + Constraints []Constraint +} + +// Constraint list +const ( + Empty = "Empty" + Null = "Null" + ReadOnly = "ReadOnly" + Pattern = "Pattern" + MaxLength = "MaxLength" + MinLength = "MinLength" + MaxItems = "MaxItems" + MinItems = "MinItems" + MultipleOf = "MultipleOf" + UniqueItems = "UniqueItems" + InclusiveMaximum = "InclusiveMaximum" + ExclusiveMaximum = "ExclusiveMaximum" + ExclusiveMinimum = "ExclusiveMinimum" + InclusiveMinimum = "InclusiveMinimum" +) + +// Validate method validates constraints on parameter +// passed in validation array. +func Validate(m []Validation) error { + for _, item := range m { + v := reflect.ValueOf(item.TargetValue) + for _, constraint := range item.Constraints { + var err error + switch v.Kind() { + case reflect.Ptr: + err = validatePtr(v, constraint) + case reflect.String: + err = validateString(v, constraint) + case reflect.Struct: + err = validateStruct(v, constraint) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + err = validateInt(v, constraint) + case reflect.Float32, reflect.Float64: + err = validateFloat(v, constraint) + case reflect.Array, reflect.Slice, reflect.Map: + err = validateArrayMap(v, constraint) + default: + err = createError(v, constraint, fmt.Sprintf("unknown type %v", v.Kind())) + } + + if err != nil { + return err + } + } + } + return nil +} + +func validateStruct(x reflect.Value, v Constraint, name ...string) error { + //Get field name from target name which is in format a.b.c + s := strings.Split(v.Target, ".") + f := x.FieldByName(s[len(s)-1]) + if isZero(f) { + return createError(x, v, fmt.Sprintf("field %q doesn't exist", v.Target)) + } + + if err := Validate([]Validation{ + { + TargetValue: getInterfaceValue(f), + Constraints: []Constraint{v}, + }, + }); err != nil { + return err + } + return nil +} + +func validatePtr(x reflect.Value, v Constraint) error { + if v.Name == ReadOnly { + if !x.IsNil() { + return createError(x.Elem(), v, "readonly parameter; must send as nil or empty in request") + } + return nil + } + if x.IsNil() { + return checkNil(x, v) + } + if v.Chain != nil { + return Validate([]Validation{ + { + TargetValue: getInterfaceValue(x.Elem()), + Constraints: v.Chain, + }, + }) + } + return nil +} + +func validateInt(x reflect.Value, v Constraint) error { + i := x.Int() + r, ok := v.Rule.(int) + if !ok { + return createError(x, v, fmt.Sprintf("rule must be integer value for %v constraint; got: %v", v.Name, v.Rule)) + } + switch v.Name { + case MultipleOf: + if i%int64(r) != 0 { + return createError(x, v, fmt.Sprintf("value must be a multiple of %v", r)) + } + case ExclusiveMinimum: + if i <= int64(r) { + return createError(x, v, fmt.Sprintf("value must be greater than %v", r)) + } + case ExclusiveMaximum: + if i >= int64(r) { + return createError(x, v, fmt.Sprintf("value must be less than %v", r)) + } + case InclusiveMinimum: + if i < int64(r) { + return createError(x, v, fmt.Sprintf("value must be greater than or equal to %v", r)) + } + case InclusiveMaximum: + if i > int64(r) { + return createError(x, v, fmt.Sprintf("value must be less than or equal to %v", r)) + } + default: + return createError(x, v, fmt.Sprintf("constraint %v is not applicable for type integer", v.Name)) + } + return nil +} + +func validateFloat(x reflect.Value, v Constraint) error { + f := x.Float() + r, ok := v.Rule.(float64) + if !ok { + return createError(x, v, fmt.Sprintf("rule must be float value for %v constraint; got: %v", v.Name, v.Rule)) + } + switch v.Name { + case ExclusiveMinimum: + if f <= r { + return createError(x, v, fmt.Sprintf("value must be greater than %v", r)) + } + case ExclusiveMaximum: + if f >= r { + return createError(x, v, fmt.Sprintf("value must be less than %v", r)) + } + case InclusiveMinimum: + if f < r { + return createError(x, v, fmt.Sprintf("value must be greater than or equal to %v", r)) + } + case InclusiveMaximum: + if f > r { + return createError(x, v, fmt.Sprintf("value must be less than or equal to %v", r)) + } + default: + return createError(x, v, fmt.Sprintf("constraint %s is not applicable for type float", v.Name)) + } + return nil +} + +func validateString(x reflect.Value, v Constraint) error { + s := x.String() + switch v.Name { + case Empty: + if len(s) == 0 { + return checkEmpty(x, v) + } + case Pattern: + reg, err := regexp.Compile(v.Rule.(string)) + if err != nil { + return createError(x, v, err.Error()) + } + if !reg.MatchString(s) { + return createError(x, v, fmt.Sprintf("value doesn't match pattern %v", v.Rule)) + } + case MaxLength: + if _, ok := v.Rule.(int); !ok { + return createError(x, v, fmt.Sprintf("rule must be integer value for %v constraint; got: %v", v.Name, v.Rule)) + } + if len(s) > v.Rule.(int) { + return createError(x, v, fmt.Sprintf("value length must be less than %v", v.Rule)) + } + case MinLength: + if _, ok := v.Rule.(int); !ok { + return createError(x, v, fmt.Sprintf("rule must be integer value for %v constraint; got: %v", v.Name, v.Rule)) + } + if len(s) < v.Rule.(int) { + return createError(x, v, fmt.Sprintf("value length must be greater than %v", v.Rule)) + } + case ReadOnly: + if len(s) > 0 { + return createError(reflect.ValueOf(s), v, "readonly parameter; must send as nil or empty in request") + } + default: + return createError(x, v, fmt.Sprintf("constraint %s is not applicable to string type", v.Name)) + } + + if v.Chain != nil { + return Validate([]Validation{ + { + TargetValue: getInterfaceValue(x), + Constraints: v.Chain, + }, + }) + } + return nil +} + +func validateArrayMap(x reflect.Value, v Constraint) error { + switch v.Name { + case Null: + if x.IsNil() { + return checkNil(x, v) + } + case Empty: + if x.IsNil() || x.Len() == 0 { + return checkEmpty(x, v) + } + case MaxItems: + if _, ok := v.Rule.(int); !ok { + return createError(x, v, fmt.Sprintf("rule must be integer for %v constraint; got: %v", v.Name, v.Rule)) + } + if x.Len() > v.Rule.(int) { + return createError(x, v, fmt.Sprintf("maximum item limit is %v; got: %v", v.Rule, x.Len())) + } + case MinItems: + if _, ok := v.Rule.(int); !ok { + return createError(x, v, fmt.Sprintf("rule must be integer for %v constraint; got: %v", v.Name, v.Rule)) + } + if x.Len() < v.Rule.(int) { + return createError(x, v, fmt.Sprintf("minimum item limit is %v; got: %v", v.Rule, x.Len())) + } + case UniqueItems: + if x.Kind() == reflect.Array || x.Kind() == reflect.Slice { + if !checkForUniqueInArray(x) { + return createError(x, v, fmt.Sprintf("all items in parameter %q must be unique; got:%v", v.Target, x)) + } + } else if x.Kind() == reflect.Map { + if !checkForUniqueInMap(x) { + return createError(x, v, fmt.Sprintf("all items in parameter %q must be unique; got:%v", v.Target, x)) + } + } else { + return createError(x, v, fmt.Sprintf("type must be array, slice or map for constraint %v; got: %v", v.Name, x.Kind())) + } + case ReadOnly: + if x.Len() != 0 { + return createError(x, v, "readonly parameter; must send as nil or empty in request") + } + default: + return createError(x, v, fmt.Sprintf("constraint %v is not applicable to array, slice and map type", v.Name)) + } + + if v.Chain != nil { + return Validate([]Validation{ + { + TargetValue: getInterfaceValue(x), + Constraints: v.Chain, + }, + }) + } + return nil +} + +func checkNil(x reflect.Value, v Constraint) error { + if _, ok := v.Rule.(bool); !ok { + return createError(x, v, fmt.Sprintf("rule must be bool value for %v constraint; got: %v", v.Name, v.Rule)) + } + if v.Rule.(bool) { + return createError(x, v, "value can not be null; required parameter") + } + return nil +} + +func checkEmpty(x reflect.Value, v Constraint) error { + if _, ok := v.Rule.(bool); !ok { + return createError(x, v, fmt.Sprintf("rule must be bool value for %v constraint; got: %v", v.Name, v.Rule)) + } + + if v.Rule.(bool) { + return createError(x, v, "value can not be null or empty; required parameter") + } + return nil +} + +func checkForUniqueInArray(x reflect.Value) bool { + if x == reflect.Zero(reflect.TypeOf(x)) || x.Len() == 0 { + return false + } + arrOfInterface := make([]interface{}, x.Len()) + + for i := 0; i < x.Len(); i++ { + arrOfInterface[i] = x.Index(i).Interface() + } + + m := make(map[interface{}]bool) + for _, val := range arrOfInterface { + if m[val] { + return false + } + m[val] = true + } + return true +} + +func checkForUniqueInMap(x reflect.Value) bool { + if x == reflect.Zero(reflect.TypeOf(x)) || x.Len() == 0 { + return false + } + mapOfInterface := make(map[interface{}]interface{}, x.Len()) + + keys := x.MapKeys() + for _, k := range keys { + mapOfInterface[k.Interface()] = x.MapIndex(k).Interface() + } + + m := make(map[interface{}]bool) + for _, val := range mapOfInterface { + if m[val] { + return false + } + m[val] = true + } + return true +} + +func getInterfaceValue(x reflect.Value) interface{} { + if x.Kind() == reflect.Invalid { + return nil + } + return x.Interface() +} + +func isZero(x interface{}) bool { + return x == reflect.Zero(reflect.TypeOf(x)).Interface() +} + +func createError(x reflect.Value, v Constraint, err string) error { + return fmt.Errorf("autorest/validation: validation failed: parameter=%s constraint=%s value=%#v details: %s", + v.Target, v.Name, getInterfaceValue(x), err) +} + +// NewErrorWithValidationError appends package type and method name in +// validation error. +func NewErrorWithValidationError(err error, packageType, method string) error { + return fmt.Errorf("%s#%s: Invalid input: %v", packageType, method, err) +} From a8c5c8123e035ef0770e1bee6bc7e8b76aec3bba Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 6 Dec 2016 23:16:20 -0800 Subject: [PATCH 2/3] Update azure cloud provider for new azure SDK --- .../providers/azure/azure_instances.go | 2 +- .../providers/azure/azure_loadbalancer.go | 66 +++++++++---------- .../providers/azure/azure_routes.go | 24 +++---- .../providers/azure/azure_storage.go | 14 ++-- .../providers/azure/azure_util.go | 20 +++--- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/pkg/cloudprovider/providers/azure/azure_instances.go b/pkg/cloudprovider/providers/azure/azure_instances.go index 46178b4298e..41aeae31a40 100644 --- a/pkg/cloudprovider/providers/azure/azure_instances.go +++ b/pkg/cloudprovider/providers/azure/azure_instances.go @@ -68,7 +68,7 @@ func (az *Cloud) InstanceType(name types.NodeName) (string, error) { } else if !exists { return "", cloudprovider.InstanceNotFound } - return string(machine.Properties.HardwareProfile.VMSize), nil + return string(machine.HardwareProfile.VMSize), nil } // List lists instances that match 'filter' which is a regular expression which must match the entire instance name (fqdn) diff --git a/pkg/cloudprovider/providers/azure/azure_loadbalancer.go b/pkg/cloudprovider/providers/azure/azure_loadbalancer.go index 514fd6e70bd..86c99dd6c33 100644 --- a/pkg/cloudprovider/providers/azure/azure_loadbalancer.go +++ b/pkg/cloudprovider/providers/azure/azure_loadbalancer.go @@ -57,7 +57,7 @@ func (az *Cloud) GetLoadBalancer(clusterName string, service *v1.Service) (statu } return &v1.LoadBalancerStatus{ - Ingress: []v1.LoadBalancerIngress{{IP: *pip.Properties.IPAddress}}, + Ingress: []v1.LoadBalancerIngress{{IP: *pip.IPAddress}}, }, true, nil } @@ -95,9 +95,9 @@ func (az *Cloud) EnsureLoadBalancer(clusterName string, service *v1.Service, nod } if !existsLb { lb = network.LoadBalancer{ - Name: &lbName, - Location: &az.Location, - Properties: &network.LoadBalancerPropertiesFormat{}, + Name: &lbName, + Location: &az.Location, + LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{}, } } @@ -134,9 +134,9 @@ func (az *Cloud) EnsureLoadBalancer(clusterName string, service *v1.Service, nod return nil, utilerrors.Flatten(errs) } - glog.V(2).Infof("ensure(%s): FINISH - %s", serviceName, *pip.Properties.IPAddress) + glog.V(2).Infof("ensure(%s): FINISH - %s", serviceName, *pip.IPAddress) return &v1.LoadBalancerStatus{ - Ingress: []v1.LoadBalancerIngress{{IP: *pip.Properties.IPAddress}}, + Ingress: []v1.LoadBalancerIngress{{IP: *pip.IPAddress}}, }, nil } @@ -172,7 +172,7 @@ func (az *Cloud) EnsureLoadBalancerDeleted(clusterName string, service *v1.Servi return reconcileErr } if lbNeedsUpdate { - if len(*lb.Properties.FrontendIPConfigurations) > 0 { + if len(*lb.FrontendIPConfigurations) > 0 { glog.V(3).Infof("delete(%s): lb(%s) - updating", serviceName, lbName) _, err = az.LoadBalancerClient.CreateOrUpdate(az.ResourceGroup, *lb.Name, lb, nil) if err != nil { @@ -227,7 +227,7 @@ func (az *Cloud) ensurePublicIPExists(serviceName, pipName string) (*network.Pub pip.Name = to.StringPtr(pipName) pip.Location = to.StringPtr(az.Location) - pip.Properties = &network.PublicIPAddressPropertiesFormat{ + pip.PublicIPAddressPropertiesFormat = &network.PublicIPAddressPropertiesFormat{ PublicIPAllocationMethod: network.Static, } pip.Tags = &map[string]*string{"service": &serviceName} @@ -273,8 +273,8 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub // Ensure LoadBalancer's Backend Pool Configuration if wantLb { newBackendPools := []network.BackendAddressPool{} - if lb.Properties.BackendAddressPools != nil { - newBackendPools = *lb.Properties.BackendAddressPools + if lb.BackendAddressPools != nil { + newBackendPools = *lb.BackendAddressPools } foundBackendPool := false @@ -294,15 +294,15 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub glog.V(10).Infof("reconcile(%s)(%t): lb backendpool - adding backendpool", serviceName, wantLb) dirtyLb = true - lb.Properties.BackendAddressPools = &newBackendPools + lb.BackendAddressPools = &newBackendPools } } // Ensure LoadBalancer's Frontend IP Configurations dirtyConfigs := false newConfigs := []network.FrontendIPConfiguration{} - if lb.Properties.FrontendIPConfigurations != nil { - newConfigs = *lb.Properties.FrontendIPConfigurations + if lb.FrontendIPConfigurations != nil { + newConfigs = *lb.FrontendIPConfigurations } if !wantLb { for i := len(newConfigs) - 1; i >= 0; i-- { @@ -325,7 +325,7 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub newConfigs = append(newConfigs, network.FrontendIPConfiguration{ Name: to.StringPtr(lbFrontendIPConfigName), - Properties: &network.FrontendIPConfigurationPropertiesFormat{ + FrontendIPConfigurationPropertiesFormat: &network.FrontendIPConfigurationPropertiesFormat{ PublicIPAddress: &network.PublicIPAddress{ ID: pip.ID, }, @@ -337,7 +337,7 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub } if dirtyConfigs { dirtyLb = true - lb.Properties.FrontendIPConfigurations = &newConfigs + lb.FrontendIPConfigurations = &newConfigs } // update probes/rules @@ -356,7 +356,7 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub expectedProbes[i] = network.Probe{ Name: &lbRuleName, - Properties: &network.ProbePropertiesFormat{ + ProbePropertiesFormat: &network.ProbePropertiesFormat{ RequestPath: to.StringPtr(podPresencePath), Protocol: network.ProbeProtocolHTTP, Port: to.Int32Ptr(podPresencePort), @@ -367,7 +367,7 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub } else { expectedProbes[i] = network.Probe{ Name: &lbRuleName, - Properties: &network.ProbePropertiesFormat{ + ProbePropertiesFormat: &network.ProbePropertiesFormat{ Protocol: probeProto, Port: to.Int32Ptr(port.NodePort), IntervalInSeconds: to.Int32Ptr(5), @@ -378,7 +378,7 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub expectedRules[i] = network.LoadBalancingRule{ Name: &lbRuleName, - Properties: &network.LoadBalancingRulePropertiesFormat{ + LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{ Protocol: transportProto, FrontendIPConfiguration: &network.SubResource{ ID: to.StringPtr(lbFrontendIPConfigID), @@ -399,8 +399,8 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub // remove unwanted probes dirtyProbes := false var updatedProbes []network.Probe - if lb.Properties.Probes != nil { - updatedProbes = *lb.Properties.Probes + if lb.Probes != nil { + updatedProbes = *lb.Probes } for i := len(updatedProbes) - 1; i >= 0; i-- { existingProbe := updatedProbes[i] @@ -433,14 +433,14 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub } if dirtyProbes { dirtyLb = true - lb.Properties.Probes = &updatedProbes + lb.Probes = &updatedProbes } // update rules dirtyRules := false var updatedRules []network.LoadBalancingRule - if lb.Properties.LoadBalancingRules != nil { - updatedRules = *lb.Properties.LoadBalancingRules + if lb.LoadBalancingRules != nil { + updatedRules = *lb.LoadBalancingRules } // update rules: remove unwanted for i := len(updatedRules) - 1; i >= 0; i-- { @@ -474,7 +474,7 @@ func (az *Cloud) reconcileLoadBalancer(lb network.LoadBalancer, pip *network.Pub } if dirtyRules { dirtyLb = true - lb.Properties.LoadBalancingRules = &updatedRules + lb.LoadBalancingRules = &updatedRules } return lb, dirtyLb, nil @@ -510,7 +510,7 @@ func (az *Cloud) reconcileSecurityGroup(sg network.SecurityGroup, clusterName st ix := i*len(sourceAddressPrefixes) + j expectedSecurityRules[ix] = network.SecurityRule{ Name: to.StringPtr(securityRuleName), - Properties: &network.SecurityRulePropertiesFormat{ + SecurityRulePropertiesFormat: &network.SecurityRulePropertiesFormat{ Protocol: securityProto, SourcePortRange: to.StringPtr("*"), DestinationPortRange: to.StringPtr(strconv.Itoa(int(port.Port))), @@ -526,8 +526,8 @@ func (az *Cloud) reconcileSecurityGroup(sg network.SecurityGroup, clusterName st // update security rules dirtySg := false var updatedRules []network.SecurityRule - if sg.Properties.SecurityRules != nil { - updatedRules = *sg.Properties.SecurityRules + if sg.SecurityRules != nil { + updatedRules = *sg.SecurityRules } // update security rules: remove unwanted for i := len(updatedRules) - 1; i >= 0; i-- { @@ -561,13 +561,13 @@ func (az *Cloud) reconcileSecurityGroup(sg network.SecurityGroup, clusterName st return sg, false, err } - expectedRule.Properties.Priority = to.Int32Ptr(nextAvailablePriority) + expectedRule.Priority = to.Int32Ptr(nextAvailablePriority) updatedRules = append(updatedRules, expectedRule) dirtySg = true } } if dirtySg { - sg.Properties.SecurityRules = &updatedRules + sg.SecurityRules = &updatedRules } return sg, dirtySg, nil } @@ -620,7 +620,7 @@ func (az *Cloud) ensureHostInPool(serviceName string, nodeName types.NodeName, b // Check availability set if az.PrimaryAvailabilitySetName != "" { expectedAvailabilitySetName := az.getAvailabilitySetID(az.PrimaryAvailabilitySetName) - if !strings.EqualFold(*machine.Properties.AvailabilitySet.ID, expectedAvailabilitySetName) { + if !strings.EqualFold(*machine.AvailabilitySet.ID, expectedAvailabilitySetName) { glog.V(3).Infof( "nicupdate(%s): skipping nic (%s) since it is not in the primaryAvailabilitSet(%s)", serviceName, nicName, az.PrimaryAvailabilitySetName) @@ -641,8 +641,8 @@ func (az *Cloud) ensureHostInPool(serviceName string, nodeName types.NodeName, b foundPool := false newBackendPools := []network.BackendAddressPool{} - if primaryIPConfig.Properties.LoadBalancerBackendAddressPools != nil { - newBackendPools = *primaryIPConfig.Properties.LoadBalancerBackendAddressPools + if primaryIPConfig.LoadBalancerBackendAddressPools != nil { + newBackendPools = *primaryIPConfig.LoadBalancerBackendAddressPools } for _, existingPool := range newBackendPools { if strings.EqualFold(backendPoolID, *existingPool.ID) { @@ -656,7 +656,7 @@ func (az *Cloud) ensureHostInPool(serviceName string, nodeName types.NodeName, b ID: to.StringPtr(backendPoolID), }) - primaryIPConfig.Properties.LoadBalancerBackendAddressPools = &newBackendPools + primaryIPConfig.LoadBalancerBackendAddressPools = &newBackendPools glog.V(3).Infof("nicupdate(%s): nic(%s) - updating", serviceName, nicName) _, err := az.InterfacesClient.CreateOrUpdate(az.ResourceGroup, *nic.Name, nic, nil) diff --git a/pkg/cloudprovider/providers/azure/azure_routes.go b/pkg/cloudprovider/providers/azure/azure_routes.go index 23707fdf7b1..f7f763f49f0 100644 --- a/pkg/cloudprovider/providers/azure/azure_routes.go +++ b/pkg/cloudprovider/providers/azure/azure_routes.go @@ -39,11 +39,11 @@ func (az *Cloud) ListRoutes(clusterName string) (routes []*cloudprovider.Route, } var kubeRoutes []*cloudprovider.Route - if routeTable.Properties.Routes != nil { - kubeRoutes = make([]*cloudprovider.Route, len(*routeTable.Properties.Routes)) - for i, route := range *routeTable.Properties.Routes { + if routeTable.Routes != nil { + kubeRoutes = make([]*cloudprovider.Route, len(*routeTable.Routes)) + for i, route := range *routeTable.Routes { instance := mapRouteNameToNodeName(*route.Name) - cidr := *route.Properties.AddressPrefix + cidr := *route.AddressPrefix glog.V(10).Infof("list: * instance=%q, cidr=%q", instance, cidr) kubeRoutes[i] = &cloudprovider.Route{ @@ -70,9 +70,9 @@ func (az *Cloud) CreateRoute(clusterName string, nameHint string, kubeRoute *clo } if !existsRouteTable { routeTable = network.RouteTable{ - Name: to.StringPtr(az.RouteTableName), - Location: to.StringPtr(az.Location), - Properties: &network.RouteTablePropertiesFormat{}, + Name: to.StringPtr(az.RouteTableName), + Location: to.StringPtr(az.Location), + RouteTablePropertiesFormat: &network.RouteTablePropertiesFormat{}, } glog.V(3).Infof("create: creating routetable. routeTableName=%q", az.RouteTableName) @@ -93,12 +93,12 @@ func (az *Cloud) CreateRoute(clusterName string, nameHint string, kubeRoute *clo // 404 is fatal here return err } - if subnet.Properties.RouteTable != nil { - if *subnet.Properties.RouteTable.ID != *routeTable.ID { - return fmt.Errorf("The subnet has a route table, but it was unrecognized. Refusing to modify it. active_routetable=%q expected_routetable=%q", *subnet.Properties.RouteTable.ID, *routeTable.ID) + if subnet.RouteTable != nil { + if *subnet.RouteTable.ID != *routeTable.ID { + return fmt.Errorf("The subnet has a route table, but it was unrecognized. Refusing to modify it. active_routetable=%q expected_routetable=%q", *subnet.RouteTable.ID, *routeTable.ID) } } else { - subnet.Properties.RouteTable = &network.RouteTable{ + subnet.RouteTable = &network.RouteTable{ ID: routeTable.ID, } glog.V(3).Info("create: updating subnet") @@ -116,7 +116,7 @@ func (az *Cloud) CreateRoute(clusterName string, nameHint string, kubeRoute *clo routeName := mapNodeNameToRouteName(kubeRoute.TargetNode) route := network.Route{ Name: to.StringPtr(routeName), - Properties: &network.RoutePropertiesFormat{ + RoutePropertiesFormat: &network.RoutePropertiesFormat{ AddressPrefix: to.StringPtr(kubeRoute.DestinationCIDR), NextHopType: network.RouteNextHopTypeVirtualAppliance, NextHopIPAddress: to.StringPtr(targetIP), diff --git a/pkg/cloudprovider/providers/azure/azure_storage.go b/pkg/cloudprovider/providers/azure/azure_storage.go index 490ee8a3cf9..b69e3cdffb4 100644 --- a/pkg/cloudprovider/providers/azure/azure_storage.go +++ b/pkg/cloudprovider/providers/azure/azure_storage.go @@ -39,7 +39,7 @@ func (az *Cloud) AttachDisk(diskName, diskURI string, nodeName types.NodeName, l } else if !exists { return cloudprovider.InstanceNotFound } - disks := *vm.Properties.StorageProfile.DataDisks + disks := *vm.StorageProfile.DataDisks disks = append(disks, compute.DataDisk{ Name: &diskName, @@ -53,7 +53,7 @@ func (az *Cloud) AttachDisk(diskName, diskURI string, nodeName types.NodeName, l newVM := compute.VirtualMachine{ Location: vm.Location, - Properties: &compute.VirtualMachineProperties{ + VirtualMachineProperties: &compute.VirtualMachineProperties{ StorageProfile: &compute.StorageProfile{ DataDisks: &disks, }, @@ -91,7 +91,7 @@ func (az *Cloud) DisksAreAttached(diskNames []string, nodeName types.NodeName) ( return attached, err } - disks := *vm.Properties.StorageProfile.DataDisks + disks := *vm.StorageProfile.DataDisks for _, disk := range disks { for _, diskName := range diskNames { if disk.Name != nil && diskName != "" && *disk.Name == diskName { @@ -113,7 +113,7 @@ func (az *Cloud) DetachDiskByName(diskName, diskURI string, nodeName types.NodeN return nil } - disks := *vm.Properties.StorageProfile.DataDisks + disks := *vm.StorageProfile.DataDisks for i, disk := range disks { if (disk.Name != nil && diskName != "" && *disk.Name == diskName) || (disk.Vhd.URI != nil && diskURI != "" && *disk.Vhd.URI == diskURI) { // found the disk @@ -124,7 +124,7 @@ func (az *Cloud) DetachDiskByName(diskName, diskURI string, nodeName types.NodeN } newVM := compute.VirtualMachine{ Location: vm.Location, - Properties: &compute.VirtualMachineProperties{ + VirtualMachineProperties: &compute.VirtualMachineProperties{ StorageProfile: &compute.StorageProfile{ DataDisks: &disks, }, @@ -148,7 +148,7 @@ func (az *Cloud) GetDiskLun(diskName, diskURI string, nodeName types.NodeName) ( } else if !exists { return -1, cloudprovider.InstanceNotFound } - disks := *vm.Properties.StorageProfile.DataDisks + disks := *vm.StorageProfile.DataDisks for _, disk := range disks { if disk.Lun != nil && (disk.Name != nil && diskName != "" && *disk.Name == diskName) || (disk.Vhd.URI != nil && diskURI != "" && *disk.Vhd.URI == diskURI) { // found the disk @@ -169,7 +169,7 @@ func (az *Cloud) GetNextDiskLun(nodeName types.NodeName) (int32, error) { return -1, cloudprovider.InstanceNotFound } used := make([]bool, maxLUN) - disks := *vm.Properties.StorageProfile.DataDisks + disks := *vm.StorageProfile.DataDisks for _, disk := range disks { if disk.Lun != nil { used[*disk.Lun] = true diff --git a/pkg/cloudprovider/providers/azure/azure_util.go b/pkg/cloudprovider/providers/azure/azure_util.go index ff9cbe48df8..0c500b071ad 100644 --- a/pkg/cloudprovider/providers/azure/azure_util.go +++ b/pkg/cloudprovider/providers/azure/azure_util.go @@ -133,12 +133,12 @@ func getProtocolsFromKubernetesProtocol(protocol v1.Protocol) (network.Transport // This returns the full identifier of the primary NIC for the given VM. func getPrimaryInterfaceID(machine compute.VirtualMachine) (string, error) { - if len(*machine.Properties.NetworkProfile.NetworkInterfaces) == 1 { - return *(*machine.Properties.NetworkProfile.NetworkInterfaces)[0].ID, nil + if len(*machine.NetworkProfile.NetworkInterfaces) == 1 { + return *(*machine.NetworkProfile.NetworkInterfaces)[0].ID, nil } - for _, ref := range *machine.Properties.NetworkProfile.NetworkInterfaces { - if *ref.Properties.Primary { + for _, ref := range *machine.NetworkProfile.NetworkInterfaces { + if *ref.Primary { return *ref.ID, nil } } @@ -147,12 +147,12 @@ func getPrimaryInterfaceID(machine compute.VirtualMachine) (string, error) { } func getPrimaryIPConfig(nic network.Interface) (*network.InterfaceIPConfiguration, error) { - if len(*nic.Properties.IPConfigurations) == 1 { - return &((*nic.Properties.IPConfigurations)[0]), nil + if len(*nic.IPConfigurations) == 1 { + return &((*nic.IPConfigurations)[0]), nil } - for _, ref := range *nic.Properties.IPConfigurations { - if *ref.Properties.Primary { + for _, ref := range *nic.IPConfigurations { + if *ref.Primary { return &ref, nil } } @@ -204,7 +204,7 @@ func getNextAvailablePriority(rules []network.SecurityRule) (int32, error) { outer: for smallest < loadBalancerMaximumPriority { for _, rule := range rules { - if *rule.Properties.Priority == smallest { + if *rule.Priority == smallest { smallest += spread continue outer } @@ -245,6 +245,6 @@ func (az *Cloud) getIPForMachine(nodeName types.NodeName) (string, error) { return "", err } - targetIP := *ipConfig.Properties.PrivateIPAddress + targetIP := *ipConfig.PrivateIPAddress return targetIP, nil } From 91f19e3dfc1f5c282032122beefa71d7ab026561 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 6 Dec 2016 23:16:53 -0800 Subject: [PATCH 3/3] Add an azure container registry credential provider. --- cmd/kubelet/app/BUILD | 1 + cmd/kubelet/app/plugins.go | 1 + hack/verify-flags/known-flags.txt | 1 + .../providers/azure/azure_test.go | 56 +- pkg/credentialprovider/azure/BUILD | 37 + .../azure/azure_credentials.go | 144 ++++ .../azure/azure_credentials_test.go | 81 ++ vendor/BUILD | 720 +++++++++--------- 8 files changed, 665 insertions(+), 376 deletions(-) create mode 100644 pkg/credentialprovider/azure/BUILD create mode 100644 pkg/credentialprovider/azure/azure_credentials.go create mode 100644 pkg/credentialprovider/azure/azure_credentials_test.go diff --git a/cmd/kubelet/app/BUILD b/cmd/kubelet/app/BUILD index 22a3d5494cd..6798e50fa6d 100644 --- a/cmd/kubelet/app/BUILD +++ b/cmd/kubelet/app/BUILD @@ -45,6 +45,7 @@ go_library( "//pkg/cloudprovider/providers:go_default_library", "//pkg/credentialprovider:go_default_library", "//pkg/credentialprovider/aws:go_default_library", + "//pkg/credentialprovider/azure:go_default_library", "//pkg/credentialprovider/gcp:go_default_library", "//pkg/genericapiserver/authorizer:go_default_library", "//pkg/healthz:go_default_library", diff --git a/cmd/kubelet/app/plugins.go b/cmd/kubelet/app/plugins.go index d125852622f..89f8bb5a085 100644 --- a/cmd/kubelet/app/plugins.go +++ b/cmd/kubelet/app/plugins.go @@ -20,6 +20,7 @@ package app import ( // Credential providers _ "k8s.io/kubernetes/pkg/credentialprovider/aws" + _ "k8s.io/kubernetes/pkg/credentialprovider/azure" _ "k8s.io/kubernetes/pkg/credentialprovider/gcp" // Network plugins "k8s.io/kubernetes/pkg/kubelet/network" diff --git a/hack/verify-flags/known-flags.txt b/hack/verify-flags/known-flags.txt index fe0718977eb..38e9a325d40 100644 --- a/hack/verify-flags/known-flags.txt +++ b/hack/verify-flags/known-flags.txt @@ -43,6 +43,7 @@ authorization-rbac-super-user authorization-webhook-cache-authorized-ttl authorization-webhook-cache-unauthorized-ttl authorization-webhook-config-file +azure-container-registry-config babysit-daemons basic-auth-file bench-pods diff --git a/pkg/cloudprovider/providers/azure/azure_test.go b/pkg/cloudprovider/providers/azure/azure_test.go index d27f59c2f2e..13930793707 100644 --- a/pkg/cloudprovider/providers/azure/azure_test.go +++ b/pkg/cloudprovider/providers/azure/azure_test.go @@ -50,7 +50,7 @@ func TestReconcileLoadBalancerAddPort(t *testing.T) { } // ensure we got a frontend ip configuration - if len(*lb.Properties.FrontendIPConfigurations) != 1 { + if len(*lb.FrontendIPConfigurations) != 1 { t.Error("Expected the loadbalancer to have a frontend ip configuration") } @@ -79,7 +79,7 @@ func TestReconcileLoadBalancerNodeHealth(t *testing.T) { } // ensure we got a frontend ip configuration - if len(*lb.Properties.FrontendIPConfigurations) != 1 { + if len(*lb.FrontendIPConfigurations) != 1 { t.Error("Expected the loadbalancer to have a frontend ip configuration") } @@ -110,7 +110,7 @@ func TestReconcileLoadBalancerRemoveAllPortsRemovesFrontendConfig(t *testing.T) } // ensure we abandoned the frontend ip configuration - if len(*lb.Properties.FrontendIPConfigurations) != 0 { + if len(*lb.FrontendIPConfigurations) != 0 { t.Error("Expected the loadbalancer to have no frontend ip configuration") } @@ -262,14 +262,14 @@ func getTestLoadBalancer(services ...v1.Service) network.LoadBalancer { ruleName := getRuleName(&service, port) rules = append(rules, network.LoadBalancingRule{ Name: to.StringPtr(ruleName), - Properties: &network.LoadBalancingRulePropertiesFormat{ + LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{ FrontendPort: to.Int32Ptr(port.Port), BackendPort: to.Int32Ptr(port.Port), }, }) probes = append(probes, network.Probe{ Name: to.StringPtr(ruleName), - Properties: &network.ProbePropertiesFormat{ + ProbePropertiesFormat: &network.ProbePropertiesFormat{ Port: to.Int32Ptr(port.NodePort), }, }) @@ -277,7 +277,7 @@ func getTestLoadBalancer(services ...v1.Service) network.LoadBalancer { } lb := network.LoadBalancer{ - Properties: &network.LoadBalancerPropertiesFormat{ + LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{ LoadBalancingRules: &rules, Probes: &probes, }, @@ -304,7 +304,7 @@ func getTestSecurityGroup(services ...v1.Service) network.SecurityGroup { for _, src := range sources { rules = append(rules, network.SecurityRule{ Name: to.StringPtr(ruleName), - Properties: &network.SecurityRulePropertiesFormat{ + SecurityRulePropertiesFormat: &network.SecurityRulePropertiesFormat{ SourceAddressPrefix: to.StringPtr(src), DestinationPortRange: to.StringPtr(fmt.Sprintf("%d", port.Port)), }, @@ -314,7 +314,7 @@ func getTestSecurityGroup(services ...v1.Service) network.SecurityGroup { } sg := network.SecurityGroup{ - Properties: &network.SecurityGroupPropertiesFormat{ + SecurityGroupPropertiesFormat: &network.SecurityGroupPropertiesFormat{ SecurityRules: &rules, }, } @@ -329,10 +329,10 @@ func validateLoadBalancer(t *testing.T, loadBalancer network.LoadBalancer, servi expectedRuleCount++ wantedRuleName := getRuleName(&svc, wantedRule) foundRule := false - for _, actualRule := range *loadBalancer.Properties.LoadBalancingRules { + for _, actualRule := range *loadBalancer.LoadBalancingRules { if strings.EqualFold(*actualRule.Name, wantedRuleName) && - *actualRule.Properties.FrontendPort == wantedRule.Port && - *actualRule.Properties.BackendPort == wantedRule.Port { + *actualRule.FrontendPort == wantedRule.Port && + *actualRule.BackendPort == wantedRule.Port { foundRule = true break } @@ -344,38 +344,38 @@ func validateLoadBalancer(t *testing.T, loadBalancer network.LoadBalancer, servi foundProbe := false if serviceapi.NeedsHealthCheck(&svc) { path, port := serviceapi.GetServiceHealthCheckPathPort(&svc) - for _, actualProbe := range *loadBalancer.Properties.Probes { + for _, actualProbe := range *loadBalancer.Probes { if strings.EqualFold(*actualProbe.Name, wantedRuleName) && - *actualProbe.Properties.Port == port && - *actualProbe.Properties.RequestPath == path && - actualProbe.Properties.Protocol == network.ProbeProtocolHTTP { + *actualProbe.Port == port && + *actualProbe.RequestPath == path && + actualProbe.Protocol == network.ProbeProtocolHTTP { foundProbe = true break } } } else { - for _, actualProbe := range *loadBalancer.Properties.Probes { + for _, actualProbe := range *loadBalancer.Probes { if strings.EqualFold(*actualProbe.Name, wantedRuleName) && - *actualProbe.Properties.Port == wantedRule.NodePort { + *actualProbe.Port == wantedRule.NodePort { foundProbe = true break } } } if !foundProbe { - for _, actualProbe := range *loadBalancer.Properties.Probes { - t.Logf("Probe: %s %d", *actualProbe.Name, *actualProbe.Properties.Port) + for _, actualProbe := range *loadBalancer.Probes { + t.Logf("Probe: %s %d", *actualProbe.Name, *actualProbe.Port) } t.Errorf("Expected loadbalancer probe but didn't find it: %q", wantedRuleName) } } } - lenRules := len(*loadBalancer.Properties.LoadBalancingRules) + lenRules := len(*loadBalancer.LoadBalancingRules) if lenRules != expectedRuleCount { - t.Errorf("Expected the loadbalancer to have %d rules. Found %d.\n%v", expectedRuleCount, lenRules, loadBalancer.Properties.LoadBalancingRules) + t.Errorf("Expected the loadbalancer to have %d rules. Found %d.\n%v", expectedRuleCount, lenRules, loadBalancer.LoadBalancingRules) } - lenProbes := len(*loadBalancer.Properties.Probes) + lenProbes := len(*loadBalancer.Probes) if lenProbes != expectedRuleCount { t.Errorf("Expected the loadbalancer to have %d probes. Found %d.", expectedRuleCount, lenProbes) } @@ -391,10 +391,10 @@ func validateSecurityGroup(t *testing.T, securityGroup network.SecurityGroup, se expectedRuleCount++ wantedRuleName := getRuleName(&svc, wantedRule) foundRule := false - for _, actualRule := range *securityGroup.Properties.SecurityRules { + for _, actualRule := range *securityGroup.SecurityRules { if strings.EqualFold(*actualRule.Name, wantedRuleName) && - *actualRule.Properties.SourceAddressPrefix == source && - *actualRule.Properties.DestinationPortRange == fmt.Sprintf("%d", wantedRule.Port) { + *actualRule.SourceAddressPrefix == source && + *actualRule.DestinationPortRange == fmt.Sprintf("%d", wantedRule.Port) { foundRule = true break } @@ -406,7 +406,7 @@ func validateSecurityGroup(t *testing.T, securityGroup network.SecurityGroup, se } } - lenRules := len(*securityGroup.Properties.SecurityRules) + lenRules := len(*securityGroup.SecurityRules) if lenRules != expectedRuleCount { t.Errorf("Expected the loadbalancer to have %d rules. Found %d.\n", expectedRuleCount, lenRules) } @@ -420,7 +420,7 @@ func TestSecurityRulePriorityPicksNextAvailablePriority(t *testing.T) { var i int32 for i = loadBalancerMinimumPriority; i < expectedPriority; i++ { rules = append(rules, network.SecurityRule{ - Properties: &network.SecurityRulePropertiesFormat{ + SecurityRulePropertiesFormat: &network.SecurityRulePropertiesFormat{ Priority: to.Int32Ptr(i), }, }) @@ -442,7 +442,7 @@ func TestSecurityRulePriorityFailsIfExhausted(t *testing.T) { var i int32 for i = loadBalancerMinimumPriority; i < loadBalancerMaximumPriority; i++ { rules = append(rules, network.SecurityRule{ - Properties: &network.SecurityRulePropertiesFormat{ + SecurityRulePropertiesFormat: &network.SecurityRulePropertiesFormat{ Priority: to.Int32Ptr(i), }, }) diff --git a/pkg/credentialprovider/azure/BUILD b/pkg/credentialprovider/azure/BUILD new file mode 100644 index 00000000000..ef0a7591e9d --- /dev/null +++ b/pkg/credentialprovider/azure/BUILD @@ -0,0 +1,37 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +load( + "@io_bazel_rules_go//go:def.bzl", + "go_binary", + "go_library", + "go_test", + "cgo_library", +) + +go_library( + name = "go_default_library", + srcs = ["azure_credentials.go"], + tags = ["automanaged"], + deps = [ + "//pkg/cloudprovider/providers/azure:go_default_library", + "//pkg/credentialprovider:go_default_library", + "//vendor:github.com/Azure/azure-sdk-for-go/arm/containerregistry", + "//vendor:github.com/Azure/go-autorest/autorest/azure", + "//vendor:github.com/golang/glog", + "//vendor:github.com/spf13/pflag", + "//vendor:gopkg.in/yaml.v2", + ], +) + +go_test( + name = "go_default_test", + srcs = ["azure_credentials_test.go"], + library = "go_default_library", + tags = ["automanaged"], + deps = [ + "//vendor:github.com/Azure/azure-sdk-for-go/arm/containerregistry", + "//vendor:github.com/Azure/go-autorest/autorest/to", + ], +) diff --git a/pkg/credentialprovider/azure/azure_credentials.go b/pkg/credentialprovider/azure/azure_credentials.go new file mode 100644 index 00000000000..b0191567f64 --- /dev/null +++ b/pkg/credentialprovider/azure/azure_credentials.go @@ -0,0 +1,144 @@ +/* +Copyright 2016 The Kubernetes 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 azure + +import ( + "fmt" + "io/ioutil" + "time" + + yaml "gopkg.in/yaml.v2" + + "github.com/Azure/azure-sdk-for-go/arm/containerregistry" + azureapi "github.com/Azure/go-autorest/autorest/azure" + "github.com/golang/glog" + "github.com/spf13/pflag" + "k8s.io/kubernetes/pkg/cloudprovider/providers/azure" + "k8s.io/kubernetes/pkg/credentialprovider" +) + +var flagConfigFile = pflag.String("azure-container-registry-config", "", + "Path to the file container Azure container registry configuration information.") + +const dummyRegistryEmail = "name@contoso.com" + +// init registers the various means by which credentials may +// be resolved on Azure. +func init() { + credentialprovider.RegisterCredentialProvider("azure", + &credentialprovider.CachingDockerConfigProvider{ + Provider: NewACRProvider(flagConfigFile), + Lifetime: 1 * time.Minute, + }) +} + +type RegistriesClient interface { + List() (containerregistry.RegistryListResult, error) +} + +func NewACRProvider(configFile *string) credentialprovider.DockerConfigProvider { + return &acrProvider{ + file: configFile, + } +} + +type acrProvider struct { + file *string + config azure.Config + environment azureapi.Environment + registryClient RegistriesClient +} + +func (a *acrProvider) loadConfig(contents []byte) error { + err := yaml.Unmarshal(contents, &a.config) + if err != nil { + return err + } + + if a.config.Cloud == "" { + a.environment = azureapi.PublicCloud + } else { + a.environment, err = azureapi.EnvironmentFromName(a.config.Cloud) + if err != nil { + return err + } + } + return nil +} + +func (a *acrProvider) Enabled() bool { + if a.file == nil || len(*a.file) == 0 { + glog.V(5).Infof("Azure config unspecified, disabling") + return false + } + contents, err := ioutil.ReadFile(*a.file) + if err != nil { + glog.Errorf("Failed to load azure credential file: %v", err) + return false + } + if err := a.loadConfig(contents); err != nil { + glog.Errorf("Failed to parse azure credential file: %v", err) + return false + } + + oauthConfig, err := a.environment.OAuthConfigForTenant(a.config.TenantID) + if err != nil { + glog.Errorf("Failed to get oauth config: %v", err) + return false + } + + servicePrincipalToken, err := azureapi.NewServicePrincipalToken( + *oauthConfig, + a.config.AADClientID, + a.config.AADClientSecret, + a.environment.ServiceManagementEndpoint) + if err != nil { + glog.Errorf("Failed to create service principal token: %v", err) + return false + } + + registryClient := containerregistry.NewRegistriesClient(a.config.SubscriptionID) + registryClient.BaseURI = a.environment.ResourceManagerEndpoint + registryClient.Authorizer = servicePrincipalToken + a.registryClient = registryClient + + return true +} + +func (a *acrProvider) Provide() credentialprovider.DockerConfig { + cfg := credentialprovider.DockerConfig{} + entry := credentialprovider.DockerConfigEntry{ + Username: a.config.AADClientID, + Password: a.config.AADClientSecret, + Email: dummyRegistryEmail, + } + + res, err := a.registryClient.List() + if err != nil { + glog.Errorf("Failed to list registries: %v", err) + return cfg + } + for ix := range *res.Value { + // TODO: I don't think this will work for national clouds + cfg[fmt.Sprintf("%s.azurecr.io", *(*res.Value)[ix].Name)] = entry + } + return cfg +} + +func (a *acrProvider) LazyProvide() *credentialprovider.DockerConfigEntry { + return nil +} diff --git a/pkg/credentialprovider/azure/azure_credentials_test.go b/pkg/credentialprovider/azure/azure_credentials_test.go new file mode 100644 index 00000000000..d034f90e4d4 --- /dev/null +++ b/pkg/credentialprovider/azure/azure_credentials_test.go @@ -0,0 +1,81 @@ +/* +Copyright 2016 The Kubernetes 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 azure + +import ( + "testing" + + "github.com/Azure/azure-sdk-for-go/arm/containerregistry" + "github.com/Azure/go-autorest/autorest/to" +) + +type fakeClient struct { + results containerregistry.RegistryListResult +} + +func (f *fakeClient) List() (containerregistry.RegistryListResult, error) { + return f.results, nil +} + +func Test(t *testing.T) { + configStr := ` + { + "aadClientId": "foo", + "aadClientSecret": "bar" + }` + result := containerregistry.RegistryListResult{ + Value: &[]containerregistry.Registry{ + { + Name: to.StringPtr("foo"), + }, + { + Name: to.StringPtr("bar"), + }, + { + Name: to.StringPtr("baz"), + }, + }, + } + fakeClient := &fakeClient{ + results: result, + } + + provider := &acrProvider{ + registryClient: fakeClient, + } + provider.loadConfig([]byte(configStr)) + + creds := provider.Provide() + + if len(creds) != len(*result.Value) { + t.Errorf("Unexpected list: %v, expected length %d", creds, len(*result.Value)) + } + for _, cred := range creds { + if cred.Username != "foo" { + t.Errorf("expected 'foo' for username, saw: %v", cred.Username) + } + if cred.Password != "bar" { + t.Errorf("expected 'bar' for password, saw: %v", cred.Username) + } + } + for _, val := range *result.Value { + registryName := *val.Name + ".azurecr.io" + if _, found := creds[registryName]; !found { + t.Errorf("Missing expected registry: %s", registryName) + } + } +} diff --git a/vendor/BUILD b/vendor/BUILD index 3615701aa68..8ef0aa4d863 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -64,6 +64,25 @@ go_library( "//vendor:github.com/Azure/go-autorest/autorest/azure", "//vendor:github.com/Azure/go-autorest/autorest/date", "//vendor:github.com/Azure/go-autorest/autorest/to", + "//vendor:github.com/Azure/go-autorest/autorest/validation", + ], +) + +go_library( + name = "github.com/Azure/azure-sdk-for-go/arm/containerregistry", + srcs = [ + "github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go", + "github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go", + "github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go", + "github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/Azure/go-autorest/autorest", + "//vendor:github.com/Azure/go-autorest/autorest/azure", + "//vendor:github.com/Azure/go-autorest/autorest/date", + "//vendor:github.com/Azure/go-autorest/autorest/to", + "//vendor:github.com/Azure/go-autorest/autorest/validation", ], ) @@ -98,6 +117,7 @@ go_library( "//vendor:github.com/Azure/go-autorest/autorest", "//vendor:github.com/Azure/go-autorest/autorest/azure", "//vendor:github.com/Azure/go-autorest/autorest/to", + "//vendor:github.com/Azure/go-autorest/autorest/validation", ], ) @@ -115,6 +135,7 @@ go_library( "//vendor:github.com/Azure/go-autorest/autorest", "//vendor:github.com/Azure/go-autorest/autorest/azure", "//vendor:github.com/Azure/go-autorest/autorest/date", + "//vendor:github.com/Azure/go-autorest/autorest/validation", ], ) @@ -147,10 +168,7 @@ go_library( "github.com/Azure/go-ansiterm/parser.go", "github.com/Azure/go-ansiterm/parser_action_helpers.go", "github.com/Azure/go-ansiterm/parser_actions.go", - "github.com/Azure/go-ansiterm/parser_test_helpers.go", - "github.com/Azure/go-ansiterm/parser_test_utilities.go", "github.com/Azure/go-ansiterm/states.go", - "github.com/Azure/go-ansiterm/test_event_handler.go", "github.com/Azure/go-ansiterm/utilities.go", ], tags = ["automanaged"], @@ -208,6 +226,12 @@ go_library( tags = ["automanaged"], ) +go_library( + name = "github.com/Azure/go-autorest/autorest/validation", + srcs = ["github.com/Azure/go-autorest/autorest/validation/validation.go"], + tags = ["automanaged"], +) + go_library( name = "github.com/MakeNowJust/heredoc", srcs = ["github.com/MakeNowJust/heredoc/heredoc.go"], @@ -4408,6 +4432,16 @@ go_library( tags = ["automanaged"], ) +go_library( + name = "github.com/miekg/coredns/middleware/etcd/msg", + srcs = [ + "github.com/miekg/coredns/middleware/etcd/msg/path.go", + "github.com/miekg/coredns/middleware/etcd/msg/service.go", + ], + tags = ["automanaged"], + deps = ["//vendor:github.com/miekg/dns"], +) + go_library( name = "github.com/miekg/dns", srcs = [ @@ -5633,6 +5667,21 @@ go_library( ], ) +go_library( + name = "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers", + srcs = [ + "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/requests.go", + "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go", + "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/urls.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/mitchellh/mapstructure", + "//vendor:github.com/rackspace/gophercloud", + "//vendor:github.com/rackspace/gophercloud/pagination", + ], +) + go_library( name = "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/members", srcs = [ @@ -6682,6 +6731,44 @@ go_library( tags = ["automanaged"], ) +go_library( + name = "github.com/vmware/photon-controller-go-sdk/photon", + srcs = [ + "github.com/vmware/photon-controller-go-sdk/photon/apitypes.go", + "github.com/vmware/photon-controller-go-sdk/photon/auth.go", + "github.com/vmware/photon-controller-go-sdk/photon/availabilityzones.go", + "github.com/vmware/photon-controller-go-sdk/photon/client.go", + "github.com/vmware/photon-controller-go-sdk/photon/clusters.go", + "github.com/vmware/photon-controller-go-sdk/photon/deployments.go", + "github.com/vmware/photon-controller-go-sdk/photon/disks.go", + "github.com/vmware/photon-controller-go-sdk/photon/flavors.go", + "github.com/vmware/photon-controller-go-sdk/photon/hosts.go", + "github.com/vmware/photon-controller-go-sdk/photon/images.go", + "github.com/vmware/photon-controller-go-sdk/photon/info.go", + "github.com/vmware/photon-controller-go-sdk/photon/networks.go", + "github.com/vmware/photon-controller-go-sdk/photon/projects.go", + "github.com/vmware/photon-controller-go-sdk/photon/resourcetickets.go", + "github.com/vmware/photon-controller-go-sdk/photon/restclient.go", + "github.com/vmware/photon-controller-go-sdk/photon/status.go", + "github.com/vmware/photon-controller-go-sdk/photon/tasks.go", + "github.com/vmware/photon-controller-go-sdk/photon/tenants.go", + "github.com/vmware/photon-controller-go-sdk/photon/util.go", + "github.com/vmware/photon-controller-go-sdk/photon/virtualnetworks.go", + "github.com/vmware/photon-controller-go-sdk/photon/vms.go", + ], + tags = ["automanaged"], + deps = ["//vendor:github.com/vmware/photon-controller-go-sdk/photon/lightwave"], +) + +go_library( + name = "github.com/vmware/photon-controller-go-sdk/photon/lightwave", + srcs = [ + "github.com/vmware/photon-controller-go-sdk/photon/lightwave/jwttoken.go", + "github.com/vmware/photon-controller-go-sdk/photon/lightwave/oidcclient.go", + ], + tags = ["automanaged"], +) + go_library( name = "github.com/xanzy/go-cloudstack/cloudstack", srcs = [ @@ -8092,6 +8179,12 @@ go_library( tags = ["automanaged"], ) +go_library( + name = "k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib", + srcs = ["k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib/difflib.go"], + tags = ["automanaged"], +) + go_library( name = "k8s.io/client-go/_vendor/github.com/spf13/pflag", srcs = [ @@ -8122,6 +8215,22 @@ go_library( tags = ["automanaged"], ) +go_library( + name = "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert", + srcs = [ + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/assertions.go", + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/doc.go", + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/errors.go", + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/forward_assertions.go", + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/http_assertions.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/davecgh/go-spew/spew", + "//vendor:github.com/pmezard/go-difflib/difflib", + ], +) + go_library( name = "k8s.io/client-go/_vendor/github.com/ugorji/go/codec", srcs = [ @@ -8718,6 +8827,48 @@ go_library( ], ) +go_library( + name = "k8s.io/client-go/kubernetes/typed/apps/v1beta1", + srcs = [ + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apimachinery/registered", + "//vendor:k8s.io/client-go/pkg/apis/apps/v1beta1", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/runtime/serializer", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake", + srcs = [ + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1beta1", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/apps/v1beta1", + "//vendor:k8s.io/client-go/pkg/labels", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + "//vendor:k8s.io/client-go/testing", + ], +) + go_library( name = "k8s.io/client-go/kubernetes/typed/authentication/v1beta1", srcs = [ @@ -8885,6 +9036,50 @@ go_library( ], ) +go_library( + name = "k8s.io/client-go/kubernetes/typed/batch/v2alpha1", + srcs = [ + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apimachinery/registered", + "//vendor:k8s.io/client-go/pkg/apis/batch/v2alpha1", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/runtime/serializer", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake", + srcs = [ + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/kubernetes/typed/batch/v2alpha1", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/batch/v2alpha1", + "//vendor:k8s.io/client-go/pkg/labels", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + "//vendor:k8s.io/client-go/testing", + ], +) + go_library( name = "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1", srcs = [ @@ -9119,6 +9314,48 @@ go_library( ], ) +go_library( + name = "k8s.io/client-go/kubernetes/typed/policy/v1beta1", + srcs = [ + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apimachinery/registered", + "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/runtime/serializer", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake", + srcs = [ + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1beta1", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", + "//vendor:k8s.io/client-go/pkg/labels", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + "//vendor:k8s.io/client-go/testing", + ], +) + go_library( name = "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1", srcs = [ @@ -9520,6 +9757,39 @@ go_library( ], ) +go_library( + name = "k8s.io/client-go/pkg/apis/apps/v1beta1", + srcs = [ + "k8s.io/client-go/pkg/apis/apps/v1beta1/conversion.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/defaults.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/doc.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/generated.pb.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/register.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/types.generated.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/types.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.conversion.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.defaults.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/gogo/protobuf/proto", + "//vendor:github.com/ugorji/go/codec", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/resource", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/apps", + "//vendor:k8s.io/client-go/pkg/apis/meta/v1", + "//vendor:k8s.io/client-go/pkg/conversion", + "//vendor:k8s.io/client-go/pkg/runtime", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/types", + "//vendor:k8s.io/client-go/pkg/util/intstr", + "//vendor:k8s.io/client-go/pkg/watch/versioned", + ], +) + go_library( name = "k8s.io/client-go/pkg/apis/authentication", srcs = [ @@ -10111,6 +10381,37 @@ go_library( ], ) +go_library( + name = "k8s.io/client-go/pkg/apis/meta/v1", + srcs = [ + "k8s.io/client-go/pkg/apis/meta/v1/doc.go", + "k8s.io/client-go/pkg/apis/meta/v1/duration.go", + "k8s.io/client-go/pkg/apis/meta/v1/generated.pb.go", + "k8s.io/client-go/pkg/apis/meta/v1/group_version.go", + "k8s.io/client-go/pkg/apis/meta/v1/helpers.go", + "k8s.io/client-go/pkg/apis/meta/v1/meta.go", + "k8s.io/client-go/pkg/apis/meta/v1/register.go", + "k8s.io/client-go/pkg/apis/meta/v1/time.go", + "k8s.io/client-go/pkg/apis/meta/v1/time_proto.go", + "k8s.io/client-go/pkg/apis/meta/v1/types.go", + "k8s.io/client-go/pkg/apis/meta/v1/types_swagger_doc_generated.go", + "k8s.io/client-go/pkg/apis/meta/v1/well_known_labels.go", + "k8s.io/client-go/pkg/apis/meta/v1/zz_generated.deepcopy.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/go-openapi/spec", + "//vendor:github.com/gogo/protobuf/proto", + "//vendor:github.com/gogo/protobuf/sortkeys", + "//vendor:github.com/google/gofuzz", + "//vendor:k8s.io/client-go/pkg/conversion", + "//vendor:k8s.io/client-go/pkg/genericapiserver/openapi/common", + "//vendor:k8s.io/client-go/pkg/labels", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/selection", + ], +) + go_library( name = "k8s.io/client-go/pkg/apis/policy", srcs = [ @@ -10162,6 +10463,36 @@ go_library( ], ) +go_library( + name = "k8s.io/client-go/pkg/apis/policy/v1beta1", + srcs = [ + "k8s.io/client-go/pkg/apis/policy/v1beta1/doc.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/generated.pb.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/register.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/types.generated.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/types.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/types_swagger_doc_generated.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.conversion.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/gogo/protobuf/proto", + "//vendor:github.com/gogo/protobuf/sortkeys", + "//vendor:github.com/ugorji/go/codec", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/meta/v1", + "//vendor:k8s.io/client-go/pkg/apis/policy", + "//vendor:k8s.io/client-go/pkg/conversion", + "//vendor:k8s.io/client-go/pkg/runtime", + "//vendor:k8s.io/client-go/pkg/runtime/schema", + "//vendor:k8s.io/client-go/pkg/types", + "//vendor:k8s.io/client-go/pkg/util/intstr", + "//vendor:k8s.io/client-go/pkg/watch/versioned", + ], +) + go_library( name = "k8s.io/client-go/pkg/apis/rbac", srcs = [ @@ -10519,6 +10850,17 @@ go_library( ], ) +go_library( + name = "k8s.io/client-go/pkg/runtime/schema", + srcs = [ + "k8s.io/client-go/pkg/runtime/schema/generated.pb.go", + "k8s.io/client-go/pkg/runtime/schema/group_version.go", + "k8s.io/client-go/pkg/runtime/schema/interfaces.go", + ], + tags = ["automanaged"], + deps = ["//vendor:github.com/gogo/protobuf/proto"], +) + go_library( name = "k8s.io/client-go/pkg/runtime/serializer", srcs = [ @@ -10629,6 +10971,15 @@ go_library( tags = ["automanaged"], ) +go_library( + name = "k8s.io/client-go/pkg/third_party/forked/golang/template", + srcs = [ + "k8s.io/client-go/pkg/third_party/forked/golang/template/exec.go", + "k8s.io/client-go/pkg/third_party/forked/golang/template/funcs.go", + ], + tags = ["automanaged"], +) + go_library( name = "k8s.io/client-go/pkg/types", srcs = [ @@ -10795,6 +11146,18 @@ go_library( tags = ["automanaged"], ) +go_library( + name = "k8s.io/client-go/pkg/util/jsonpath", + srcs = [ + "k8s.io/client-go/pkg/util/jsonpath/doc.go", + "k8s.io/client-go/pkg/util/jsonpath/jsonpath.go", + "k8s.io/client-go/pkg/util/jsonpath/node.go", + "k8s.io/client-go/pkg/util/jsonpath/parser.go", + ], + tags = ["automanaged"], + deps = ["//vendor:k8s.io/client-go/pkg/third_party/forked/golang/template"], +) + go_library( name = "k8s.io/client-go/pkg/util/labels", srcs = [ @@ -10835,6 +11198,12 @@ go_library( tags = ["automanaged"], ) +go_library( + name = "k8s.io/client-go/pkg/util/ratelimit", + srcs = ["k8s.io/client-go/pkg/util/ratelimit/bucket.go"], + tags = ["automanaged"], +) + go_library( name = "k8s.io/client-go/pkg/util/runtime", srcs = ["k8s.io/client-go/pkg/util/runtime/runtime.go"], @@ -11475,348 +11844,3 @@ go_library( "//pkg/api/v1:go_default_library", ], ) - -go_library( - name = "github.com/vmware/photon-controller-go-sdk/photon", - srcs = [ - "github.com/vmware/photon-controller-go-sdk/photon/apitypes.go", - "github.com/vmware/photon-controller-go-sdk/photon/auth.go", - "github.com/vmware/photon-controller-go-sdk/photon/availabilityzones.go", - "github.com/vmware/photon-controller-go-sdk/photon/client.go", - "github.com/vmware/photon-controller-go-sdk/photon/clusters.go", - "github.com/vmware/photon-controller-go-sdk/photon/deployments.go", - "github.com/vmware/photon-controller-go-sdk/photon/disks.go", - "github.com/vmware/photon-controller-go-sdk/photon/flavors.go", - "github.com/vmware/photon-controller-go-sdk/photon/hosts.go", - "github.com/vmware/photon-controller-go-sdk/photon/images.go", - "github.com/vmware/photon-controller-go-sdk/photon/info.go", - "github.com/vmware/photon-controller-go-sdk/photon/networks.go", - "github.com/vmware/photon-controller-go-sdk/photon/projects.go", - "github.com/vmware/photon-controller-go-sdk/photon/resourcetickets.go", - "github.com/vmware/photon-controller-go-sdk/photon/restclient.go", - "github.com/vmware/photon-controller-go-sdk/photon/status.go", - "github.com/vmware/photon-controller-go-sdk/photon/tasks.go", - "github.com/vmware/photon-controller-go-sdk/photon/tenants.go", - "github.com/vmware/photon-controller-go-sdk/photon/util.go", - "github.com/vmware/photon-controller-go-sdk/photon/virtualnetworks.go", - "github.com/vmware/photon-controller-go-sdk/photon/vms.go", - ], - tags = ["automanaged"], - deps = ["//vendor:github.com/vmware/photon-controller-go-sdk/photon/lightwave"], -) - -go_library( - name = "github.com/vmware/photon-controller-go-sdk/photon/lightwave", - srcs = [ - "github.com/vmware/photon-controller-go-sdk/photon/lightwave/jwttoken.go", - "github.com/vmware/photon-controller-go-sdk/photon/lightwave/oidcclient.go", - ], - tags = ["automanaged"], -) - -go_library( - name = "k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib", - srcs = ["k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib/difflib.go"], - tags = ["automanaged"], -) - -go_library( - name = "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert", - srcs = [ - "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/assertions.go", - "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/doc.go", - "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/errors.go", - "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/forward_assertions.go", - "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/http_assertions.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:github.com/davecgh/go-spew/spew", - "//vendor:github.com/pmezard/go-difflib/difflib", - ], -) - -go_library( - name = "k8s.io/client-go/kubernetes/typed/apps/v1beta1", - srcs = [ - "k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go", - "k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go", - "k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go", - "k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apimachinery/registered", - "//vendor:k8s.io/client-go/pkg/apis/apps/v1beta1", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/runtime/serializer", - "//vendor:k8s.io/client-go/pkg/watch", - "//vendor:k8s.io/client-go/rest", - ], -) - -go_library( - name = "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake", - srcs = [ - "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go", - "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go", - "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1beta1", - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apis/apps/v1beta1", - "//vendor:k8s.io/client-go/pkg/labels", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/watch", - "//vendor:k8s.io/client-go/rest", - "//vendor:k8s.io/client-go/testing", - ], -) - -go_library( - name = "k8s.io/client-go/kubernetes/typed/batch/v2alpha1", - srcs = [ - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go", - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go", - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go", - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go", - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apimachinery/registered", - "//vendor:k8s.io/client-go/pkg/apis/batch/v2alpha1", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/runtime/serializer", - "//vendor:k8s.io/client-go/pkg/watch", - "//vendor:k8s.io/client-go/rest", - ], -) - -go_library( - name = "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake", - srcs = [ - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go", - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go", - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go", - "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:k8s.io/client-go/kubernetes/typed/batch/v2alpha1", - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apis/batch/v2alpha1", - "//vendor:k8s.io/client-go/pkg/labels", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/watch", - "//vendor:k8s.io/client-go/rest", - "//vendor:k8s.io/client-go/testing", - ], -) - -go_library( - name = "k8s.io/client-go/kubernetes/typed/policy/v1beta1", - srcs = [ - "k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go", - "k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go", - "k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go", - "k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apimachinery/registered", - "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/runtime/serializer", - "//vendor:k8s.io/client-go/pkg/watch", - "//vendor:k8s.io/client-go/rest", - ], -) - -go_library( - name = "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake", - srcs = [ - "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go", - "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go", - "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1beta1", - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", - "//vendor:k8s.io/client-go/pkg/labels", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/watch", - "//vendor:k8s.io/client-go/rest", - "//vendor:k8s.io/client-go/testing", - ], -) - -go_library( - name = "k8s.io/client-go/pkg/apis/apps/v1beta1", - srcs = [ - "k8s.io/client-go/pkg/apis/apps/v1beta1/conversion.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/defaults.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/doc.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/generated.pb.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/register.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/types.generated.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/types.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.conversion.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go", - "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.defaults.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:github.com/gogo/protobuf/proto", - "//vendor:github.com/ugorji/go/codec", - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/resource", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apis/apps", - "//vendor:k8s.io/client-go/pkg/apis/meta/v1", - "//vendor:k8s.io/client-go/pkg/conversion", - "//vendor:k8s.io/client-go/pkg/runtime", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/types", - "//vendor:k8s.io/client-go/pkg/util/intstr", - "//vendor:k8s.io/client-go/pkg/watch/versioned", - ], -) - -go_library( - name = "k8s.io/client-go/pkg/apis/policy/v1beta1", - srcs = [ - "k8s.io/client-go/pkg/apis/policy/v1beta1/doc.go", - "k8s.io/client-go/pkg/apis/policy/v1beta1/generated.pb.go", - "k8s.io/client-go/pkg/apis/policy/v1beta1/register.go", - "k8s.io/client-go/pkg/apis/policy/v1beta1/types.generated.go", - "k8s.io/client-go/pkg/apis/policy/v1beta1/types.go", - "k8s.io/client-go/pkg/apis/policy/v1beta1/types_swagger_doc_generated.go", - "k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.conversion.go", - "k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:github.com/gogo/protobuf/proto", - "//vendor:github.com/gogo/protobuf/sortkeys", - "//vendor:github.com/ugorji/go/codec", - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apis/meta/v1", - "//vendor:k8s.io/client-go/pkg/apis/policy", - "//vendor:k8s.io/client-go/pkg/conversion", - "//vendor:k8s.io/client-go/pkg/runtime", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/types", - "//vendor:k8s.io/client-go/pkg/util/intstr", - "//vendor:k8s.io/client-go/pkg/watch/versioned", - ], -) - -go_library( - name = "k8s.io/client-go/pkg/third_party/forked/golang/template", - srcs = [ - "k8s.io/client-go/pkg/third_party/forked/golang/template/exec.go", - "k8s.io/client-go/pkg/third_party/forked/golang/template/funcs.go", - ], - tags = ["automanaged"], -) - -go_library( - name = "k8s.io/client-go/pkg/util/jsonpath", - srcs = [ - "k8s.io/client-go/pkg/util/jsonpath/doc.go", - "k8s.io/client-go/pkg/util/jsonpath/jsonpath.go", - "k8s.io/client-go/pkg/util/jsonpath/node.go", - "k8s.io/client-go/pkg/util/jsonpath/parser.go", - ], - tags = ["automanaged"], - deps = ["//vendor:k8s.io/client-go/pkg/third_party/forked/golang/template"], -) - -go_library( - name = "k8s.io/client-go/pkg/util/ratelimit", - srcs = ["k8s.io/client-go/pkg/util/ratelimit/bucket.go"], - tags = ["automanaged"], -) - -go_library( - name = "k8s.io/client-go/pkg/runtime/schema", - srcs = [ - "k8s.io/client-go/pkg/runtime/schema/generated.pb.go", - "k8s.io/client-go/pkg/runtime/schema/group_version.go", - "k8s.io/client-go/pkg/runtime/schema/interfaces.go", - ], - tags = ["automanaged"], - deps = ["//vendor:github.com/gogo/protobuf/proto"], -) - -go_library( - name = "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers", - srcs = [ - "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/requests.go", - "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go", - "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/urls.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:github.com/mitchellh/mapstructure", - "//vendor:github.com/rackspace/gophercloud", - "//vendor:github.com/rackspace/gophercloud/pagination", - ], -) - -go_library( - name = "k8s.io/client-go/pkg/apis/meta/v1", - srcs = [ - "k8s.io/client-go/pkg/apis/meta/v1/doc.go", - "k8s.io/client-go/pkg/apis/meta/v1/duration.go", - "k8s.io/client-go/pkg/apis/meta/v1/generated.pb.go", - "k8s.io/client-go/pkg/apis/meta/v1/group_version.go", - "k8s.io/client-go/pkg/apis/meta/v1/helpers.go", - "k8s.io/client-go/pkg/apis/meta/v1/meta.go", - "k8s.io/client-go/pkg/apis/meta/v1/register.go", - "k8s.io/client-go/pkg/apis/meta/v1/time.go", - "k8s.io/client-go/pkg/apis/meta/v1/time_proto.go", - "k8s.io/client-go/pkg/apis/meta/v1/types.go", - "k8s.io/client-go/pkg/apis/meta/v1/types_swagger_doc_generated.go", - "k8s.io/client-go/pkg/apis/meta/v1/well_known_labels.go", - "k8s.io/client-go/pkg/apis/meta/v1/zz_generated.deepcopy.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:github.com/go-openapi/spec", - "//vendor:github.com/gogo/protobuf/proto", - "//vendor:github.com/gogo/protobuf/sortkeys", - "//vendor:github.com/google/gofuzz", - "//vendor:k8s.io/client-go/pkg/conversion", - "//vendor:k8s.io/client-go/pkg/genericapiserver/openapi/common", - "//vendor:k8s.io/client-go/pkg/labels", - "//vendor:k8s.io/client-go/pkg/runtime/schema", - "//vendor:k8s.io/client-go/pkg/selection", - ], -) - -go_library( - name = "github.com/miekg/coredns/middleware/etcd/msg", - srcs = [ - "github.com/miekg/coredns/middleware/etcd/msg/path.go", - "github.com/miekg/coredns/middleware/etcd/msg/service.go", - ], - tags = ["automanaged"], - deps = ["//vendor:github.com/miekg/dns"], -)