|
1 |
| -/* |
2 |
| -Copyright 2022 The Crossplane Authors. |
3 |
| -
|
4 |
| -Licensed under the Apache License, Version 2.0 (the "License"); |
5 |
| -you may not use this file except in compliance with the License. |
6 |
| -You may obtain a copy of the License at |
7 |
| -
|
8 |
| - http://www.apache.org/licenses/LICENSE-2.0 |
9 |
| -
|
10 |
| -Unless required by applicable law or agreed to in writing, software |
11 |
| -distributed under the License is distributed on an "AS IS" BASIS, |
12 |
| -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 |
| -See the License for the specific language governing permissions and |
14 |
| -limitations under the License. |
15 |
| -*/ |
16 |
| - |
17 |
| -package v1alpha1 |
18 |
| - |
19 |
| -import ( |
20 |
| - "reflect" |
21 |
| - |
22 |
| - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
23 |
| - "k8s.io/apimachinery/pkg/runtime/schema" |
24 |
| - |
25 |
| - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" |
26 |
| -) |
27 |
| - |
28 |
| -// DesposibleRequestParameters are the configurable fields of a DesposibleRequest. |
29 |
| -type DesposibleRequestParameters struct { |
30 |
| - URL string `json:"url"` |
31 |
| - Method string `json:"method"` |
32 |
| - Headers map[string][]string `json:"headers,omitempty"` |
33 |
| - Body string `json:"body,omitempty"` |
34 |
| - WaitTimeout *metav1.Duration `json:"waitTimeout,omitempty"` |
35 |
| - |
36 |
| - // RollbackRetriesLimit is max number of attempts to retry HTTP request by sending again the request. |
37 |
| - RollbackRetriesLimit *int32 `json:"rollbackLimit,omitempty"` |
38 |
| -} |
39 |
| - |
40 |
| -// DesposibleRequestObservation are the observable fields of a DesposibleRequest. |
41 |
| -type DesposibleRequestObservation struct { |
42 |
| - ObservableField string `json:"observableField,omitempty"` |
43 |
| -} |
44 |
| - |
45 |
| -// A DesposibleRequestSpec defines the desired state of a DesposibleRequest. |
46 |
| -type DesposibleRequestSpec struct { |
47 |
| - xpv1.ResourceSpec `json:",inline"` |
48 |
| - |
49 |
| - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'ForProvider' is immutable" |
50 |
| - ForProvider DesposibleRequestParameters `json:"forProvider"` |
51 |
| -} |
52 |
| - |
53 |
| -// DesposibleRequestObservation are the observable fields of a DesposibleRequest. |
54 |
| -type Response struct { |
55 |
| - StatusCode int `json:"statusCode,omitempty"` |
56 |
| - Body string `json:"body,omitempty"` |
57 |
| - Headers map[string][]string `json:"headers,omitempty"` |
58 |
| -} |
59 |
| - |
60 |
| -// A DesposibleRequestStatus represents the observed state of a DesposibleRequest. |
61 |
| -type DesposibleRequestStatus struct { |
62 |
| - xpv1.ResourceStatus `json:",inline"` |
63 |
| - AtProvider DesposibleRequestObservation `json:"atProvider,omitempty"` |
64 |
| - Response Response `json:"response,omitempty"` |
65 |
| - Failed int32 `json:"failed,omitempty"` |
66 |
| - Error string `json:"error,omitempty"` |
67 |
| - Synced bool `json:"synced,omitempty"` |
68 |
| -} |
69 |
| - |
70 |
| -// +kubebuilder:object:root=true |
71 |
| - |
72 |
| -// A DesposibleRequest is an example API type. |
73 |
| -// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" |
74 |
| -// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" |
75 |
| -// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" |
76 |
| -// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" |
77 |
| -// +kubebuilder:subresource:status |
78 |
| -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,http} |
79 |
| -type DesposibleRequest struct { |
80 |
| - metav1.TypeMeta `json:",inline"` |
81 |
| - metav1.ObjectMeta `json:"metadata,omitempty"` |
82 |
| - |
83 |
| - Spec DesposibleRequestSpec `json:"spec"` |
84 |
| - Status DesposibleRequestStatus `json:"status,omitempty"` |
85 |
| -} |
86 |
| - |
87 |
| -// +kubebuilder:object:root=true |
88 |
| - |
89 |
| -// DesposibleRequestList contains a list of DesposibleRequest |
90 |
| -type DesposibleRequestList struct { |
91 |
| - metav1.TypeMeta `json:",inline"` |
92 |
| - metav1.ListMeta `json:"metadata,omitempty"` |
93 |
| - Items []DesposibleRequest `json:"items"` |
94 |
| -} |
95 |
| - |
96 |
| -// DesposibleRequest type metadata. |
97 |
| -var ( |
98 |
| - DesposibleRequestKind = reflect.TypeOf(DesposibleRequest{}).Name() |
99 |
| - DesposibleRequestGroupKind = schema.GroupKind{Group: Group, Kind: DesposibleRequestKind}.String() |
100 |
| - DesposibleRequestKindAPIVersion = DesposibleRequestKind + "." + SchemeGroupVersion.String() |
101 |
| - DesposibleRequestGroupVersionKind = SchemeGroupVersion.WithKind(DesposibleRequestKind) |
102 |
| -) |
103 |
| - |
104 |
| -func init() { |
105 |
| - SchemeBuilder.Register(&DesposibleRequest{}, &DesposibleRequestList{}) |
106 |
| -} |
| 1 | +/* |
| 2 | +Copyright 2022 The Crossplane Authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package v1alpha1 |
| 18 | + |
| 19 | +import ( |
| 20 | + "reflect" |
| 21 | + |
| 22 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 23 | + "k8s.io/apimachinery/pkg/runtime/schema" |
| 24 | + |
| 25 | + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" |
| 26 | +) |
| 27 | + |
| 28 | +// DesposibleRequestParameters are the configurable fields of a DesposibleRequest. |
| 29 | +type DesposibleRequestParameters struct { |
| 30 | + URL string `json:"url"` |
| 31 | + Method string `json:"method"` |
| 32 | + Headers map[string][]string `json:"headers,omitempty"` |
| 33 | + Body string `json:"body,omitempty"` |
| 34 | + WaitTimeout *metav1.Duration `json:"waitTimeout,omitempty"` |
| 35 | + |
| 36 | + // RollbackRetriesLimit is max number of attempts to retry HTTP request by sending again the request. |
| 37 | + RollbackRetriesLimit *int32 `json:"rollbackLimit,omitempty"` |
| 38 | +} |
| 39 | + |
| 40 | +// DesposibleRequestObservation are the observable fields of a DesposibleRequest. |
| 41 | +type DesposibleRequestObservation struct { |
| 42 | + ObservableField string `json:"observableField,omitempty"` |
| 43 | +} |
| 44 | + |
| 45 | +// A DesposibleRequestSpec defines the desired state of a DesposibleRequest. |
| 46 | +type DesposibleRequestSpec struct { |
| 47 | + xpv1.ResourceSpec `json:",inline"` |
| 48 | + |
| 49 | + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'ForProvider' is immutable" |
| 50 | + ForProvider DesposibleRequestParameters `json:"forProvider"` |
| 51 | +} |
| 52 | + |
| 53 | +// DesposibleRequestObservation are the observable fields of a DesposibleRequest. |
| 54 | +type Response struct { |
| 55 | + StatusCode int `json:"statusCode,omitempty"` |
| 56 | + Body string `json:"body,omitempty"` |
| 57 | + Headers map[string][]string `json:"headers,omitempty"` |
| 58 | +} |
| 59 | + |
| 60 | +// A DesposibleRequestStatus represents the observed state of a DesposibleRequest. |
| 61 | +type DesposibleRequestStatus struct { |
| 62 | + xpv1.ResourceStatus `json:",inline"` |
| 63 | + AtProvider DesposibleRequestObservation `json:"atProvider,omitempty"` |
| 64 | + Response Response `json:"response,omitempty"` |
| 65 | + Failed int32 `json:"failed,omitempty"` |
| 66 | + Error string `json:"error,omitempty"` |
| 67 | + Synced bool `json:"synced,omitempty"` |
| 68 | +} |
| 69 | + |
| 70 | +// +kubebuilder:object:root=true |
| 71 | + |
| 72 | +// A DesposibleRequest is an example API type. |
| 73 | +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" |
| 74 | +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" |
| 75 | +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" |
| 76 | +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" |
| 77 | +// +kubebuilder:subresource:status |
| 78 | +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,http} |
| 79 | +type DesposibleRequest struct { |
| 80 | + metav1.TypeMeta `json:",inline"` |
| 81 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 82 | + |
| 83 | + Spec DesposibleRequestSpec `json:"spec"` |
| 84 | + Status DesposibleRequestStatus `json:"status,omitempty"` |
| 85 | +} |
| 86 | + |
| 87 | +// +kubebuilder:object:root=true |
| 88 | + |
| 89 | +// DesposibleRequestList contains a list of DesposibleRequest |
| 90 | +type DesposibleRequestList struct { |
| 91 | + metav1.TypeMeta `json:",inline"` |
| 92 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 93 | + Items []DesposibleRequest `json:"items"` |
| 94 | +} |
| 95 | + |
| 96 | +// DesposibleRequest type metadata. |
| 97 | +var ( |
| 98 | + DesposibleRequestKind = reflect.TypeOf(DesposibleRequest{}).Name() |
| 99 | + DesposibleRequestGroupKind = schema.GroupKind{Group: Group, Kind: DesposibleRequestKind}.String() |
| 100 | + DesposibleRequestKindAPIVersion = DesposibleRequestKind + "." + SchemeGroupVersion.String() |
| 101 | + DesposibleRequestGroupVersionKind = SchemeGroupVersion.WithKind(DesposibleRequestKind) |
| 102 | +) |
| 103 | + |
| 104 | +func init() { |
| 105 | + SchemeBuilder.Register(&DesposibleRequest{}, &DesposibleRequestList{}) |
| 106 | +} |
0 commit comments