sigs.k8s.io/cluster-api-provider-aws@v1.5.5/api/v1beta1/awsmachinetemplate_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  
    22  	clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
    23  )
    24  
    25  // AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate.
    26  type AWSMachineTemplateSpec struct {
    27  	Template AWSMachineTemplateResource `json:"template"`
    28  }
    29  
    30  // +kubebuilder:object:root=true
    31  // +kubebuilder:resource:path=awsmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=awsmt
    32  // +kubebuilder:storageversion
    33  // +k8s:defaulter-gen=true
    34  
    35  // AWSMachineTemplate is the schema for the Amazon EC2 Machine Templates API.
    36  type AWSMachineTemplate struct {
    37  	metav1.TypeMeta   `json:",inline"`
    38  	metav1.ObjectMeta `json:"metadata,omitempty"`
    39  
    40  	Spec AWSMachineTemplateSpec `json:"spec,omitempty"`
    41  }
    42  
    43  // +kubebuilder:object:root=true
    44  
    45  // AWSMachineTemplateList contains a list of AWSMachineTemplate.
    46  type AWSMachineTemplateList struct {
    47  	metav1.TypeMeta `json:",inline"`
    48  	metav1.ListMeta `json:"metadata,omitempty"`
    49  	Items           []AWSMachineTemplate `json:"items"`
    50  }
    51  
    52  // AWSMachineTemplateResource describes the data needed to create am AWSMachine from a template.
    53  type AWSMachineTemplateResource struct {
    54  	// Standard object's metadata.
    55  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    56  	// +optional
    57  	ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
    58  
    59  	// Spec is the specification of the desired behavior of the machine.
    60  	Spec AWSMachineSpec `json:"spec"`
    61  }
    62  
    63  func init() {
    64  	SchemeBuilder.Register(&AWSMachineTemplate{}, &AWSMachineTemplateList{})
    65  }