Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
47442f1c
Commit
47442f1c
authored
Apr 24, 2017
by
Di Xu
Committed by
root
Apr 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update gophercloud that fixed code format
mainly to include #265(
https://github.com/gophercloud/gophercloud/pull/265
)
parent
ac90c0e4
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
161 additions
and
91 deletions
+161
-91
Godeps.json
Godeps/Godeps.json
+30
-30
Godeps.json
staging/src/k8s.io/apiserver/Godeps/Godeps.json
+7
-7
README.md
vendor/github.com/gophercloud/gophercloud/README.md
+1
-1
auth_options.go
vendor/github.com/gophercloud/gophercloud/auth_options.go
+8
-1
doc.go
vendor/github.com/gophercloud/gophercloud/doc.go
+5
-3
urls.go
...gophercloud/openstack/blockstorage/v1/apiversions/urls.go
+1
-1
client.go
...or/github.com/gophercloud/gophercloud/openstack/client.go
+13
-0
requests.go
...loud/gophercloud/openstack/compute/v2/flavors/requests.go
+41
-0
results.go
...cloud/gophercloud/openstack/compute/v2/flavors/results.go
+22
-23
urls.go
...hercloud/gophercloud/openstack/compute/v2/flavors/urls.go
+4
-0
results.go
...rcloud/gophercloud/openstack/compute/v2/images/results.go
+2
-2
requests.go
...loud/gophercloud/openstack/compute/v2/servers/requests.go
+1
-2
results.go
...cloud/gophercloud/openstack/compute/v2/servers/results.go
+13
-9
requests.go
...k/networking/v2/extensions/layer3/floatingips/requests.go
+1
-0
results.go
...ck/networking/v2/extensions/layer3/floatingips/results.go
+3
-0
pager.go
...or/github.com/gophercloud/gophercloud/pagination/pager.go
+9
-12
No files found.
Godeps/Godeps.json
View file @
47442f1c
...
@@ -1449,123 +1449,123 @@
...
@@ -1449,123 +1449,123 @@
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/blockstorage/v1/apiversions"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/blockstorage/v1/apiversions"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/blockstorage/v1/volumes"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/blockstorage/v1/volumes"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/common/extensions"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/common/extensions"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/compute/v2/flavors"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/compute/v2/flavors"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/compute/v2/images"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/compute/v2/images"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v2/tenants"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v2/tenants"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v2/tokens"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v2/tokens"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v3/tokens"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v3/tokens"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/members"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/members"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/monitors"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/monitors"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/pools"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/pools"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/vips"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/vips"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/listeners"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/listeners"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/loadbalancers"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/loadbalancers"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/monitors"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/monitors"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/pools"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/pools"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/ports"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/networking/v2/ports"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/utils"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/utils"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/pagination"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/pagination"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gorilla/context"
,
"ImportPath"
:
"github.com/gorilla/context"
,
...
...
staging/src/k8s.io/apiserver/Godeps/Godeps.json
View file @
47442f1c
...
@@ -384,31 +384,31 @@
...
@@ -384,31 +384,31 @@
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v2/tenants"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v2/tenants"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v2/tokens"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v2/tokens"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v3/tokens"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/identity/v3/tokens"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/utils"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/openstack/utils"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/gophercloud/gophercloud/pagination"
,
"ImportPath"
:
"github.com/gophercloud/gophercloud/pagination"
,
"Rev"
:
"
b06120d13e262ceaf890ef38ee30898813696af
0"
"Rev"
:
"
9a5595b8ffe429439c63781cdc312c254e4ad99
0"
},
},
{
{
"ImportPath"
:
"github.com/grpc-ecosystem/go-grpc-prometheus"
,
"ImportPath"
:
"github.com/grpc-ecosystem/go-grpc-prometheus"
,
...
...
vendor/github.com/gophercloud/gophercloud/README.md
View file @
47442f1c
...
@@ -74,7 +74,7 @@ import (
...
@@ -74,7 +74,7 @@ import (
// Option 1: Pass in the values yourself
// Option 1: Pass in the values yourself
opts
:=
gophercloud
.
AuthOptions
{
opts
:=
gophercloud
.
AuthOptions
{
IdentityEndpoint
:
"https://
my-openstack
.com:5000/v2.0"
,
IdentityEndpoint
:
"https://
openstack.example
.com:5000/v2.0"
,
Username
:
"{username}"
,
Username
:
"{username}"
,
Password
:
"{password}"
,
Password
:
"{password}"
,
}
}
...
...
vendor/github.com/gophercloud/gophercloud/auth_options.go
View file @
47442f1c
package
gophercloud
package
gophercloud
/*
/*
AuthOptions stores information needed to authenticate to an OpenStack
cluster
.
AuthOptions stores information needed to authenticate to an OpenStack
Cloud
.
You can populate one manually, or use a provider's AuthOptionsFromEnv() function
You can populate one manually, or use a provider's AuthOptionsFromEnv() function
to read relevant information from the standard environment variables. Pass one
to read relevant information from the standard environment variables. Pass one
to a provider's AuthenticatedClient function to authenticate and obtain a
to a provider's AuthenticatedClient function to authenticate and obtain a
...
@@ -31,9 +31,16 @@ type AuthOptions struct {
...
@@ -31,9 +31,16 @@ type AuthOptions struct {
DomainName
string
`json:"name,omitempty"`
DomainName
string
`json:"name,omitempty"`
// The TenantID and TenantName fields are optional for the Identity V2 API.
// The TenantID and TenantName fields are optional for the Identity V2 API.
// The same fields are known as project_id and project_name in the Identity
// V3 API, but are collected as TenantID and TenantName here in both cases.
// Some providers allow you to specify a TenantName instead of the TenantId.
// Some providers allow you to specify a TenantName instead of the TenantId.
// Some require both. Your provider's authentication policies will determine
// Some require both. Your provider's authentication policies will determine
// how these fields influence authentication.
// how these fields influence authentication.
// If DomainID or DomainName are provided, they will also apply to TenantName.
// It is not currently possible to authenticate with Username and a Domain
// and scope to a Project in a different Domain by using TenantName. To
// accomplish that, the ProjectID will need to be provided to the TenantID
// option.
TenantID
string
`json:"tenantId,omitempty"`
TenantID
string
`json:"tenantId,omitempty"`
TenantName
string
`json:"tenantName,omitempty"`
TenantName
string
`json:"tenantName,omitempty"`
...
...
vendor/github.com/gophercloud/gophercloud/doc.go
View file @
47442f1c
...
@@ -4,11 +4,13 @@ clouds. The library has a three-level hierarchy: providers, services, and
...
@@ -4,11 +4,13 @@ clouds. The library has a three-level hierarchy: providers, services, and
resources.
resources.
Provider structs represent the service providers that offer and manage a
Provider structs represent the service providers that offer and manage a
collection of services. Examples of providers include: OpenStack, Rackspace,
collection of services. The IdentityEndpoint is typically refered to as
HP. These are defined like so:
"auth_url" in information provided by the cloud operator. Additionally,
the cloud may refer to TenantID or TenantName as project_id and project_name.
These are defined like so:
opts := gophercloud.AuthOptions{
opts := gophercloud.AuthOptions{
IdentityEndpoint: "https://
my-openstack
.com:5000/v2.0",
IdentityEndpoint: "https://
openstack.example
.com:5000/v2.0",
Username: "{username}",
Username: "{username}",
Password: "{password}",
Password: "{password}",
TenantID: "{tenant_id}",
TenantID: "{tenant_id}",
...
...
vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v1/apiversions/urls.go
View file @
47442f1c
package
apiversions
package
apiversions
import
(
import
(
"strings"
"net/url"
"net/url"
"strings"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud"
)
)
...
...
vendor/github.com/gophercloud/gophercloud/openstack/client.go
View file @
47442f1c
...
@@ -310,6 +310,19 @@ func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*
...
@@ -310,6 +310,19 @@ func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*
return
&
gophercloud
.
ServiceClient
{
ProviderClient
:
client
,
Endpoint
:
url
},
nil
return
&
gophercloud
.
ServiceClient
{
ProviderClient
:
client
,
Endpoint
:
url
},
nil
}
}
// NewDNSV2 creates a ServiceClient that may be used to access the v2 DNS service.
func
NewDNSV2
(
client
*
gophercloud
.
ProviderClient
,
eo
gophercloud
.
EndpointOpts
)
(
*
gophercloud
.
ServiceClient
,
error
)
{
eo
.
ApplyDefaults
(
"dns"
)
url
,
err
:=
client
.
EndpointLocator
(
eo
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
gophercloud
.
ServiceClient
{
ProviderClient
:
client
,
Endpoint
:
url
,
ResourceBase
:
url
+
"v2/"
},
nil
}
// NewImageServiceV2 creates a ServiceClient that may be used to access the v2 image service.
// NewImageServiceV2 creates a ServiceClient that may be used to access the v2 image service.
func
NewImageServiceV2
(
client
*
gophercloud
.
ProviderClient
,
eo
gophercloud
.
EndpointOpts
)
(
*
gophercloud
.
ServiceClient
,
error
)
{
func
NewImageServiceV2
(
client
*
gophercloud
.
ProviderClient
,
eo
gophercloud
.
EndpointOpts
)
(
*
gophercloud
.
ServiceClient
,
error
)
{
eo
.
ApplyDefaults
(
"image"
)
eo
.
ApplyDefaults
(
"image"
)
...
...
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/requests.go
View file @
47442f1c
...
@@ -54,6 +54,47 @@ func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) paginat
...
@@ -54,6 +54,47 @@ func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) paginat
})
})
}
}
type
CreateOptsBuilder
interface
{
ToFlavorCreateMap
()
(
map
[
string
]
interface
{},
error
)
}
// CreateOpts is passed to Create to create a flavor
// Source:
// https://github.com/openstack/nova/blob/stable/newton/nova/api/openstack/compute/schemas/flavor_manage.py#L20
type
CreateOpts
struct
{
Name
string
`json:"name" required:"true"`
// memory size, in MBs
RAM
int
`json:"ram" required:"true"`
VCPUs
int
`json:"vcpus" required:"true"`
// disk size, in GBs
Disk
*
int
`json:"disk" required:"true"`
ID
string
`json:"id,omitempty"`
// non-zero, positive
Swap
*
int
`json:"swap,omitempty"`
RxTxFactor
float64
`json:"rxtx_factor,omitempty"`
IsPublic
*
bool
`json:"os-flavor-access:is_public,omitempty"`
// ephemeral disk size, in GBs, non-zero, positive
Ephemeral
*
int
`json:"OS-FLV-EXT-DATA:ephemeral,omitempty"`
}
// ToFlavorCreateMap satisfies the CreateOptsBuilder interface
func
(
opts
*
CreateOpts
)
ToFlavorCreateMap
()
(
map
[
string
]
interface
{},
error
)
{
return
gophercloud
.
BuildRequestBody
(
opts
,
"flavor"
)
}
// Create a flavor
func
Create
(
client
*
gophercloud
.
ServiceClient
,
opts
CreateOptsBuilder
)
(
r
CreateResult
)
{
b
,
err
:=
opts
.
ToFlavorCreateMap
()
if
err
!=
nil
{
r
.
Err
=
err
return
}
_
,
r
.
Err
=
client
.
Post
(
createURL
(
client
),
b
,
&
r
.
Body
,
&
gophercloud
.
RequestOpts
{
OkCodes
:
[]
int
{
200
,
201
},
})
return
}
// Get instructs OpenStack to provide details on a single flavor, identified by its ID.
// Get instructs OpenStack to provide details on a single flavor, identified by its ID.
// Use ExtractFlavor to convert its result into a Flavor.
// Use ExtractFlavor to convert its result into a Flavor.
func
Get
(
client
*
gophercloud
.
ServiceClient
,
id
string
)
(
r
GetResult
)
{
func
Get
(
client
*
gophercloud
.
ServiceClient
,
id
string
)
(
r
GetResult
)
{
...
...
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go
View file @
47442f1c
...
@@ -8,13 +8,21 @@ import (
...
@@ -8,13 +8,21 @@ import (
"github.com/gophercloud/gophercloud/pagination"
"github.com/gophercloud/gophercloud/pagination"
)
)
type
commonResult
struct
{
gophercloud
.
Result
}
type
CreateResult
struct
{
commonResult
}
// GetResult temporarily holds the response from a Get call.
// GetResult temporarily holds the response from a Get call.
type
GetResult
struct
{
type
GetResult
struct
{
gophercloud
.
Result
common
Result
}
}
// Extract provides access to the individual Flavor returned by the Get
function
.
// Extract provides access to the individual Flavor returned by the Get
and Create functions
.
func
(
r
Get
Result
)
Extract
()
(
*
Flavor
,
error
)
{
func
(
r
common
Result
)
Extract
()
(
*
Flavor
,
error
)
{
var
s
struct
{
var
s
struct
{
Flavor
*
Flavor
`json:"flavor"`
Flavor
*
Flavor
`json:"flavor"`
}
}
...
@@ -40,41 +48,32 @@ type Flavor struct {
...
@@ -40,41 +48,32 @@ type Flavor struct {
VCPUs
int
`json:"vcpus"`
VCPUs
int
`json:"vcpus"`
}
}
func
(
f
*
Flavor
)
UnmarshalJSON
(
b
[]
byte
)
error
{
func
(
r
*
Flavor
)
UnmarshalJSON
(
b
[]
byte
)
error
{
var
flavor
struct
{
type
tmp
Flavor
ID
string
`json:"id"`
var
s
struct
{
Disk
int
`json:"disk"`
tmp
RAM
int
`json:"ram"`
Swap
interface
{}
`json:"swap"`
Name
string
`json:"name"`
RxTxFactor
float64
`json:"rxtx_factor"`
Swap
interface
{}
`json:"swap"`
VCPUs
int
`json:"vcpus"`
}
}
err
:=
json
.
Unmarshal
(
b
,
&
flavor
)
err
:=
json
.
Unmarshal
(
b
,
&
s
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
f
.
ID
=
flavor
.
ID
*
r
=
Flavor
(
s
.
tmp
)
f
.
Disk
=
flavor
.
Disk
f
.
RAM
=
flavor
.
RAM
f
.
Name
=
flavor
.
Name
f
.
RxTxFactor
=
flavor
.
RxTxFactor
f
.
VCPUs
=
flavor
.
VCPUs
switch
t
:=
flavor
.
Swap
.
(
type
)
{
switch
t
:=
s
.
Swap
.
(
type
)
{
case
float64
:
case
float64
:
f
.
Swap
=
int
(
t
)
r
.
Swap
=
int
(
t
)
case
string
:
case
string
:
switch
t
{
switch
t
{
case
""
:
case
""
:
f
.
Swap
=
0
r
.
Swap
=
0
default
:
default
:
swap
,
err
:=
strconv
.
ParseFloat
(
t
,
64
)
swap
,
err
:=
strconv
.
ParseFloat
(
t
,
64
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
f
.
Swap
=
int
(
swap
)
r
.
Swap
=
int
(
swap
)
}
}
}
}
...
...
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/urls.go
View file @
47442f1c
...
@@ -11,3 +11,7 @@ func getURL(client *gophercloud.ServiceClient, id string) string {
...
@@ -11,3 +11,7 @@ func getURL(client *gophercloud.ServiceClient, id string) string {
func
listURL
(
client
*
gophercloud
.
ServiceClient
)
string
{
func
listURL
(
client
*
gophercloud
.
ServiceClient
)
string
{
return
client
.
ServiceURL
(
"flavors"
,
"detail"
)
return
client
.
ServiceURL
(
"flavors"
,
"detail"
)
}
}
func
createURL
(
client
*
gophercloud
.
ServiceClient
)
string
{
return
client
.
ServiceURL
(
"flavors"
)
}
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/images/results.go
View file @
47442f1c
...
@@ -45,8 +45,8 @@ type Image struct {
...
@@ -45,8 +45,8 @@ type Image struct {
Status
string
Status
string
Updated
string
Updated
string
Metadata
map
[
string
]
string
Metadata
map
[
string
]
interface
{}
}
}
// ImagePage contains a single page of results from a List operation.
// ImagePage contains a single page of results from a List operation.
...
...
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go
View file @
47442f1c
...
@@ -401,11 +401,10 @@ type RebuildOptsBuilder interface {
...
@@ -401,11 +401,10 @@ type RebuildOptsBuilder interface {
// operation
// operation
type
RebuildOpts
struct
{
type
RebuildOpts
struct
{
// The server's admin password
// The server's admin password
AdminPass
string
`json:"adminPass
" required:"true
"`
AdminPass
string
`json:"adminPass
,omitempty
"`
// The ID of the image you want your server to be provisioned on
// The ID of the image you want your server to be provisioned on
ImageID
string
`json:"imageRef"`
ImageID
string
`json:"imageRef"`
ImageName
string
`json:"-"`
ImageName
string
`json:"-"`
//ImageName string `json:"-"`
// Name to set the server to
// Name to set the server to
Name
string
`json:"name,omitempty"`
Name
string
`json:"name,omitempty"`
// AccessIPv4 [optional] provides a new IPv4 address for the instance.
// AccessIPv4 [optional] provides a new IPv4 address for the instance.
...
...
vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/results.go
View file @
47442f1c
...
@@ -19,11 +19,17 @@ type serverResult struct {
...
@@ -19,11 +19,17 @@ type serverResult struct {
// Extract interprets any serverResult as a Server, if possible.
// Extract interprets any serverResult as a Server, if possible.
func
(
r
serverResult
)
Extract
()
(
*
Server
,
error
)
{
func
(
r
serverResult
)
Extract
()
(
*
Server
,
error
)
{
var
s
struct
{
var
s
Server
Server
*
Server
`json:"server"`
}
err
:=
r
.
ExtractInto
(
&
s
)
err
:=
r
.
ExtractInto
(
&
s
)
return
s
.
Server
,
err
return
&
s
,
err
}
func
(
r
serverResult
)
ExtractInto
(
v
interface
{})
error
{
return
r
.
Result
.
ExtractIntoStructPtr
(
v
,
"server"
)
}
func
ExtractServersInto
(
r
pagination
.
Page
,
v
interface
{})
error
{
return
r
.
(
ServerPage
)
.
Result
.
ExtractIntoSlicePtr
(
v
,
"servers"
)
}
}
// CreateResult temporarily contains the response from a Create call.
// CreateResult temporarily contains the response from a Create call.
...
@@ -221,11 +227,9 @@ func (r ServerPage) NextPageURL() (string, error) {
...
@@ -221,11 +227,9 @@ func (r ServerPage) NextPageURL() (string, error) {
// ExtractServers interprets the results of a single page from a List() call, producing a slice of Server entities.
// ExtractServers interprets the results of a single page from a List() call, producing a slice of Server entities.
func
ExtractServers
(
r
pagination
.
Page
)
([]
Server
,
error
)
{
func
ExtractServers
(
r
pagination
.
Page
)
([]
Server
,
error
)
{
var
s
struct
{
var
s
[]
Server
Servers
[]
Server
`json:"servers"`
err
:=
ExtractServersInto
(
r
,
&
s
)
}
return
s
,
err
err
:=
(
r
.
(
ServerPage
))
.
ExtractInto
(
&
s
)
return
s
.
Servers
,
err
}
}
// MetadataResult contains the result of a call for (potentially) multiple key-value pairs.
// MetadataResult contains the result of a call for (potentially) multiple key-value pairs.
...
...
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips/requests.go
View file @
47442f1c
...
@@ -21,6 +21,7 @@ type ListOpts struct {
...
@@ -21,6 +21,7 @@ type ListOpts struct {
Marker
string
`q:"marker"`
Marker
string
`q:"marker"`
SortKey
string
`q:"sort_key"`
SortKey
string
`q:"sort_key"`
SortDir
string
`q:"sort_dir"`
SortDir
string
`q:"sort_dir"`
RouterID
string
`q:"router_id"`
}
}
// List returns a Pager which allows you to iterate over a collection of
// List returns a Pager which allows you to iterate over a collection of
...
...
vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips/results.go
View file @
47442f1c
...
@@ -34,6 +34,9 @@ type FloatingIP struct {
...
@@ -34,6 +34,9 @@ type FloatingIP struct {
// The condition of the API resource.
// The condition of the API resource.
Status
string
`json:"status"`
Status
string
`json:"status"`
//The ID of the router used for this Floating-IP
RouterID
string
`json:"router_id"`
}
}
type
commonResult
struct
{
type
commonResult
struct
{
...
...
vendor/github.com/gophercloud/gophercloud/pagination/pager.go
View file @
47442f1c
...
@@ -145,27 +145,24 @@ func (p Pager) AllPages() (Page, error) {
...
@@ -145,27 +145,24 @@ func (p Pager) AllPages() (Page, error) {
// Switch on the page body type. Recognized types are `map[string]interface{}`,
// Switch on the page body type. Recognized types are `map[string]interface{}`,
// `[]byte`, and `[]interface{}`.
// `[]byte`, and `[]interface{}`.
switch
testPage
.
GetBody
()
.
(
type
)
{
switch
pb
:=
testPage
.
GetBody
()
.
(
type
)
{
case
map
[
string
]
interface
{}
:
case
map
[
string
]
interface
{}
:
// key is the map key for the page body if the body type is `map[string]interface{}`.
// key is the map key for the page body if the body type is `map[string]interface{}`.
var
key
string
var
key
string
// Iterate over the pages to concatenate the bodies.
// Iterate over the pages to concatenate the bodies.
err
=
p
.
EachPage
(
func
(
page
Page
)
(
bool
,
error
)
{
err
=
p
.
EachPage
(
func
(
page
Page
)
(
bool
,
error
)
{
b
:=
page
.
GetBody
()
.
(
map
[
string
]
interface
{})
b
:=
page
.
GetBody
()
.
(
map
[
string
]
interface
{})
for
k
:=
range
b
{
for
k
,
v
:=
range
b
{
// If it's a linked page, we don't want the `links`, we want the other one.
// If it's a linked page, we don't want the `links`, we want the other one.
if
!
strings
.
HasSuffix
(
k
,
"links"
)
{
if
!
strings
.
HasSuffix
(
k
,
"links"
)
{
key
=
k
// check the field's type. we only want []interface{} (which is really []map[string]interface{})
switch
vt
:=
v
.
(
type
)
{
case
[]
interface
{}
:
key
=
k
pagesSlice
=
append
(
pagesSlice
,
vt
...
)
}
}
}
}
}
switch
keyType
:=
b
[
key
]
.
(
type
)
{
case
map
[
string
]
interface
{}
:
pagesSlice
=
append
(
pagesSlice
,
keyType
)
case
[]
interface
{}
:
pagesSlice
=
append
(
pagesSlice
,
b
[
key
]
.
([]
interface
{})
...
)
default
:
return
false
,
fmt
.
Errorf
(
"Unsupported page body type: %+v"
,
keyType
)
}
return
true
,
nil
return
true
,
nil
})
})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -216,7 +213,7 @@ func (p Pager) AllPages() (Page, error) {
...
@@ -216,7 +213,7 @@ func (p Pager) AllPages() (Page, error) {
default
:
default
:
err
:=
gophercloud
.
ErrUnexpectedType
{}
err
:=
gophercloud
.
ErrUnexpectedType
{}
err
.
Expected
=
"map[string]interface{}/[]byte/[]interface{}"
err
.
Expected
=
"map[string]interface{}/[]byte/[]interface{}"
err
.
Actual
=
fmt
.
Sprintf
(
"%
v"
,
reflect
.
TypeOf
(
testPage
.
GetBody
())
)
err
.
Actual
=
fmt
.
Sprintf
(
"%
T"
,
pb
)
return
nil
,
err
return
nil
,
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment