-
Notifications
You must be signed in to change notification settings - Fork 165
/
openshiftcluster_example.go
90 lines (79 loc) · 2.96 KB
/
openshiftcluster_example.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
package v20231122
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
import (
"github.com/Azure/ARO-RP/pkg/api"
)
func exampleOpenShiftCluster() *OpenShiftCluster {
doc := api.ExampleOpenShiftClusterDocument()
return (&openShiftClusterConverter{}).ToExternal(doc.OpenShiftCluster).(*OpenShiftCluster)
}
// ExampleOpenShiftClusterPatchParameter returns an example OpenShiftCluster
// object that an end-user might send to create a cluster in a PATCH request
func ExampleOpenShiftClusterPatchParameter() interface{} {
oc := ExampleOpenShiftClusterPutParameter().(*OpenShiftCluster)
oc.Location = ""
oc.SystemData = nil
oc.Properties.WorkerProfilesStatus = nil
return oc
}
// ExampleOpenShiftClusterPutParameter returns an example OpenShiftCluster
// object that an end-user might send to create a cluster in a PUT request
func ExampleOpenShiftClusterPutParameter() interface{} {
oc := exampleOpenShiftCluster()
oc.ID = ""
oc.Name = ""
oc.Type = ""
oc.Properties.ProvisioningState = ""
oc.Properties.ClusterProfile.Version = ""
oc.Properties.ClusterProfile.FipsValidatedModules = FipsValidatedModulesEnabled
oc.Properties.ConsoleProfile.URL = ""
oc.Properties.APIServerProfile.URL = ""
oc.Properties.APIServerProfile.IP = ""
oc.Properties.IngressProfiles[0].IP = ""
oc.Properties.MasterProfile.EncryptionAtHost = EncryptionAtHostEnabled
oc.Properties.WorkerProfilesStatus = nil
oc.Properties.NetworkProfile.LoadBalancerProfile = &LoadBalancerProfile{
ManagedOutboundIPs: &ManagedOutboundIPs{
Count: 1,
},
}
oc.SystemData = nil
return oc
}
// ExampleOpenShiftClusterResponse returns an example OpenShiftCluster object
// that the RP might return to an end-user in a GET response
func ExampleOpenShiftClusterGetResponse() interface{} {
oc := exampleOpenShiftCluster()
oc.Properties.ClusterProfile.PullSecret = ""
oc.Properties.ServicePrincipalProfile.ClientSecret = ""
oc.Properties.NetworkProfile.LoadBalancerProfile = &LoadBalancerProfile{
EffectiveOutboundIPs: []EffectiveOutboundIP{
{
ID: "/subscriptions/subscriptionId/resourceGroups/clusterResourceGroup/providers/Microsoft.Network/publicIPAddresses/publicIPAddressName",
},
},
ManagedOutboundIPs: &ManagedOutboundIPs{
Count: 1,
},
}
return oc
}
// ExampleOpenShiftClusterResponse returns an example OpenShiftCluster object
// that the RP might return to an end-user in a PUT/PATCH response
func ExampleOpenShiftClusterPutOrPatchResponse() interface{} {
oc := exampleOpenShiftCluster()
oc.Properties.ClusterProfile.PullSecret = ""
oc.Properties.ServicePrincipalProfile.ClientSecret = ""
oc.Properties.WorkerProfilesStatus = nil
return oc
}
// ExampleOpenShiftClusterListResponse returns an example OpenShiftClusterList
// object that the RP might return to an end-user
func ExampleOpenShiftClusterListResponse() interface{} {
return &OpenShiftClusterList{
OpenShiftClusters: []*OpenShiftCluster{
ExampleOpenShiftClusterGetResponse().(*OpenShiftCluster),
},
}
}