Skip to content

Commit

Permalink
Merge pull request #37 from jtopjian/clientconfig-new-clients
Browse files Browse the repository at this point in the history
Add additional services to NewServiceClient
  • Loading branch information
jtopjian authored May 15, 2018
2 parents 26c1683 + 57d5c8c commit 799f10b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.swp
.idea
.vscode
Binary file removed openstack/clientconfig/.requests.go.swp
Binary file not shown.
8 changes: 8 additions & 0 deletions openstack/clientconfig/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,12 @@ func NewServiceClient(service string, opts *ClientOpts) (*gophercloud.ServiceCli
}

switch service {
case "clustering":
return openstack.NewClusteringV1(pClient, eo)
case "compute":
return openstack.NewComputeV2(pClient, eo)
case "container":
return openstack.NewContainerV1(pClient, eo)
case "database":
return openstack.NewDBV1(pClient, eo)
case "dns":
Expand All @@ -504,6 +508,8 @@ func NewServiceClient(service string, opts *ClientOpts) (*gophercloud.ServiceCli
}
case "image":
return openstack.NewImageServiceV2(pClient, eo)
case "load-balancer":
return openstack.NewLoadBalancerV2(pClient, eo)
case "network":
return openstack.NewNetworkV2(pClient, eo)
case "object-store":
Expand All @@ -523,6 +529,8 @@ func NewServiceClient(service string, opts *ClientOpts) (*gophercloud.ServiceCli
return openstack.NewBlockStorageV1(pClient, eo)
case "v2", "2":
return openstack.NewBlockStorageV2(pClient, eo)
case "v3", "3":
return openstack.NewBlockStorageV3(pClient, eo)
default:
return nil, fmt.Errorf("invalid volume API version")
}
Expand Down

0 comments on commit 799f10b

Please sign in to comment.