Sync baremetal openstack with upstream
Change-Id: I125fc08e2cc4433aeaa470de48823dd4434c2030
Related-PROD: PROD-33018
diff --git a/openstack/baremetal/noauth/requests.go b/openstack/baremetal/noauth/requests.go
new file mode 100644
index 0000000..0b956e4
--- /dev/null
+++ b/openstack/baremetal/noauth/requests.go
@@ -0,0 +1,36 @@
+package noauth
+
+import (
+ "fmt"
+
+ "gerrit.mcp.mirantis.net/debian/gophercloud.git"
+)
+
+// EndpointOpts specifies a "noauth" Ironic Endpoint.
+type EndpointOpts struct {
+ // IronicEndpoint [required] is currently only used with "noauth" Ironic.
+ // An Ironic endpoint with "auth_strategy=noauth" is necessary, for example:
+ // http://ironic.example.com:6385/v1.
+ IronicEndpoint string
+}
+
+func initClientOpts(client *gophercloud.ProviderClient, eo EndpointOpts) (*gophercloud.ServiceClient, error) {
+ sc := new(gophercloud.ServiceClient)
+ if eo.IronicEndpoint == "" {
+ return nil, fmt.Errorf("IronicEndpoint is required")
+ }
+
+ sc.Endpoint = gophercloud.NormalizeURL(eo.IronicEndpoint)
+ sc.ProviderClient = client
+ return sc, nil
+}
+
+// NewBareMetalNoAuth creates a ServiceClient that may be used to access a
+// "noauth" bare metal service.
+func NewBareMetalNoAuth(eo EndpointOpts) (*gophercloud.ServiceClient, error) {
+ sc, err := initClientOpts(&gophercloud.ProviderClient{}, eo)
+
+ // sc.Type = "baremetal"
+
+ return sc, err
+}