forked from rancher/types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
103 lines (83 loc) · 3.5 KB
/
types.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package v3
import (
"github.com/rancher/norman/types"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type ServiceAccountToken struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
AccountName string `json:"accountName"`
AccountUID string `json:"accountUid"`
Description string `json:"description"`
Token string `json:"token" norman:"writeOnly"`
CACRT string `json:"caCrt"`
}
type NamespacedServiceAccountToken ServiceAccountToken
type DockerCredential struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Description string `json:"description"`
Registries map[string]RegistryCredential `json:"registries"`
}
type NamespacedDockerCredential DockerCredential
type RegistryCredential struct {
Description string `json:"description"`
Username string `json:"username"`
Password string `json:"password" norman:"writeOnly"`
Auth string `json:"auth" norman:"writeOnly"`
}
type Certificate struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Description string `json:"description"`
Certs string `json:"certs"`
Key string `json:"key" norman:"writeOnly"`
CertFingerprint string `json:"certFingerprint" norman:"nocreate,noupdate"`
CN string `json:"cn" norman:"nocreate,noupdate"`
Version string `json:"version" norman:"nocreate,noupdate"`
ExpiresAt string `json:"expiresAt" norman:"nocreate,noupdate"`
Issuer string `json:"issuer" norman:"nocreate,noupdate"`
IssuedAt string `json:"issuedAt" norman:"nocreate,noupdate"`
Algorithm string `json:"algorithm" norman:"nocreate,noupdate"`
SerialNumber string `json:"serialNumber" norman:"nocreate,noupdate"`
KeySize string `json:"keySize" norman:"nocreate,noupdate"`
SubjectAlternativeNames []string `json:"subjectAlternativeNames" norman:"nocreate,noupdate"`
}
type NamespacedCertificate Certificate
type BasicAuth struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Description string `json:"description"`
Username string `json:"username"`
Password string `json:"password" norman:"writeOnly"`
}
type NamespacedBasicAuth BasicAuth
type SSHAuth struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Description string `json:"description"`
PrivateKey string `json:"privateKey" norman:"writeOnly"`
Fingerprint string `json:"certFingerprint" norman:"nocreate,noupdate"`
}
type NamespacedSSHAuth SSHAuth
type PublicEndpoint struct {
NodeName string `json:"nodeName,omitempty" norman:"type=reference[/v3/schemas/node],nocreate,noupdate"`
Address string `json:"address,omitempty" norman:"nocreate,noupdate"`
Port int32 `json:"port,omitempty" norman:"nocreate,noupdate"`
Protocol string `json:"protocol,omitempty" norman:"nocreate,noupdate"`
// for node port service
ServiceName string `json:"serviceName,omitempty" norman:"type=reference[service],nocreate,noupdate"`
// for host port
PodName string `json:"podName,omitempty" norman:"type=reference[pod],nocreate,noupdate"`
//serviceName and podName are mutually exclusive
}
type Workload struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
}