-
Notifications
You must be signed in to change notification settings - Fork 233
/
Copy pathassisted_install_client.go
84 lines (71 loc) · 2.51 KB
/
assisted_install_client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Code generated by go-swagger; DO NOT EDIT.
package client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"net/url"
"github.com/go-openapi/runtime"
rtclient "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/openshift/assisted-service/client/events"
"github.com/openshift/assisted-service/client/installer"
"github.com/openshift/assisted-service/client/managed_domains"
"github.com/openshift/assisted-service/client/manifests"
"github.com/openshift/assisted-service/client/operators"
"github.com/openshift/assisted-service/client/versions"
)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "api.openshift.com"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/api/assisted-install"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"http", "https"}
type Config struct {
// URL is the base URL of the upstream server
URL *url.URL
// Transport is an inner transport for the client
Transport http.RoundTripper
// AuthInfo is for authentication
AuthInfo runtime.ClientAuthInfoWriter
}
// New creates a new assisted install HTTP client.
func New(c Config) *AssistedInstall {
var (
host = DefaultHost
basePath = DefaultBasePath
schemes = DefaultSchemes
)
if c.URL != nil {
host = c.URL.Host
basePath = c.URL.Path
schemes = []string{c.URL.Scheme}
}
transport := rtclient.New(host, basePath, schemes)
if c.Transport != nil {
transport.Transport = c.Transport
}
cli := new(AssistedInstall)
cli.Transport = transport
cli.Events = events.New(transport, strfmt.Default, c.AuthInfo)
cli.Installer = installer.New(transport, strfmt.Default, c.AuthInfo)
cli.ManagedDomains = managed_domains.New(transport, strfmt.Default, c.AuthInfo)
cli.Manifests = manifests.New(transport, strfmt.Default, c.AuthInfo)
cli.Operators = operators.New(transport, strfmt.Default, c.AuthInfo)
cli.Versions = versions.New(transport, strfmt.Default, c.AuthInfo)
return cli
}
// AssistedInstall is a client for assisted install
type AssistedInstall struct {
Events *events.Client
Installer *installer.Client
ManagedDomains *managed_domains.Client
Manifests *manifests.Client
Operators *operators.Client
Versions *versions.Client
Transport runtime.ClientTransport
}