|
| 1 | +/* |
| 2 | +Copyright 2019 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 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | + |
| 22 | + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" |
| 23 | +) |
| 24 | + |
| 25 | +// ApplicationParameters parameters for an application. |
| 26 | +type ApplicationParameters struct { |
| 27 | + // AvailableToOtherTenants - Whether the application is available to other tenants. |
| 28 | + // +optional |
| 29 | + // +immutable |
| 30 | + AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` |
| 31 | + |
| 32 | + // DisplayName - The display name of the application. |
| 33 | + // +optional |
| 34 | + // +immutable |
| 35 | + DisplayName *string `json:"displayName,omitempty"` |
| 36 | + |
| 37 | + // Homepage - The home page of the application. |
| 38 | + // +optional |
| 39 | + // +immutable |
| 40 | + Homepage *string `json:"homepage,omitempty"` |
| 41 | + |
| 42 | + // IdentifierUris - A collection of URIs for the application. |
| 43 | + // +optional |
| 44 | + // +immutable |
| 45 | + IdentifierURIs []string `json:"identifierUris,omitempty"` |
| 46 | +} |
| 47 | + |
| 48 | +// An ApplicationSpec defines the desired state of an Application. |
| 49 | +type ApplicationSpec struct { |
| 50 | + xpv1.ResourceSpec `json:",inline"` |
| 51 | + ForProvider ApplicationParameters `json:"forProvider"` |
| 52 | +} |
| 53 | + |
| 54 | +// An ApplicationStatus represents the observed state of an Application. |
| 55 | +type ApplicationStatus struct { |
| 56 | + xpv1.ResourceStatus `json:",inline"` |
| 57 | + |
| 58 | + // ApplicationID - The application ID. |
| 59 | + ApplicationID string `json:"applicationID,omitempty"` |
| 60 | +} |
| 61 | + |
| 62 | +// +kubebuilder:object:root=true |
| 63 | + |
| 64 | +// A Application is a managed resource that represents an Application. |
| 65 | +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" |
| 66 | +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" |
| 67 | +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" |
| 68 | +// +kubebuilder:subresource:status |
| 69 | +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,azure} |
| 70 | +type Application struct { |
| 71 | + metav1.TypeMeta `json:",inline"` |
| 72 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 73 | + |
| 74 | + Spec ApplicationSpec `json:"spec"` |
| 75 | + Status ApplicationStatus `json:"status,omitempty"` |
| 76 | +} |
| 77 | + |
| 78 | +// +kubebuilder:object:root=true |
| 79 | + |
| 80 | +// ApplicationList contains a list of Application items |
| 81 | +type ApplicationList struct { |
| 82 | + metav1.TypeMeta `json:",inline"` |
| 83 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 84 | + Items []Application `json:"items"` |
| 85 | +} |
| 86 | + |
| 87 | +// An ServicePrincipalParameters defines the desired state of an ServicePrincipal. |
| 88 | +type ServicePrincipalParameters struct { |
| 89 | + // ApplicationID - The application ID. |
| 90 | + // +optional |
| 91 | + ApplicationID string `json:"applicationID,omitempty"` |
| 92 | + |
| 93 | + // ApplicationIDRef - A reference to the Application id. |
| 94 | + // +optional |
| 95 | + // +immutable |
| 96 | + ApplicationIDRef *xpv1.Reference `json:"applicationIDRef,omitempty"` |
| 97 | + |
| 98 | + // ApplicationIDSelector - Select a reference to the Application id. |
| 99 | + // +immutable |
| 100 | + ApplicationIDSelector *xpv1.Selector `json:"applicationIDSelector,omitempty"` |
| 101 | + |
| 102 | + // AccountEnabled - whether or not the service principal account is enabled |
| 103 | + // +optional |
| 104 | + // +immutable |
| 105 | + AccountEnabled *bool `json:"accountEnabled,omitempty"` |
| 106 | +} |
| 107 | + |
| 108 | +// An ServicePrincipalSpec defines the desired state of an ServicePrincipal. |
| 109 | +type ServicePrincipalSpec struct { |
| 110 | + xpv1.ResourceSpec `json:",inline"` |
| 111 | + ForProvider ServicePrincipalParameters `json:"forProvider"` |
| 112 | +} |
| 113 | + |
| 114 | +// An ServicePrincipalStatus represents the observed state of an ServicePrincipal. |
| 115 | +type ServicePrincipalStatus struct { |
| 116 | + xpv1.ResourceStatus `json:",inline"` |
| 117 | +} |
| 118 | + |
| 119 | +// +kubebuilder:object:root=true |
| 120 | + |
| 121 | +// A ServicePrincipal is a managed resource that represents an ServicePrincipal. |
| 122 | +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" |
| 123 | +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" |
| 124 | +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" |
| 125 | +// +kubebuilder:subresource:status |
| 126 | +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,azure} |
| 127 | +type ServicePrincipal struct { |
| 128 | + metav1.TypeMeta `json:",inline"` |
| 129 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 130 | + |
| 131 | + Spec ServicePrincipalSpec `json:"spec"` |
| 132 | + Status ServicePrincipalStatus `json:"status,omitempty"` |
| 133 | +} |
| 134 | + |
| 135 | +// An RoleAssignmentParameters defines the desired state of an RoleAssignment. |
| 136 | +type RoleAssignmentParameters struct { |
| 137 | + // PrincipalID - The principal ID assigned to the role. |
| 138 | + // This maps to the ID inside the Active Directory. |
| 139 | + // It can point to a user, service principal, or security group. |
| 140 | + // +optional |
| 141 | + PrincipalID string `json:"principalID,omitempty"` |
| 142 | + |
| 143 | + // PrincipalIDRef - A reference to the Principal id. |
| 144 | + // +optional |
| 145 | + // +immutable |
| 146 | + PrincipalIDRef *xpv1.Reference `json:"principalIDRef,omitempty"` |
| 147 | + |
| 148 | + // PrincipalIDRef - Select a reference to the Principal id. |
| 149 | + // +immutable |
| 150 | + PrincipalIDSelector *xpv1.Selector `json:"principalIDSelector,omitempty"` |
| 151 | + |
| 152 | + // RoleID - The role definition ID. |
| 153 | + // +immutable |
| 154 | + // +kubebuilder:validation:Required |
| 155 | + RoleID string `json:"roleID"` |
| 156 | + |
| 157 | + // Scope - The role assignment scope. |
| 158 | + // +immutable |
| 159 | + // +kubebuilder:validation:Required |
| 160 | + Scope string `json:"scope"` |
| 161 | +} |
| 162 | + |
| 163 | +// +kubebuilder:object:root=true |
| 164 | + |
| 165 | +// ServicePrincipalList contains a list of ServicePrincipal items |
| 166 | +type ServicePrincipalList struct { |
| 167 | + metav1.TypeMeta `json:",inline"` |
| 168 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 169 | + Items []ServicePrincipal `json:"items"` |
| 170 | +} |
| 171 | + |
| 172 | +// An RoleAssignmentSpec defines the desired state of an RoleAssignment. |
| 173 | +type RoleAssignmentSpec struct { |
| 174 | + xpv1.ResourceSpec `json:",inline"` |
| 175 | + ForProvider RoleAssignmentParameters `json:"forProvider"` |
| 176 | +} |
| 177 | + |
| 178 | +// An RoleAssignmentStatus represents the observed state of an RoleAssignment. |
| 179 | +type RoleAssignmentStatus struct { |
| 180 | + xpv1.ResourceStatus `json:",inline"` |
| 181 | +} |
| 182 | + |
| 183 | +// +kubebuilder:object:root=true |
| 184 | + |
| 185 | +// A RoleAssignment is a managed resource that represents an RoleAssignment. |
| 186 | +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" |
| 187 | +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" |
| 188 | +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" |
| 189 | +// +kubebuilder:subresource:status |
| 190 | +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,azure} |
| 191 | +type RoleAssignment struct { |
| 192 | + metav1.TypeMeta `json:",inline"` |
| 193 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 194 | + |
| 195 | + Spec RoleAssignmentSpec `json:"spec"` |
| 196 | + Status RoleAssignmentStatus `json:"status,omitempty"` |
| 197 | +} |
| 198 | + |
| 199 | +// +kubebuilder:object:root=true |
| 200 | + |
| 201 | +// RoleAssignmentList contains a list of RoleAssignment items |
| 202 | +type RoleAssignmentList struct { |
| 203 | + metav1.TypeMeta `json:",inline"` |
| 204 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 205 | + Items []RoleAssignment `json:"items"` |
| 206 | +} |
0 commit comments