mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 13:50:01 +00:00 
			
		
		
		
	
							
								
								
									
										66
									
								
								Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										66
									
								
								Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							| @@ -1454,123 +1454,123 @@ | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/blockstorage/v1/apiversions", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/blockstorage/v1/volumes", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/common/extensions", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/flavors", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/images", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/compute/v2/servers", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/members", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/monitors", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/pools", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas/vips", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/listeners", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/loadbalancers", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/monitors", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/pools", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/networking/v2/ports", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/openstack/utils", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gophercloud/gophercloud/pagination", | ||||
| 			"Rev": "b06120d13e262ceaf890ef38ee30898813696af0" | ||||
| 			"Rev": "ce1e02c3ccfdb7fab257340dc4d603ec3035fa11" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/gorilla/context", | ||||
| @@ -1655,17 +1655,17 @@ | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/heketi/heketi/client/api/go-client", | ||||
| 			"Comment": "2017-03-08T23:29:50Z", | ||||
| 			"Comment": "v4.0.0-22-g7a54b6f", | ||||
| 			"Rev": "7a54b6fc903feab1e7cb6573177ca09b544eb1e2" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/heketi/heketi/pkg/glusterfs/api", | ||||
| 			"Comment": "2017-03-08T23:29:50Z", | ||||
| 			"Comment": "v4.0.0-22-g7a54b6f", | ||||
| 			"Rev": "7a54b6fc903feab1e7cb6573177ca09b544eb1e2" | ||||
| 		}, | ||||
| 		{ | ||||
| 			"ImportPath": "github.com/heketi/heketi/pkg/utils", | ||||
| 			"Comment": "2017-03-08T23:29:50Z", | ||||
| 			"Comment": "v4.0.0-22-g7a54b6f", | ||||
| 			"Rev": "7a54b6fc903feab1e7cb6573177ca09b544eb1e2" | ||||
| 		}, | ||||
| 		{ | ||||
|   | ||||
							
								
								
									
										5
									
								
								vendor/github.com/emicklei/go-restful-swagger12/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								vendor/github.com/emicklei/go-restful-swagger12/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -37,9 +37,6 @@ filegroup( | ||||
|  | ||||
| filegroup( | ||||
|     name = "all-srcs", | ||||
|     srcs = [ | ||||
|         ":package-srcs", | ||||
|         "//vendor/github.com/emicklei/go-restful-swagger12/test_package:all-srcs", | ||||
|     ], | ||||
|     srcs = [":package-srcs"], | ||||
|     tags = ["automanaged"], | ||||
| ) | ||||
|   | ||||
							
								
								
									
										16
									
								
								vendor/github.com/emicklei/go-restful-swagger12/test_package/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								vendor/github.com/emicklei/go-restful-swagger12/test_package/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,16 +0,0 @@ | ||||
| package(default_visibility = ["//visibility:public"]) | ||||
|  | ||||
| licenses(["notice"]) | ||||
|  | ||||
| filegroup( | ||||
|     name = "package-srcs", | ||||
|     srcs = glob(["**"]), | ||||
|     tags = ["automanaged"], | ||||
|     visibility = ["//visibility:private"], | ||||
| ) | ||||
|  | ||||
| filegroup( | ||||
|     name = "all-srcs", | ||||
|     srcs = [":package-srcs"], | ||||
|     tags = ["automanaged"], | ||||
| ) | ||||
							
								
								
									
										2
									
								
								vendor/github.com/gophercloud/gophercloud/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/gophercloud/gophercloud/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -74,7 +74,7 @@ import ( | ||||
|  | ||||
| // Option 1: Pass in the values yourself | ||||
| opts := gophercloud.AuthOptions{ | ||||
|   IdentityEndpoint: "https://my-openstack.com:5000/v2.0", | ||||
|   IdentityEndpoint: "https://openstack.example.com:5000/v2.0", | ||||
|   Username: "{username}", | ||||
|   Password: "{password}", | ||||
| } | ||||
|   | ||||
							
								
								
									
										20
									
								
								vendor/github.com/gophercloud/gophercloud/auth_options.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								vendor/github.com/gophercloud/gophercloud/auth_options.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,7 +1,7 @@ | ||||
| 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 | ||||
| to read relevant information from the standard environment variables. Pass one | ||||
| to a provider's AuthenticatedClient function to authenticate and obtain a | ||||
| @@ -31,9 +31,16 @@ type AuthOptions struct { | ||||
| 	DomainName string `json:"name,omitempty"` | ||||
|  | ||||
| 	// 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 require both. Your provider's authentication policies will determine | ||||
| 	// 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"` | ||||
| 	TenantName string `json:"tenantName,omitempty"` | ||||
|  | ||||
| @@ -132,14 +139,6 @@ func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[s | ||||
| 	// if insufficient or incompatible information is present. | ||||
| 	var req request | ||||
|  | ||||
| 	// Test first for unrecognized arguments. | ||||
| 	if opts.TenantID != "" { | ||||
| 		return nil, ErrTenantIDProvided{} | ||||
| 	} | ||||
| 	if opts.TenantName != "" { | ||||
| 		return nil, ErrTenantNameProvided{} | ||||
| 	} | ||||
|  | ||||
| 	if opts.Password == "" { | ||||
| 		if opts.TokenID != "" { | ||||
| 			// Because we aren't using password authentication, it's an error to also provide any of the user-based authentication | ||||
| @@ -252,15 +251,12 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { | ||||
|  | ||||
| 	if opts.TenantID != "" { | ||||
| 		scope.ProjectID = opts.TenantID | ||||
| 		opts.TenantID = "" | ||||
| 		opts.TenantName = "" | ||||
| 	} else { | ||||
| 		if opts.TenantName != "" { | ||||
| 			scope.ProjectName = opts.TenantName | ||||
| 			scope.DomainID = opts.DomainID | ||||
| 			scope.DomainName = opts.DomainName | ||||
| 		} | ||||
| 		opts.TenantName = "" | ||||
| 	} | ||||
|  | ||||
| 	if scope.ProjectName != "" { | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/github.com/gophercloud/gophercloud/doc.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/gophercloud/gophercloud/doc.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -4,11 +4,13 @@ clouds. The library has a three-level hierarchy: providers, services, and | ||||
| resources. | ||||
|  | ||||
| Provider structs represent the service providers that offer and manage a | ||||
| collection of services. Examples of providers include: OpenStack, Rackspace, | ||||
| HP. These are defined like so: | ||||
| collection of services. The IdentityEndpoint is typically refered to as | ||||
| "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{ | ||||
|     IdentityEndpoint: "https://my-openstack.com:5000/v2.0", | ||||
|     IdentityEndpoint: "https://openstack.example.com:5000/v2.0", | ||||
|     Username: "{username}", | ||||
|     Password: "{password}", | ||||
|     TenantID: "{tenant_id}", | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| package apiversions | ||||
|  | ||||
| import ( | ||||
| 	"strings" | ||||
| 	"net/url" | ||||
| 	"strings" | ||||
|  | ||||
| 	"github.com/gophercloud/gophercloud" | ||||
| ) | ||||
|   | ||||
							
								
								
									
										13
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/client.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/client.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -310,6 +310,19 @@ func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (* | ||||
| 	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. | ||||
| func NewImageServiceV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { | ||||
| 	eo.ApplyDefaults("image") | ||||
|   | ||||
							
								
								
									
										41
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/requests.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										41
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/requests.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -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. | ||||
| // Use ExtractFlavor to convert its result into a Flavor. | ||||
| func Get(client *gophercloud.ServiceClient, id string) (r GetResult) { | ||||
|   | ||||
							
								
								
									
										47
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										47
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -8,13 +8,21 @@ import ( | ||||
| 	"github.com/gophercloud/gophercloud/pagination" | ||||
| ) | ||||
|  | ||||
| // GetResult temporarily holds the response from a Get call. | ||||
| type GetResult struct { | ||||
| type commonResult struct { | ||||
| 	gophercloud.Result | ||||
| } | ||||
|  | ||||
| // Extract provides access to the individual Flavor returned by the Get function. | ||||
| func (r GetResult) Extract() (*Flavor, error) { | ||||
| type CreateResult struct { | ||||
| 	commonResult | ||||
| } | ||||
|  | ||||
| // GetResult temporarily holds the response from a Get call. | ||||
| type GetResult struct { | ||||
| 	commonResult | ||||
| } | ||||
|  | ||||
| // Extract provides access to the individual Flavor returned by the Get and Create functions. | ||||
| func (r commonResult) Extract() (*Flavor, error) { | ||||
| 	var s struct { | ||||
| 		Flavor *Flavor `json:"flavor"` | ||||
| 	} | ||||
| @@ -40,41 +48,32 @@ type Flavor struct { | ||||
| 	VCPUs int `json:"vcpus"` | ||||
| } | ||||
|  | ||||
| func (f *Flavor) UnmarshalJSON(b []byte) error { | ||||
| 	var flavor struct { | ||||
| 		ID         string      `json:"id"` | ||||
| 		Disk       int         `json:"disk"` | ||||
| 		RAM        int         `json:"ram"` | ||||
| 		Name       string      `json:"name"` | ||||
| 		RxTxFactor float64     `json:"rxtx_factor"` | ||||
| 		Swap       interface{} `json:"swap"` | ||||
| 		VCPUs      int         `json:"vcpus"` | ||||
| func (r *Flavor) UnmarshalJSON(b []byte) error { | ||||
| 	type tmp Flavor | ||||
| 	var s struct { | ||||
| 		tmp | ||||
| 		Swap interface{} `json:"swap"` | ||||
| 	} | ||||
| 	err := json.Unmarshal(b, &flavor) | ||||
| 	err := json.Unmarshal(b, &s) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	f.ID = flavor.ID | ||||
| 	f.Disk = flavor.Disk | ||||
| 	f.RAM = flavor.RAM | ||||
| 	f.Name = flavor.Name | ||||
| 	f.RxTxFactor = flavor.RxTxFactor | ||||
| 	f.VCPUs = flavor.VCPUs | ||||
| 	*r = Flavor(s.tmp) | ||||
|  | ||||
| 	switch t := flavor.Swap.(type) { | ||||
| 	switch t := s.Swap.(type) { | ||||
| 	case float64: | ||||
| 		f.Swap = int(t) | ||||
| 		r.Swap = int(t) | ||||
| 	case string: | ||||
| 		switch t { | ||||
| 		case "": | ||||
| 			f.Swap = 0 | ||||
| 			r.Swap = 0 | ||||
| 		default: | ||||
| 			swap, err := strconv.ParseFloat(t, 64) | ||||
| 			if err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 			f.Swap = int(swap) | ||||
| 			r.Swap = int(swap) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
							
								
								
									
										4
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/urls.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/urls.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -11,3 +11,7 @@ func getURL(client *gophercloud.ServiceClient, id string) string { | ||||
| func listURL(client *gophercloud.ServiceClient) string { | ||||
| 	return client.ServiceURL("flavors", "detail") | ||||
| } | ||||
|  | ||||
| func createURL(client *gophercloud.ServiceClient) string { | ||||
| 	return client.ServiceURL("flavors") | ||||
| } | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/images/results.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/images/results.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -46,7 +46,7 @@ type Image struct { | ||||
|  | ||||
| 	Updated string | ||||
|  | ||||
| 	Metadata map[string]string | ||||
| 	Metadata map[string]interface{} | ||||
| } | ||||
|  | ||||
| // ImagePage contains a single page of results from a List operation. | ||||
|   | ||||
							
								
								
									
										3
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -401,11 +401,10 @@ type RebuildOptsBuilder interface { | ||||
| // operation | ||||
| type RebuildOpts struct { | ||||
| 	// 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 | ||||
| 	ImageID   string `json:"imageRef"` | ||||
| 	ImageName string `json:"-"` | ||||
| 	//ImageName string `json:"-"` | ||||
| 	// Name to set the server to | ||||
| 	Name string `json:"name,omitempty"` | ||||
| 	// AccessIPv4 [optional] provides a new IPv4 address for the instance. | ||||
|   | ||||
							
								
								
									
										22
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/results.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/results.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -19,11 +19,17 @@ type serverResult struct { | ||||
|  | ||||
| // Extract interprets any serverResult as a Server, if possible. | ||||
| func (r serverResult) Extract() (*Server, error) { | ||||
| 	var s struct { | ||||
| 		Server *Server `json:"server"` | ||||
| 	} | ||||
| 	var s Server | ||||
| 	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. | ||||
| @@ -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. | ||||
| func ExtractServers(r pagination.Page) ([]Server, error) { | ||||
| 	var s struct { | ||||
| 		Servers []Server `json:"servers"` | ||||
| 	} | ||||
| 	err := (r.(ServerPage)).ExtractInto(&s) | ||||
| 	return s.Servers, err | ||||
| 	var s []Server | ||||
| 	err := ExtractServersInto(r, &s) | ||||
| 	return s, err | ||||
| } | ||||
|  | ||||
| // MetadataResult contains the result of a call for (potentially) multiple key-value pairs. | ||||
|   | ||||
| @@ -21,6 +21,7 @@ type ListOpts struct { | ||||
| 	Marker            string `q:"marker"` | ||||
| 	SortKey           string `q:"sort_key"` | ||||
| 	SortDir           string `q:"sort_dir"` | ||||
| 	RouterID          string `q:"router_id"` | ||||
| } | ||||
|  | ||||
| // List returns a Pager which allows you to iterate over a collection of | ||||
|   | ||||
| @@ -34,6 +34,9 @@ type FloatingIP struct { | ||||
|  | ||||
| 	// The condition of the API resource. | ||||
| 	Status string `json:"status"` | ||||
|  | ||||
| 	//The ID of the router used for this Floating-IP | ||||
| 	RouterID string `json:"router_id"` | ||||
| } | ||||
|  | ||||
| type commonResult struct { | ||||
|   | ||||
| @@ -47,13 +47,31 @@ type RuleEtherType string | ||||
|  | ||||
| // Constants useful for CreateOpts | ||||
| const ( | ||||
| 	DirIngress   RuleDirection = "ingress" | ||||
| 	DirEgress    RuleDirection = "egress" | ||||
| 	ProtocolTCP  RuleProtocol  = "tcp" | ||||
| 	ProtocolUDP  RuleProtocol  = "udp" | ||||
| 	ProtocolICMP RuleProtocol  = "icmp" | ||||
| 	EtherType4   RuleEtherType = "IPv4" | ||||
| 	EtherType6   RuleEtherType = "IPv6" | ||||
| 	DirIngress        RuleDirection = "ingress" | ||||
| 	DirEgress         RuleDirection = "egress" | ||||
| 	EtherType4        RuleEtherType = "IPv4" | ||||
| 	EtherType6        RuleEtherType = "IPv6" | ||||
| 	ProtocolAH        RuleProtocol  = "ah" | ||||
| 	ProtocolDCCP      RuleProtocol  = "dccp" | ||||
| 	ProtocolEGP       RuleProtocol  = "egp" | ||||
| 	ProtocolESP       RuleProtocol  = "esp" | ||||
| 	ProtocolGRE       RuleProtocol  = "gre" | ||||
| 	ProtocolICMP      RuleProtocol  = "icmp" | ||||
| 	ProtocolIGMP      RuleProtocol  = "igmp" | ||||
| 	ProtocolIPv6Encap RuleProtocol  = "ipv6-encap" | ||||
| 	ProtocolIPv6Frag  RuleProtocol  = "ipv6-frag" | ||||
| 	ProtocolIPv6ICMP  RuleProtocol  = "ipv6-icmp" | ||||
| 	ProtocolIPv6NoNxt RuleProtocol  = "ipv6-nonxt" | ||||
| 	ProtocolIPv6Opts  RuleProtocol  = "ipv6-opts" | ||||
| 	ProtocolIPv6Route RuleProtocol  = "ipv6-route" | ||||
| 	ProtocolOSPF      RuleProtocol  = "ospf" | ||||
| 	ProtocolPGM       RuleProtocol  = "pgm" | ||||
| 	ProtocolRSVP      RuleProtocol  = "rsvp" | ||||
| 	ProtocolSCTP      RuleProtocol  = "sctp" | ||||
| 	ProtocolTCP       RuleProtocol  = "tcp" | ||||
| 	ProtocolUDP       RuleProtocol  = "udp" | ||||
| 	ProtocolUDPLite   RuleProtocol  = "udplite" | ||||
| 	ProtocolVRRP      RuleProtocol  = "vrrp" | ||||
| ) | ||||
|  | ||||
| // CreateOptsBuilder is what types must satisfy to be used as Create | ||||
|   | ||||
							
								
								
									
										21
									
								
								vendor/github.com/gophercloud/gophercloud/pagination/pager.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								vendor/github.com/gophercloud/gophercloud/pagination/pager.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -145,27 +145,24 @@ func (p Pager) AllPages() (Page, error) { | ||||
|  | ||||
| 	// Switch on the page body type. Recognized types are `map[string]interface{}`, | ||||
| 	// `[]byte`, and `[]interface{}`. | ||||
| 	switch testPage.GetBody().(type) { | ||||
| 	switch pb := testPage.GetBody().(type) { | ||||
| 	case map[string]interface{}: | ||||
| 		// key is the map key for the page body if the body type is `map[string]interface{}`. | ||||
| 		var key string | ||||
| 		// Iterate over the pages to concatenate the bodies. | ||||
| 		err = p.EachPage(func(page Page) (bool, error) { | ||||
| 			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 !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 | ||||
| 		}) | ||||
| 		if err != nil { | ||||
| @@ -216,7 +213,7 @@ func (p Pager) AllPages() (Page, error) { | ||||
| 	default: | ||||
| 		err := gophercloud.ErrUnexpectedType{} | ||||
| 		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 | ||||
| 	} | ||||
|  | ||||
|   | ||||
							
								
								
									
										1
									
								
								vendor/github.com/heketi/heketi/AUTHORS
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/heketi/heketi/AUTHORS
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -6,3 +6,4 @@ mliyazud@redhat.com | ||||
| nerawat@redhat.com | ||||
| obnox@redhat.com | ||||
| obnox@samba.org | ||||
| lpabon@gmail.com | ||||
|   | ||||
		Reference in New Issue
	
	Block a user