Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions api/v1alpha1/server_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
Copyright 2021. Netris, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ServerSpec defines the desired state of Server
type ServerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

Tenant string `json:"tenant,omitempty"`
Description string `json:"description,omitempty"`
Site string `json:"site,omitempty"`
Profile string `json:"profile,omitempty"`

// +kubebuilder:validation:Pattern=`^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`
MainIP string `json:"mainIp,omitempty"`

// +kubebuilder:validation:Pattern=`^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`
MgmtIP string `json:"mgmtIp,omitempty"`

UUID string `json:"uuid,omitempty"`
ASN int `json:"asn,omitempty"`
PortCount int `json:"portsCount,omitempty"`
CustomData string `json:"customData,omitempty"`
Tags []string `json:"tags,omitempty"`
SRVRole string `json:"srvRole,omitempty"`
}

// ServerStatus defines the observed state of Server
type ServerStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Tenant",type=string,JSONPath=`.spec.tenant`
// +kubebuilder:printcolumn:name="Site",type=string,JSONPath=`.spec.site`
// +kubebuilder:printcolumn:name="Profile",type=string,JSONPath=`.spec.profile`
// +kubebuilder:printcolumn:name="Main IP",type=string,JSONPath=`.spec.mainIp`
// +kubebuilder:printcolumn:name="Management IP",type=string,JSONPath=`.spec.mgmtIp`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// Server is the Schema for the servers API
type Server struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ServerSpec `json:"spec,omitempty"`
Status ServerStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// ServerList contains a list of Server
type ServerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Server `json:"items"`
}

func init() {
SchemeBuilder.Register(&Server{}, &ServerList{})
}

77 changes: 77 additions & 0 deletions api/v1alpha1/servercluster_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
Copyright 2021. Netris, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ServerClusterSpec defines the desired state of ServerCluster
type ServerClusterSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Admin string `json:"admin"`
Site string `json:"site"`
VPC string `json:"vpc"`
Template string `json:"template"`
Tags []string `json:"tags,omitempty"`
}

// ServerClusterStatus defines the observed state of ServerCluster
type ServerClusterStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
ModifiedDate metav1.Time `json:"modified,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Admin",type=string,JSONPath=`.spec.admin`
// +kubebuilder:printcolumn:name="Site",type=string,JSONPath=`.spec.site`
// +kubebuilder:printcolumn:name="VPC",type=string,JSONPath=`.spec.vpc`
// +kubebuilder:printcolumn:name="Template",type=string,JSONPath=`.spec.template`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="Modified",type=date,JSONPath=`.status.modified`,priority=1
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// ServerCluster is the Schema for the serverclusters API
type ServerCluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ServerClusterSpec `json:"spec"`
Status ServerClusterStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// ServerClusterList contains a list of ServerCluster
type ServerClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ServerCluster `json:"items"`
}

func init() {
SchemeBuilder.Register(&ServerCluster{}, &ServerClusterList{})
}

77 changes: 77 additions & 0 deletions api/v1alpha1/serverclustermeta_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
Copyright 2021. Netris, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ServerClusterMetaSpec defines the desired state of ServerClusterMeta
type ServerClusterMetaSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Imported bool `json:"imported"`
Reclaim bool `json:"reclaimPolicy"`
ServerClusterCRGeneration int64 `json:"serverClusterGeneration"`
ID int `json:"id"`
Name string `json:"name"`
ServerClusterName string `json:"serverClusterName"`
AdminID int `json:"adminId"`
Admin string `json:"admin"`
SiteID int `json:"siteId"`
Site string `json:"site"`
VPCID int `json:"vpcId"`
VPC string `json:"vpc"`
TemplateID int `json:"templateId"`
Template string `json:"template"`
Tags []string `json:"tags"`
}

// ServerClusterMetaStatus defines the observed state of ServerClusterMeta
type ServerClusterMetaStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// ServerClusterMeta is the Schema for the serverclustermeta API
type ServerClusterMeta struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ServerClusterMetaSpec `json:"spec,omitempty"`
Status ServerClusterMetaStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// ServerClusterMetaList contains a list of ServerClusterMeta
type ServerClusterMetaList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ServerClusterMeta `json:"items"`
}

func init() {
SchemeBuilder.Register(&ServerClusterMeta{}, &ServerClusterMetaList{})
}

70 changes: 70 additions & 0 deletions api/v1alpha1/serverclustertemplate_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
Copyright 2021. Netris, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ServerClusterTemplateSpec defines the desired state of ServerClusterTemplate
type ServerClusterTemplateSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Vnets []interface{} `json:"vnets"`
}

// ServerClusterTemplateStatus defines the observed state of ServerClusterTemplate
type ServerClusterTemplateStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
ModifiedDate metav1.Time `json:"modified,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Name",type=string,JSONPath=`.metadata.name`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="Modified",type=date,JSONPath=`.status.modified`,priority=1
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// ServerClusterTemplate is the Schema for the serverclustertemplates API
type ServerClusterTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ServerClusterTemplateSpec `json:"spec"`
Status ServerClusterTemplateStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// ServerClusterTemplateList contains a list of ServerClusterTemplate
type ServerClusterTemplateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ServerClusterTemplate `json:"items"`
}

func init() {
SchemeBuilder.Register(&ServerClusterTemplate{}, &ServerClusterTemplateList{})
}

69 changes: 69 additions & 0 deletions api/v1alpha1/serverclustertemplatemeta_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
Copyright 2021. Netris, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ServerClusterTemplateMetaSpec defines the desired state of ServerClusterTemplateMeta
type ServerClusterTemplateMetaSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Imported bool `json:"imported"`
Reclaim bool `json:"reclaimPolicy"`
ServerClusterTemplateCRGeneration int64 `json:"serverClusterTemplateGeneration"`
ID int `json:"id"`
Name string `json:"name"`
ServerClusterTemplateName string `json:"serverClusterTemplateName"`
Vnets []interface{} `json:"vnets"`
}

// ServerClusterTemplateMetaStatus defines the observed state of ServerClusterTemplateMeta
type ServerClusterTemplateMetaStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// ServerClusterTemplateMeta is the Schema for the serverclustertemplatemeta API
type ServerClusterTemplateMeta struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ServerClusterTemplateMetaSpec `json:"spec,omitempty"`
Status ServerClusterTemplateMetaStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// ServerClusterTemplateMetaList contains a list of ServerClusterTemplateMeta
type ServerClusterTemplateMetaList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ServerClusterTemplateMeta `json:"items"`
}

func init() {
SchemeBuilder.Register(&ServerClusterTemplateMeta{}, &ServerClusterTemplateMetaList{})
}

Loading