sigs.k8s.io/cluster-api-provider-azure@v1.14.3/api/v1beta1/azuremachinetemplate_types.go (about)

     1  /*
     2  Copyright 2021 The Kubernetes 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 v1beta1
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  	clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
    22  )
    23  
    24  // AzureMachineTemplateSpec defines the desired state of AzureMachineTemplate.
    25  type AzureMachineTemplateSpec struct {
    26  	Template AzureMachineTemplateResource `json:"template"`
    27  }
    28  
    29  // +kubebuilder:object:root=true
    30  // +kubebuilder:resource:path=azuremachinetemplates,scope=Namespaced,categories=cluster-api
    31  // +kubebuilder:storageversion
    32  
    33  // AzureMachineTemplate is the Schema for the azuremachinetemplates API.
    34  type AzureMachineTemplate struct {
    35  	metav1.TypeMeta   `json:",inline"`
    36  	metav1.ObjectMeta `json:"metadata,omitempty"`
    37  
    38  	Spec AzureMachineTemplateSpec `json:"spec,omitempty"`
    39  }
    40  
    41  // +kubebuilder:object:root=true
    42  
    43  // AzureMachineTemplateList contains a list of AzureMachineTemplates.
    44  type AzureMachineTemplateList struct {
    45  	metav1.TypeMeta `json:",inline"`
    46  	metav1.ListMeta `json:"metadata,omitempty"`
    47  	Items           []AzureMachineTemplate `json:"items"`
    48  }
    49  
    50  func init() {
    51  	SchemeBuilder.Register(&AzureMachineTemplate{}, &AzureMachineTemplateList{})
    52  }
    53  
    54  // AzureMachineTemplateResource describes the data needed to create an AzureMachine from a template.
    55  type AzureMachineTemplateResource struct {
    56  	// +optional
    57  	ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
    58  	// Spec is the specification of the desired behavior of the machine.
    59  	Spec AzureMachineSpec `json:"spec"`
    60  }