mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Merge pull request #52013 from FengyunPan/autoprobing-external-network
Automatic merge from submit-queue (batch tested with PRs 52013, 56719). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Support autoprobing floating-network-id for openstack cloud provider Currently if user doesn't specify floatingnetwork-id and loadbalancer.openstack.org/floating-network-id annotation, openstack cloud provider can't create a external LoadBalancer service. Actually we can get floatingnetwork-id automatically. If we get multiple floatingnetwork-ids, then ask user to specify one, or we use the floatingnetwork-id to create floatingip for external LoadBalancer service. This is a part of #50726 **Special notes for your reviewer**: /assign @dims **Release note**: ```release-note Support autoprobing floating-network-id for openstack cloud provider ```
This commit is contained in:
commit
36ea6de4a0
84
Godeps/Godeps.json
generated
84
Godeps/Godeps.json
generated
@ -442,47 +442,47 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/api/services/containers/v1",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/api/services/tasks/v1",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/api/services/version/v1",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/api/types",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/api/types/task",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/containers",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/dialer",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/errdefs",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/containerd/containerd/namespaces",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a0",
|
||||
"Comment": "v1.0.0-beta.2-159-g27d450a",
|
||||
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
|
||||
},
|
||||
{
|
||||
@ -1319,7 +1319,7 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gogo/protobuf/types",
|
||||
"Comment": "v0.4-3-gc0656edd",
|
||||
"Comment": "v0.4-3-gc0656ed",
|
||||
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
|
||||
},
|
||||
{
|
||||
@ -1633,115 +1633,123 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/volumeactions",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/blockstorage/v1/volumes",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/common/extensions",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/attachinterfaces",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/flavors",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/images",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/servers",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external",
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/listeners",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/loadbalancers",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/monitors",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/pools",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/networks",
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/ports",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/utils",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/pagination",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gorilla/context",
|
||||
|
398
Godeps/LICENSES
generated
398
Godeps/LICENSES
generated
@ -58330,6 +58330,205 @@ specific language governing permissions and limitations under the License.
|
||||
================================================================================
|
||||
|
||||
|
||||
================================================================================
|
||||
= vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external licensed under: =
|
||||
|
||||
Copyright 2012-2013 Rackspace, Inc.
|
||||
|
||||
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.
|
||||
|
||||
------
|
||||
|
||||
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
|
||||
|
||||
= vendor/github.com/gophercloud/gophercloud/LICENSE dd19699707373c2ca31531a659130416
|
||||
================================================================================
|
||||
|
||||
|
||||
================================================================================
|
||||
= vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips licensed under: =
|
||||
|
||||
@ -59922,6 +60121,205 @@ specific language governing permissions and limitations under the License.
|
||||
================================================================================
|
||||
|
||||
|
||||
================================================================================
|
||||
= vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks licensed under: =
|
||||
|
||||
Copyright 2012-2013 Rackspace, Inc.
|
||||
|
||||
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.
|
||||
|
||||
------
|
||||
|
||||
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
|
||||
|
||||
= vendor/github.com/gophercloud/gophercloud/LICENSE dd19699707373c2ca31531a659130416
|
||||
================================================================================
|
||||
|
||||
|
||||
================================================================================
|
||||
= vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports licensed under: =
|
||||
|
||||
|
@ -39,6 +39,7 @@ go_library(
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/listeners:go_default_library",
|
||||
@ -47,6 +48,7 @@ go_library(
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/pools:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/pagination:go_default_library",
|
||||
"//vendor/github.com/mitchellh/mapstructure:go_default_library",
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"github.com/gophercloud/gophercloud"
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions"
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external"
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips"
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/listeners"
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/loadbalancers"
|
||||
@ -32,6 +33,7 @@ import (
|
||||
v2pools "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/pools"
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups"
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules"
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/networks"
|
||||
neutronports "github.com/gophercloud/gophercloud/openstack/networking/v2/ports"
|
||||
"github.com/gophercloud/gophercloud/pagination"
|
||||
|
||||
@ -566,6 +568,52 @@ func getNodeSecurityGroupIDForLB(compute *gophercloud.ServiceClient, nodes []*v1
|
||||
return nodeSecurityGroupIDs.List(), nil
|
||||
}
|
||||
|
||||
// getFloatingNetworkIdForLB returns a floating-network-id for cluster.
|
||||
func getFloatingNetworkIdForLB(client *gophercloud.ServiceClient) (string, error) {
|
||||
var floatingNetworkIds []string
|
||||
|
||||
type NetworkWithExternalExt struct {
|
||||
networks.Network
|
||||
external.NetworkExternalExt
|
||||
}
|
||||
|
||||
err := networks.List(client, networks.ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
|
||||
var externalNetwork []NetworkWithExternalExt
|
||||
err := networks.ExtractNetworksInto(page, &externalNetwork)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
for _, externalNet := range externalNetwork {
|
||||
if externalNet.External {
|
||||
floatingNetworkIds = append(floatingNetworkIds, externalNet.ID)
|
||||
}
|
||||
}
|
||||
|
||||
if len(floatingNetworkIds) > 1 {
|
||||
return false, ErrMultipleResults
|
||||
}
|
||||
return true, nil
|
||||
})
|
||||
if err != nil {
|
||||
if isNotFound(err) {
|
||||
return "", ErrNotFound
|
||||
}
|
||||
|
||||
if err == ErrMultipleResults {
|
||||
glog.V(4).Infof("find multiple external networks, pick the first one when there are no explicit configuration.")
|
||||
return floatingNetworkIds[0], nil
|
||||
}
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(floatingNetworkIds) == 0 {
|
||||
return "", ErrNotFound
|
||||
}
|
||||
|
||||
return floatingNetworkIds[0], nil
|
||||
}
|
||||
|
||||
// TODO: This code currently ignores 'region' and always creates a
|
||||
// loadbalancer in only the current OpenStack region. We should take
|
||||
// a list of regions (from config) and query/create loadbalancers in
|
||||
@ -596,7 +644,13 @@ func (lbaas *LbaasV2) EnsureLoadBalancer(clusterName string, apiService *v1.Serv
|
||||
}
|
||||
|
||||
floatingPool := getStringFromServiceAnnotation(apiService, ServiceAnnotationLoadBalancerFloatingNetworkId, lbaas.opts.FloatingNetworkId)
|
||||
glog.V(4).Infof("EnsureLoadBalancer using floatingPool: %v", floatingPool)
|
||||
if len(floatingPool) == 0 {
|
||||
var err error
|
||||
floatingPool, err = getFloatingNetworkIdForLB(lbaas.network)
|
||||
if err != nil {
|
||||
glog.Warningf("Failed to find floating-network-id for loadbalancer service %s/%s: %v", apiService.Namespace, apiService.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
var internalAnnotation bool
|
||||
internal := getStringFromServiceAnnotation(apiService, ServiceAnnotationLoadBalancerInternal, "false")
|
||||
@ -606,7 +660,7 @@ func (lbaas *LbaasV2) EnsureLoadBalancer(clusterName string, apiService *v1.Serv
|
||||
internalAnnotation = true
|
||||
case "false":
|
||||
if len(floatingPool) != 0 {
|
||||
glog.V(4).Infof("Ensure an external loadbalancer service.")
|
||||
glog.V(4).Infof("Ensure an external loadbalancer service, using floatingPool: %v", floatingPool)
|
||||
internalAnnotation = false
|
||||
} else {
|
||||
return nil, fmt.Errorf("floating-network-id or loadbalancer.openstack.org/floating-network-id should be specified when ensuring an external loadbalancer service")
|
||||
|
14
staging/src/k8s.io/apiserver/Godeps/Godeps.json
generated
14
staging/src/k8s.io/apiserver/Godeps/Godeps.json
generated
@ -408,31 +408,31 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/utils",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/pagination",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gregjones/httpcache",
|
||||
|
14
staging/src/k8s.io/client-go/Godeps/Godeps.json
generated
14
staging/src/k8s.io/client-go/Godeps/Godeps.json
generated
@ -172,31 +172,31 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/openstack/utils",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gophercloud/gophercloud/pagination",
|
||||
"Rev": "db5f840b1d1a595280d643defc09ce277996959e"
|
||||
"Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gregjones/httpcache",
|
||||
|
1
vendor/github.com/gophercloud/gophercloud/openstack/BUILD
generated
vendored
1
vendor/github.com/gophercloud/gophercloud/openstack/BUILD
generated
vendored
@ -45,6 +45,7 @@ filegroup(
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts:all-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens:all-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions:all-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks:all-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports:all-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/utils:all-srcs",
|
||||
],
|
||||
|
2
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go
generated
vendored
2
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go
generated
vendored
@ -65,7 +65,7 @@ type Flavor struct {
|
||||
VCPUs int `json:"vcpus"`
|
||||
|
||||
// IsPublic indicates whether the flavor is public.
|
||||
IsPublic bool `json:"is_public"`
|
||||
IsPublic bool `json:"os-flavor-access:is_public"`
|
||||
}
|
||||
|
||||
func (r *Flavor) UnmarshalJSON(b []byte) error {
|
||||
|
2
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go
generated
vendored
2
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go
generated
vendored
@ -515,7 +515,7 @@ func (opts ResizeOpts) ToServerResizeMap() (map[string]interface{}, error) {
|
||||
// Note that this implies rebuilding it.
|
||||
//
|
||||
// Unfortunately, one cannot pass rebuild parameters to the resize function.
|
||||
// When the resize completes, the server will be in RESIZE_VERIFY state.
|
||||
// When the resize completes, the server will be in VERIFY_RESIZE state.
|
||||
// While in this state, you can explore the use of the new server's
|
||||
// configuration. If you like it, call ConfirmResize() to commit the resize
|
||||
// permanently. Otherwise, call RevertResize() to restore the old configuration.
|
||||
|
1
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/BUILD
generated
vendored
1
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/BUILD
generated
vendored
@ -23,6 +23,7 @@ filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [
|
||||
":package-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external:all-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips:all-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers:all-srcs",
|
||||
"//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/listeners:all-srcs",
|
||||
|
27
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external/BUILD
generated
vendored
Normal file
27
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external/BUILD
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"requests.go",
|
||||
"results.go",
|
||||
],
|
||||
importpath = "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks:go_default_library"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
46
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external/doc.go
generated
vendored
Normal file
46
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external/doc.go
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
Package external provides information and interaction with the external
|
||||
extension for the OpenStack Networking service.
|
||||
|
||||
Example to List Networks with External Information
|
||||
|
||||
type NetworkWithExternalExt struct {
|
||||
networks.Network
|
||||
external.NetworkExternalExt
|
||||
}
|
||||
|
||||
var allNetworks []NetworkWithExternalExt
|
||||
|
||||
allPages, err := networks.List(networkClient, nil).AllPages()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = networks.ExtractNetworksInto(allPages, &allNetworks)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
for _, network := range allNetworks {
|
||||
fmt.Println("%+v\n", network)
|
||||
}
|
||||
|
||||
Example to Create a Network with External Information
|
||||
|
||||
iTrue := true
|
||||
networkCreateOpts := networks.CreateOpts{
|
||||
Name: "private",
|
||||
AdminStateUp: &iTrue,
|
||||
}
|
||||
|
||||
createOpts := external.CreateOptsExt{
|
||||
networkCreateOpts,
|
||||
&iTrue,
|
||||
}
|
||||
|
||||
network, err := networks.Create(networkClient, createOpts).Extract()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
*/
|
||||
package external
|
56
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external/requests.go
generated
vendored
Normal file
56
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external/requests.go
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
package external
|
||||
|
||||
import (
|
||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/networks"
|
||||
)
|
||||
|
||||
// CreateOptsExt is the structure used when creating new external network
|
||||
// resources. It embeds networks.CreateOpts and so inherits all of its required
|
||||
// and optional fields, with the addition of the External field.
|
||||
type CreateOptsExt struct {
|
||||
networks.CreateOptsBuilder
|
||||
External *bool `json:"router:external,omitempty"`
|
||||
}
|
||||
|
||||
// ToNetworkCreateMap adds the router:external options to the base network
|
||||
// creation options.
|
||||
func (opts CreateOptsExt) ToNetworkCreateMap() (map[string]interface{}, error) {
|
||||
base, err := opts.CreateOptsBuilder.ToNetworkCreateMap()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if opts.External == nil {
|
||||
return base, nil
|
||||
}
|
||||
|
||||
networkMap := base["network"].(map[string]interface{})
|
||||
networkMap["router:external"] = opts.External
|
||||
|
||||
return base, nil
|
||||
}
|
||||
|
||||
// UpdateOptsExt is the structure used when updating existing external network
|
||||
// resources. It embeds networks.UpdateOpts and so inherits all of its required
|
||||
// and optional fields, with the addition of the External field.
|
||||
type UpdateOptsExt struct {
|
||||
networks.UpdateOptsBuilder
|
||||
External *bool `json:"router:external,omitempty"`
|
||||
}
|
||||
|
||||
// ToNetworkUpdateMap casts an UpdateOpts struct to a map.
|
||||
func (opts UpdateOptsExt) ToNetworkUpdateMap() (map[string]interface{}, error) {
|
||||
base, err := opts.UpdateOptsBuilder.ToNetworkUpdateMap()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if opts.External == nil {
|
||||
return base, nil
|
||||
}
|
||||
|
||||
networkMap := base["network"].(map[string]interface{})
|
||||
networkMap["router:external"] = opts.External
|
||||
|
||||
return base, nil
|
||||
}
|
8
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external/results.go
generated
vendored
Normal file
8
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external/results.go
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package external
|
||||
|
||||
// NetworkExternalExt represents a decorated form of a Network with based on the
|
||||
// "external-net" extension.
|
||||
type NetworkExternalExt struct {
|
||||
// Specifies whether the network is an external network or not.
|
||||
External bool `json:"router:external"`
|
||||
}
|
31
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/BUILD
generated
vendored
Normal file
31
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/BUILD
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"requests.go",
|
||||
"results.go",
|
||||
"urls.go",
|
||||
],
|
||||
importpath = "github.com/gophercloud/gophercloud/openstack/networking/v2/networks",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//vendor/github.com/gophercloud/gophercloud:go_default_library",
|
||||
"//vendor/github.com/gophercloud/gophercloud/pagination:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
65
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/doc.go
generated
vendored
Normal file
65
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/doc.go
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
Package networks contains functionality for working with Neutron network
|
||||
resources. A network is an isolated virtual layer-2 broadcast domain that is
|
||||
typically reserved for the tenant who created it (unless you configure the
|
||||
network to be shared). Tenants can create multiple networks until the
|
||||
thresholds per-tenant quota is reached.
|
||||
|
||||
In the v2.0 Networking API, the network is the main entity. Ports and subnets
|
||||
are always associated with a network.
|
||||
|
||||
Example to List Networks
|
||||
|
||||
listOpts := networks.ListOpts{
|
||||
TenantID: "a99e9b4e620e4db09a2dfb6e42a01e66",
|
||||
}
|
||||
|
||||
allPages, err := networks.List(networkClient, listOpts).AllPages()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
allNetworks, err := networks.ExtractNetworks(allPages)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
for _, network := range allNetworks {
|
||||
fmt.Printf("%+v", network)
|
||||
}
|
||||
|
||||
Example to Create a Network
|
||||
|
||||
iTrue := true
|
||||
createOpts := networks.CreateOpts{
|
||||
Name: "network_1",
|
||||
AdminStateUp: &iTrue,
|
||||
}
|
||||
|
||||
network, err := networks.Create(networkClient, createOpts).Extract()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Example to Update a Network
|
||||
|
||||
networkID := "484cda0e-106f-4f4b-bb3f-d413710bbe78"
|
||||
|
||||
updateOpts := networks.UpdateOpts{
|
||||
Name: "new_name",
|
||||
}
|
||||
|
||||
network, err := networks.Update(networkClient, networkID, updateOpts).Extract()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Example to Delete a Network
|
||||
|
||||
networkID := "484cda0e-106f-4f4b-bb3f-d413710bbe78"
|
||||
err := networks.Delete(networkClient, networkID).ExtractErr()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
*/
|
||||
package networks
|
165
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/requests.go
generated
vendored
Normal file
165
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/requests.go
generated
vendored
Normal file
@ -0,0 +1,165 @@
|
||||
package networks
|
||||
|
||||
import (
|
||||
"github.com/gophercloud/gophercloud"
|
||||
"github.com/gophercloud/gophercloud/pagination"
|
||||
)
|
||||
|
||||
// ListOptsBuilder allows extensions to add additional parameters to the
|
||||
// List request.
|
||||
type ListOptsBuilder interface {
|
||||
ToNetworkListQuery() (string, error)
|
||||
}
|
||||
|
||||
// ListOpts allows the filtering and sorting of paginated collections through
|
||||
// the API. Filtering is achieved by passing in struct field values that map to
|
||||
// the network attributes you want to see returned. SortKey allows you to sort
|
||||
// by a particular network attribute. SortDir sets the direction, and is either
|
||||
// `asc' or `desc'. Marker and Limit are used for pagination.
|
||||
type ListOpts struct {
|
||||
Status string `q:"status"`
|
||||
Name string `q:"name"`
|
||||
AdminStateUp *bool `q:"admin_state_up"`
|
||||
TenantID string `q:"tenant_id"`
|
||||
Shared *bool `q:"shared"`
|
||||
ID string `q:"id"`
|
||||
Marker string `q:"marker"`
|
||||
Limit int `q:"limit"`
|
||||
SortKey string `q:"sort_key"`
|
||||
SortDir string `q:"sort_dir"`
|
||||
}
|
||||
|
||||
// ToNetworkListQuery formats a ListOpts into a query string.
|
||||
func (opts ListOpts) ToNetworkListQuery() (string, error) {
|
||||
q, err := gophercloud.BuildQueryString(opts)
|
||||
return q.String(), err
|
||||
}
|
||||
|
||||
// List returns a Pager which allows you to iterate over a collection of
|
||||
// networks. It accepts a ListOpts struct, which allows you to filter and sort
|
||||
// the returned collection for greater efficiency.
|
||||
func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
|
||||
url := listURL(c)
|
||||
if opts != nil {
|
||||
query, err := opts.ToNetworkListQuery()
|
||||
if err != nil {
|
||||
return pagination.Pager{Err: err}
|
||||
}
|
||||
url += query
|
||||
}
|
||||
return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page {
|
||||
return NetworkPage{pagination.LinkedPageBase{PageResult: r}}
|
||||
})
|
||||
}
|
||||
|
||||
// Get retrieves a specific network based on its unique ID.
|
||||
func Get(c *gophercloud.ServiceClient, id string) (r GetResult) {
|
||||
_, r.Err = c.Get(getURL(c, id), &r.Body, nil)
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOptsBuilder allows extensions to add additional parameters to the
|
||||
// Create request.
|
||||
type CreateOptsBuilder interface {
|
||||
ToNetworkCreateMap() (map[string]interface{}, error)
|
||||
}
|
||||
|
||||
// CreateOpts represents options used to create a network.
|
||||
type CreateOpts struct {
|
||||
AdminStateUp *bool `json:"admin_state_up,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Shared *bool `json:"shared,omitempty"`
|
||||
TenantID string `json:"tenant_id,omitempty"`
|
||||
}
|
||||
|
||||
// ToNetworkCreateMap builds a request body from CreateOpts.
|
||||
func (opts CreateOpts) ToNetworkCreateMap() (map[string]interface{}, error) {
|
||||
return gophercloud.BuildRequestBody(opts, "network")
|
||||
}
|
||||
|
||||
// Create accepts a CreateOpts struct and creates a new network using the values
|
||||
// provided. This operation does not actually require a request body, i.e. the
|
||||
// CreateOpts struct argument can be empty.
|
||||
//
|
||||
// The tenant ID that is contained in the URI is the tenant that creates the
|
||||
// network. An admin user, however, has the option of specifying another tenant
|
||||
// ID in the CreateOpts struct.
|
||||
func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) {
|
||||
b, err := opts.ToNetworkCreateMap()
|
||||
if err != nil {
|
||||
r.Err = err
|
||||
return
|
||||
}
|
||||
_, r.Err = c.Post(createURL(c), b, &r.Body, nil)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateOptsBuilder allows extensions to add additional parameters to the
|
||||
// Update request.
|
||||
type UpdateOptsBuilder interface {
|
||||
ToNetworkUpdateMap() (map[string]interface{}, error)
|
||||
}
|
||||
|
||||
// UpdateOpts represents options used to update a network.
|
||||
type UpdateOpts struct {
|
||||
AdminStateUp *bool `json:"admin_state_up,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Shared *bool `json:"shared,omitempty"`
|
||||
}
|
||||
|
||||
// ToNetworkUpdateMap builds a request body from UpdateOpts.
|
||||
func (opts UpdateOpts) ToNetworkUpdateMap() (map[string]interface{}, error) {
|
||||
return gophercloud.BuildRequestBody(opts, "network")
|
||||
}
|
||||
|
||||
// Update accepts a UpdateOpts struct and updates an existing network using the
|
||||
// values provided. For more information, see the Create function.
|
||||
func Update(c *gophercloud.ServiceClient, networkID string, opts UpdateOptsBuilder) (r UpdateResult) {
|
||||
b, err := opts.ToNetworkUpdateMap()
|
||||
if err != nil {
|
||||
r.Err = err
|
||||
return
|
||||
}
|
||||
_, r.Err = c.Put(updateURL(c, networkID), b, &r.Body, &gophercloud.RequestOpts{
|
||||
OkCodes: []int{200, 201},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// Delete accepts a unique ID and deletes the network associated with it.
|
||||
func Delete(c *gophercloud.ServiceClient, networkID string) (r DeleteResult) {
|
||||
_, r.Err = c.Delete(deleteURL(c, networkID), nil)
|
||||
return
|
||||
}
|
||||
|
||||
// IDFromName is a convenience function that returns a network's ID, given
|
||||
// its name.
|
||||
func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) {
|
||||
count := 0
|
||||
id := ""
|
||||
pages, err := List(client, nil).AllPages()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
all, err := ExtractNetworks(pages)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
for _, s := range all {
|
||||
if s.Name == name {
|
||||
count++
|
||||
id = s.ID
|
||||
}
|
||||
}
|
||||
|
||||
switch count {
|
||||
case 0:
|
||||
return "", gophercloud.ErrResourceNotFound{Name: name, ResourceType: "network"}
|
||||
case 1:
|
||||
return id, nil
|
||||
default:
|
||||
return "", gophercloud.ErrMultipleResourcesFound{Name: name, Count: count, ResourceType: "network"}
|
||||
}
|
||||
}
|
111
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/results.go
generated
vendored
Normal file
111
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/results.go
generated
vendored
Normal file
@ -0,0 +1,111 @@
|
||||
package networks
|
||||
|
||||
import (
|
||||
"github.com/gophercloud/gophercloud"
|
||||
"github.com/gophercloud/gophercloud/pagination"
|
||||
)
|
||||
|
||||
type commonResult struct {
|
||||
gophercloud.Result
|
||||
}
|
||||
|
||||
// Extract is a function that accepts a result and extracts a network resource.
|
||||
func (r commonResult) Extract() (*Network, error) {
|
||||
var s Network
|
||||
err := r.ExtractInto(&s)
|
||||
return &s, err
|
||||
}
|
||||
|
||||
func (r commonResult) ExtractInto(v interface{}) error {
|
||||
return r.Result.ExtractIntoStructPtr(v, "network")
|
||||
}
|
||||
|
||||
// CreateResult represents the result of a create operation. Call its Extract
|
||||
// method to interpret it as a Network.
|
||||
type CreateResult struct {
|
||||
commonResult
|
||||
}
|
||||
|
||||
// GetResult represents the result of a get operation. Call its Extract
|
||||
// method to interpret it as a Network.
|
||||
type GetResult struct {
|
||||
commonResult
|
||||
}
|
||||
|
||||
// UpdateResult represents the result of an update operation. Call its Extract
|
||||
// method to interpret it as a Network.
|
||||
type UpdateResult struct {
|
||||
commonResult
|
||||
}
|
||||
|
||||
// DeleteResult represents the result of a delete operation. Call its
|
||||
// ExtractErr method to determine if the request succeeded or failed.
|
||||
type DeleteResult struct {
|
||||
gophercloud.ErrResult
|
||||
}
|
||||
|
||||
// Network represents, well, a network.
|
||||
type Network struct {
|
||||
// UUID for the network
|
||||
ID string `json:"id"`
|
||||
|
||||
// Human-readable name for the network. Might not be unique.
|
||||
Name string `json:"name"`
|
||||
|
||||
// The administrative state of network. If false (down), the network does not
|
||||
// forward packets.
|
||||
AdminStateUp bool `json:"admin_state_up"`
|
||||
|
||||
// Indicates whether network is currently operational. Possible values include
|
||||
// `ACTIVE', `DOWN', `BUILD', or `ERROR'. Plug-ins might define additional
|
||||
// values.
|
||||
Status string `json:"status"`
|
||||
|
||||
// Subnets associated with this network.
|
||||
Subnets []string `json:"subnets"`
|
||||
|
||||
// Owner of network.
|
||||
TenantID string `json:"tenant_id"`
|
||||
|
||||
// Specifies whether the network resource can be accessed by any tenant.
|
||||
Shared bool `json:"shared"`
|
||||
}
|
||||
|
||||
// NetworkPage is the page returned by a pager when traversing over a
|
||||
// collection of networks.
|
||||
type NetworkPage struct {
|
||||
pagination.LinkedPageBase
|
||||
}
|
||||
|
||||
// NextPageURL is invoked when a paginated collection of networks has reached
|
||||
// the end of a page and the pager seeks to traverse over a new one. In order
|
||||
// to do this, it needs to construct the next page's URL.
|
||||
func (r NetworkPage) NextPageURL() (string, error) {
|
||||
var s struct {
|
||||
Links []gophercloud.Link `json:"networks_links"`
|
||||
}
|
||||
err := r.ExtractInto(&s)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return gophercloud.ExtractNextURL(s.Links)
|
||||
}
|
||||
|
||||
// IsEmpty checks whether a NetworkPage struct is empty.
|
||||
func (r NetworkPage) IsEmpty() (bool, error) {
|
||||
is, err := ExtractNetworks(r)
|
||||
return len(is) == 0, err
|
||||
}
|
||||
|
||||
// ExtractNetworks accepts a Page struct, specifically a NetworkPage struct,
|
||||
// and extracts the elements into a slice of Network structs. In other words,
|
||||
// a generic collection is mapped into a relevant slice.
|
||||
func ExtractNetworks(r pagination.Page) ([]Network, error) {
|
||||
var s []Network
|
||||
err := ExtractNetworksInto(r, &s)
|
||||
return s, err
|
||||
}
|
||||
|
||||
func ExtractNetworksInto(r pagination.Page, v interface{}) error {
|
||||
return r.(NetworkPage).Result.ExtractIntoSlicePtr(v, "networks")
|
||||
}
|
31
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/urls.go
generated
vendored
Normal file
31
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/urls.go
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
package networks
|
||||
|
||||
import "github.com/gophercloud/gophercloud"
|
||||
|
||||
func resourceURL(c *gophercloud.ServiceClient, id string) string {
|
||||
return c.ServiceURL("networks", id)
|
||||
}
|
||||
|
||||
func rootURL(c *gophercloud.ServiceClient) string {
|
||||
return c.ServiceURL("networks")
|
||||
}
|
||||
|
||||
func getURL(c *gophercloud.ServiceClient, id string) string {
|
||||
return resourceURL(c, id)
|
||||
}
|
||||
|
||||
func listURL(c *gophercloud.ServiceClient) string {
|
||||
return rootURL(c)
|
||||
}
|
||||
|
||||
func createURL(c *gophercloud.ServiceClient) string {
|
||||
return rootURL(c)
|
||||
}
|
||||
|
||||
func updateURL(c *gophercloud.ServiceClient, id string) string {
|
||||
return resourceURL(c, id)
|
||||
}
|
||||
|
||||
func deleteURL(c *gophercloud.ServiceClient, id string) string {
|
||||
return resourceURL(c, id)
|
||||
}
|
11
vendor/github.com/gophercloud/gophercloud/params.go
generated
vendored
11
vendor/github.com/gophercloud/gophercloud/params.go
generated
vendored
@ -347,12 +347,21 @@ func BuildQueryString(opts interface{}) (*url.URL, error) {
|
||||
params.Add(tags[0], v.Index(i).String())
|
||||
}
|
||||
}
|
||||
case reflect.Map:
|
||||
if v.Type().Key().Kind() == reflect.String && v.Type().Elem().Kind() == reflect.String {
|
||||
var s []string
|
||||
for _, k := range v.MapKeys() {
|
||||
value := v.MapIndex(k).String()
|
||||
s = append(s, fmt.Sprintf("'%s':'%s'", k.String(), value))
|
||||
}
|
||||
params.Add(tags[0], fmt.Sprintf("{%s}", strings.Join(s, ", ")))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Otherwise, the field is not set.
|
||||
if len(tags) == 2 && tags[1] == "required" {
|
||||
// And the field is required. Return an error.
|
||||
return nil, fmt.Errorf("Required query parameter [%s] not set.", f.Name)
|
||||
return &url.URL{}, fmt.Errorf("Required query parameter [%s] not set.", f.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user