diff --git a/apis/sms/v1beta1/zz_generated.deepcopy.go b/apis/sms/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 00000000..53833d19 --- /dev/null +++ b/apis/sms/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,606 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PhysicalVolumesObservation) DeepCopyInto(out *PhysicalVolumesObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PhysicalVolumesObservation. +func (in *PhysicalVolumesObservation) DeepCopy() *PhysicalVolumesObservation { + if in == nil { + return nil + } + out := new(PhysicalVolumesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PhysicalVolumesParameters) DeepCopyInto(out *PhysicalVolumesParameters) { + *out = *in + if in.DeviceType != nil { + in, out := &in.DeviceType, &out.DeviceType + *out = new(string) + **out = **in + } + if in.FileSystem != nil { + in, out := &in.FileSystem, &out.FileSystem + *out = new(string) + **out = **in + } + if in.Index != nil { + in, out := &in.Index, &out.Index + *out = new(float64) + **out = **in + } + if in.MountPoint != nil { + in, out := &in.MountPoint, &out.MountPoint + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.UUID != nil { + in, out := &in.UUID, &out.UUID + *out = new(string) + **out = **in + } + if in.UsedSize != nil { + in, out := &in.UsedSize, &out.UsedSize + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PhysicalVolumesParameters. +func (in *PhysicalVolumesParameters) DeepCopy() *PhysicalVolumesParameters { + if in == nil { + return nil + } + out := new(PhysicalVolumesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerTemplate) DeepCopyInto(out *ServerTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerTemplate. +func (in *ServerTemplate) DeepCopy() *ServerTemplate { + if in == nil { + return nil + } + out := new(ServerTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServerTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerTemplateList) DeepCopyInto(out *ServerTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServerTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerTemplateList. +func (in *ServerTemplateList) DeepCopy() *ServerTemplateList { + if in == nil { + return nil + } + out := new(ServerTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServerTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerTemplateObservation) DeepCopyInto(out *ServerTemplateObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.VPCName != nil { + in, out := &in.VPCName, &out.VPCName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerTemplateObservation. +func (in *ServerTemplateObservation) DeepCopy() *ServerTemplateObservation { + if in == nil { + return nil + } + out := new(ServerTemplateObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerTemplateParameters) DeepCopyInto(out *ServerTemplateParameters) { + *out = *in + if in.AvailabilityZone != nil { + in, out := &in.AvailabilityZone, &out.AvailabilityZone + *out = new(string) + **out = **in + } + if in.BandwidthSize != nil { + in, out := &in.BandwidthSize, &out.BandwidthSize + *out = new(float64) + **out = **in + } + if in.Flavor != nil { + in, out := &in.Flavor, &out.Flavor + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.ProjectID != nil { + in, out := &in.ProjectID, &out.ProjectID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SecurityGroupIDRefs != nil { + in, out := &in.SecurityGroupIDRefs, &out.SecurityGroupIDRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityGroupIDSelector != nil { + in, out := &in.SecurityGroupIDSelector, &out.SecurityGroupIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.SecurityGroupIds != nil { + in, out := &in.SecurityGroupIds, &out.SecurityGroupIds + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.SubnetIDRefs != nil { + in, out := &in.SubnetIDRefs, &out.SubnetIDRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.SubnetIds != nil { + in, out := &in.SubnetIds, &out.SubnetIds + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.TargetServerName != nil { + in, out := &in.TargetServerName, &out.TargetServerName + *out = new(string) + **out = **in + } + if in.VPCID != nil { + in, out := &in.VPCID, &out.VPCID + *out = new(string) + **out = **in + } + if in.VPCIDRef != nil { + in, out := &in.VPCIDRef, &out.VPCIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.VPCIDSelector != nil { + in, out := &in.VPCIDSelector, &out.VPCIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeType != nil { + in, out := &in.VolumeType, &out.VolumeType + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerTemplateParameters. +func (in *ServerTemplateParameters) DeepCopy() *ServerTemplateParameters { + if in == nil { + return nil + } + out := new(ServerTemplateParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerTemplateSpec) DeepCopyInto(out *ServerTemplateSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerTemplateSpec. +func (in *ServerTemplateSpec) DeepCopy() *ServerTemplateSpec { + if in == nil { + return nil + } + out := new(ServerTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerTemplateStatus) DeepCopyInto(out *ServerTemplateStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerTemplateStatus. +func (in *ServerTemplateStatus) DeepCopy() *ServerTemplateStatus { + if in == nil { + return nil + } + out := new(ServerTemplateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetServerDisksObservation) DeepCopyInto(out *TargetServerDisksObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetServerDisksObservation. +func (in *TargetServerDisksObservation) DeepCopy() *TargetServerDisksObservation { + if in == nil { + return nil + } + out := new(TargetServerDisksObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetServerDisksParameters) DeepCopyInto(out *TargetServerDisksParameters) { + *out = *in + if in.DeviceType != nil { + in, out := &in.DeviceType, &out.DeviceType + *out = new(string) + **out = **in + } + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PhysicalVolumes != nil { + in, out := &in.PhysicalVolumes, &out.PhysicalVolumes + *out = make([]PhysicalVolumesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.UsedSize != nil { + in, out := &in.UsedSize, &out.UsedSize + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetServerDisksParameters. +func (in *TargetServerDisksParameters) DeepCopy() *TargetServerDisksParameters { + if in == nil { + return nil + } + out := new(TargetServerDisksParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Task) DeepCopyInto(out *Task) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Task. +func (in *Task) DeepCopy() *Task { + if in == nil { + return nil + } + out := new(Task) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Task) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TaskList) DeepCopyInto(out *TaskList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Task, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskList. +func (in *TaskList) DeepCopy() *TaskList { + if in == nil { + return nil + } + out := new(TaskList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TaskList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TaskObservation) DeepCopyInto(out *TaskObservation) { + *out = *in + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.MigrateSpeed != nil { + in, out := &in.MigrateSpeed, &out.MigrateSpeed + *out = new(float64) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.TargetServerName != nil { + in, out := &in.TargetServerName, &out.TargetServerName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskObservation. +func (in *TaskObservation) DeepCopy() *TaskObservation { + if in == nil { + return nil + } + out := new(TaskObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TaskParameters) DeepCopyInto(out *TaskParameters) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(string) + **out = **in + } + if in.MigrationIP != nil { + in, out := &in.MigrationIP, &out.MigrationIP + *out = new(string) + **out = **in + } + if in.OsType != nil { + in, out := &in.OsType, &out.OsType + *out = new(string) + **out = **in + } + if in.ProjectID != nil { + in, out := &in.ProjectID, &out.ProjectID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SourceServerID != nil { + in, out := &in.SourceServerID, &out.SourceServerID + *out = new(string) + **out = **in + } + if in.StartTargetServer != nil { + in, out := &in.StartTargetServer, &out.StartTargetServer + *out = new(bool) + **out = **in + } + if in.Syncing != nil { + in, out := &in.Syncing, &out.Syncing + *out = new(bool) + **out = **in + } + if in.TargetServerDisks != nil { + in, out := &in.TargetServerDisks, &out.TargetServerDisks + *out = make([]TargetServerDisksParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TargetServerID != nil { + in, out := &in.TargetServerID, &out.TargetServerID + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UsePublicIP != nil { + in, out := &in.UsePublicIP, &out.UsePublicIP + *out = new(bool) + **out = **in + } + if in.VMTemplateID != nil { + in, out := &in.VMTemplateID, &out.VMTemplateID + *out = new(string) + **out = **in + } + if in.VMTemplateIDRef != nil { + in, out := &in.VMTemplateIDRef, &out.VMTemplateIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.VMTemplateIDSelector != nil { + in, out := &in.VMTemplateIDSelector, &out.VMTemplateIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskParameters. +func (in *TaskParameters) DeepCopy() *TaskParameters { + if in == nil { + return nil + } + out := new(TaskParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TaskSpec) DeepCopyInto(out *TaskSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskSpec. +func (in *TaskSpec) DeepCopy() *TaskSpec { + if in == nil { + return nil + } + out := new(TaskSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TaskStatus) DeepCopyInto(out *TaskStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskStatus. +func (in *TaskStatus) DeepCopy() *TaskStatus { + if in == nil { + return nil + } + out := new(TaskStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/sms/v1beta1/zz_generated.managed.go b/apis/sms/v1beta1/zz_generated.managed.go new file mode 100644 index 00000000..b439d8b0 --- /dev/null +++ b/apis/sms/v1beta1/zz_generated.managed.go @@ -0,0 +1,140 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1beta1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this ServerTemplate. +func (mg *ServerTemplate) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this ServerTemplate. +func (mg *ServerTemplate) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetProviderConfigReference of this ServerTemplate. +func (mg *ServerTemplate) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this ServerTemplate. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *ServerTemplate) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this ServerTemplate. +func (mg *ServerTemplate) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this ServerTemplate. +func (mg *ServerTemplate) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this ServerTemplate. +func (mg *ServerTemplate) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this ServerTemplate. +func (mg *ServerTemplate) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetProviderConfigReference of this ServerTemplate. +func (mg *ServerTemplate) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this ServerTemplate. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *ServerTemplate) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this ServerTemplate. +func (mg *ServerTemplate) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this ServerTemplate. +func (mg *ServerTemplate) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this Task. +func (mg *Task) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Task. +func (mg *Task) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetProviderConfigReference of this Task. +func (mg *Task) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Task. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Task) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Task. +func (mg *Task) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Task. +func (mg *Task) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Task. +func (mg *Task) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Task. +func (mg *Task) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetProviderConfigReference of this Task. +func (mg *Task) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Task. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Task) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Task. +func (mg *Task) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Task. +func (mg *Task) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/sms/v1beta1/zz_generated.managedlist.go b/apis/sms/v1beta1/zz_generated.managedlist.go new file mode 100644 index 00000000..5791b0b7 --- /dev/null +++ b/apis/sms/v1beta1/zz_generated.managedlist.go @@ -0,0 +1,26 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1beta1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this ServerTemplateList. +func (l *ServerTemplateList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this TaskList. +func (l *TaskList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/sms/v1beta1/zz_generated.resolvers.go b/apis/sms/v1beta1/zz_generated.resolvers.go new file mode 100644 index 00000000..848f473e --- /dev/null +++ b/apis/sms/v1beta1/zz_generated.resolvers.go @@ -0,0 +1,100 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + v1beta1 "github.com/FrangipaneTeam/provider-flexibleengine/apis/vpc/v1beta1" + tools "github.com/FrangipaneTeam/provider-flexibleengine/pkg/tools" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this ServerTemplate. +func (mg *ServerTemplate) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse + var err error + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.SecurityGroupIds), + Extract: reference.ExternalName(), + References: mg.Spec.ForProvider.SecurityGroupIDRefs, + Selector: mg.Spec.ForProvider.SecurityGroupIDSelector, + To: reference.To{ + List: &v1beta1.SecurityGroupList{}, + Managed: &v1beta1.SecurityGroup{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SecurityGroupIds") + } + mg.Spec.ForProvider.SecurityGroupIds = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.SecurityGroupIDRefs = mrsp.ResolvedReferences + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.SubnetIds), + Extract: tools.ExtractorParamPathfunc(true, "id"), + References: mg.Spec.ForProvider.SubnetIDRefs, + Selector: mg.Spec.ForProvider.SubnetIDSelector, + To: reference.To{ + List: &v1beta1.VPCSubnetList{}, + Managed: &v1beta1.VPCSubnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetIds") + } + mg.Spec.ForProvider.SubnetIds = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.SubnetIDRefs = mrsp.ResolvedReferences + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.VPCIDRef, + Selector: mg.Spec.ForProvider.VPCIDSelector, + To: reference.To{ + List: &v1beta1.VPCList{}, + Managed: &v1beta1.VPC{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.VPCID") + } + mg.Spec.ForProvider.VPCID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this Task. +func (mg *Task) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VMTemplateID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.VMTemplateIDRef, + Selector: mg.Spec.ForProvider.VMTemplateIDSelector, + To: reference.To{ + List: &ServerTemplateList{}, + Managed: &ServerTemplate{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.VMTemplateID") + } + mg.Spec.ForProvider.VMTemplateID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VMTemplateIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/sms/v1beta1/zz_generated_terraformed.go b/apis/sms/v1beta1/zz_generated_terraformed.go new file mode 100755 index 00000000..ff182f98 --- /dev/null +++ b/apis/sms/v1beta1/zz_generated_terraformed.go @@ -0,0 +1,162 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "github.com/pkg/errors" + + "github.com/upbound/upjet/pkg/resource" + "github.com/upbound/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this ServerTemplate +func (mg *ServerTemplate) GetTerraformResourceType() string { + return "flexibleengine_sms_server_template" +} + +// GetConnectionDetailsMapping for this ServerTemplate +func (tr *ServerTemplate) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this ServerTemplate +func (tr *ServerTemplate) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this ServerTemplate +func (tr *ServerTemplate) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this ServerTemplate +func (tr *ServerTemplate) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this ServerTemplate +func (tr *ServerTemplate) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this ServerTemplate +func (tr *ServerTemplate) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this ServerTemplate using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *ServerTemplate) LateInitialize(attrs []byte) (bool, error) { + params := &ServerTemplateParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *ServerTemplate) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this Task +func (mg *Task) GetTerraformResourceType() string { + return "flexibleengine_sms_task" +} + +// GetConnectionDetailsMapping for this Task +func (tr *Task) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Task +func (tr *Task) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Task +func (tr *Task) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Task +func (tr *Task) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Task +func (tr *Task) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Task +func (tr *Task) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Task using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Task) LateInitialize(attrs []byte) (bool, error) { + params := &TaskParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Task) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/sms/v1beta1/zz_groupversion_info.go b/apis/sms/v1beta1/zz_groupversion_info.go new file mode 100755 index 00000000..e9b4c5c9 --- /dev/null +++ b/apis/sms/v1beta1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=sms.flexibleengine.upbound.io +// +versionName=v1beta1 +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "sms.flexibleengine.upbound.io" + CRDVersion = "v1beta1" +) + +var ( + // CRDGroupVersion is the API Group Version used to register the objects + CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/sms/v1beta1/zz_servertemplate_types.go b/apis/sms/v1beta1/zz_servertemplate_types.go new file mode 100755 index 00000000..e4a83d54 --- /dev/null +++ b/apis/sms/v1beta1/zz_servertemplate_types.go @@ -0,0 +1,158 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ServerTemplateObservation struct { + + // The resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The name of the VPC which the target server belongs to. + VPCName *string `json:"vpcName,omitempty" tf:"vpc_name,omitempty"` +} + +type ServerTemplateParameters struct { + + // Specifies the availability zone where the target server is located. + // +kubebuilder:validation:Required + AvailabilityZone *string `json:"availabilityZone" tf:"availability_zone,omitempty"` + + // Specifies the bandwidth size in Mbit/s about the public IP address + // that will be used for migration. + // +kubebuilder:validation:Optional + BandwidthSize *float64 `json:"bandwidthSize,omitempty" tf:"bandwidth_size,omitempty"` + + // Specifies the flavor ID for the target server. + // +kubebuilder:validation:Optional + Flavor *string `json:"flavor,omitempty" tf:"flavor,omitempty"` + + // Specifies the server template name. + // +kubebuilder:validation:Required + Name *string `json:"name" tf:"name,omitempty"` + + // Specifies the project ID where the target server is located. + // If omitted, the default project in the region will be used. + // +kubebuilder:validation:Optional + ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"` + + // Specifies the region where the target server is located. + // If omitted, the provider-level region will be used. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // References to SecurityGroup in vpc to populate securityGroupIds. + // +kubebuilder:validation:Optional + SecurityGroupIDRefs []v1.Reference `json:"securityGroupIdRefs,omitempty" tf:"-"` + + // Selector for a list of SecurityGroup in vpc to populate securityGroupIds. + // +kubebuilder:validation:Optional + SecurityGroupIDSelector *v1.Selector `json:"securityGroupIdSelector,omitempty" tf:"-"` + + // Specifies an array of one or more security group IDs to associate with + // the target server. If omitted or set to ["autoCreate"], a new security group will be created automatically during migration. + // +crossplane:generate:reference:type=github.com/FrangipaneTeam/provider-flexibleengine/apis/vpc/v1beta1.SecurityGroup + // +crossplane:generate:reference:refFieldName=SecurityGroupIDRefs + // +crossplane:generate:reference:selectorFieldName=SecurityGroupIDSelector + // +kubebuilder:validation:Optional + SecurityGroupIds []*string `json:"securityGroupIds,omitempty" tf:"security_group_ids,omitempty"` + + // References to VPCSubnet in vpc to populate subnetIds. + // +kubebuilder:validation:Optional + SubnetIDRefs []v1.Reference `json:"subnetIdRefs,omitempty" tf:"-"` + + // Selector for a list of VPCSubnet in vpc to populate subnetIds. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies an array of one or more VPC subnet IDs to attach to the target server. + // If omitted or set to ["autoCreate"], a new subnet will be created automatically during migration. + // +crossplane:generate:reference:type=github.com/FrangipaneTeam/provider-flexibleengine/apis/vpc/v1beta1.VPCSubnet + // +crossplane:generate:reference:extractor=github.com/FrangipaneTeam/provider-flexibleengine/pkg/tools.ExtractorParamPathfunc(true, "id") + // +crossplane:generate:reference:refFieldName=SubnetIDRefs + // +crossplane:generate:reference:selectorFieldName=SubnetIDSelector + // +kubebuilder:validation:Optional + SubnetIds []*string `json:"subnetIds,omitempty" tf:"subnet_ids,omitempty"` + + // Specifies the name of the target server. Defaults to the template name. + // +kubebuilder:validation:Optional + TargetServerName *string `json:"targetServerName,omitempty" tf:"target_server_name,omitempty"` + + // Specifies the ID of the VPC which the target server belongs to. + // If omitted or set to "autoCreate", a new VPC will be created automatically during migration. + // +crossplane:generate:reference:type=github.com/FrangipaneTeam/provider-flexibleengine/apis/vpc/v1beta1.VPC + // +kubebuilder:validation:Optional + VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` + + // Reference to a VPC in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDRef *v1.Reference `json:"vpcIdRef,omitempty" tf:"-"` + + // Selector for a VPC in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDSelector *v1.Selector `json:"vpcIdSelector,omitempty" tf:"-"` + + // Specifies the disk type of the target server. Available values are: SAS, SSD, + // GPSSD and ESSD, defaults to SAS. + // +kubebuilder:validation:Optional + VolumeType *string `json:"volumeType,omitempty" tf:"volume_type,omitempty"` +} + +// ServerTemplateSpec defines the desired state of ServerTemplate +type ServerTemplateSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ServerTemplateParameters `json:"forProvider"` +} + +// ServerTemplateStatus defines the observed state of ServerTemplate. +type ServerTemplateStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ServerTemplateObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// ServerTemplate is the Schema for the ServerTemplates API. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,flexibleengine} +type ServerTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec ServerTemplateSpec `json:"spec"` + Status ServerTemplateStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ServerTemplateList contains a list of ServerTemplates +type ServerTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServerTemplate `json:"items"` +} + +// Repository type metadata. +var ( + ServerTemplate_Kind = "ServerTemplate" + ServerTemplate_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ServerTemplate_Kind}.String() + ServerTemplate_KindAPIVersion = ServerTemplate_Kind + "." + CRDGroupVersion.String() + ServerTemplate_GroupVersionKind = CRDGroupVersion.WithKind(ServerTemplate_Kind) +) + +func init() { + SchemeBuilder.Register(&ServerTemplate{}, &ServerTemplateList{}) +} diff --git a/apis/sms/v1beta1/zz_task_types.go b/apis/sms/v1beta1/zz_task_types.go new file mode 100755 index 00000000..f7895066 --- /dev/null +++ b/apis/sms/v1beta1/zz_task_types.go @@ -0,0 +1,240 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type PhysicalVolumesObservation struct { +} + +type PhysicalVolumesParameters struct { + + // Specifies the disk type. The value can be NORMAL and BOOT. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + DeviceType *string `json:"deviceType" tf:"device_type,omitempty"` + + // Specifies the file system type, e.g. "ext4". + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + FileSystem *string `json:"fileSystem" tf:"file_system,omitempty"` + + // Specifies the serial number of the volume. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + Index *float64 `json:"index" tf:"index,omitempty"` + + // Specifies the mount point, e.g. "/". + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + MountPoint *string `json:"mountPoint" tf:"mount_point,omitempty"` + + // Specifies the disk name, e.g. "/dev/sda". + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + Name *string `json:"name" tf:"name,omitempty"` + + // Specifies the volume size in MB. Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + Size *float64 `json:"size" tf:"size,omitempty"` + + // Specifies the GUID of the volume. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + UUID *string `json:"uuid,omitempty" tf:"uuid,omitempty"` + + // Specifies the used space in MB. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + UsedSize *float64 `json:"usedSize,omitempty" tf:"used_size,omitempty"` +} + +type TargetServerDisksObservation struct { +} + +type TargetServerDisksParameters struct { + + // Specifies the disk type. The value can be NORMAL and BOOT. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + DeviceType *string `json:"deviceType" tf:"device_type,omitempty"` + + // Specifies the disk index, e.g. "0". + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + DiskID *string `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Specifies the disk name, e.g. "/dev/sda". + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + Name *string `json:"name" tf:"name,omitempty"` + + // Specifies an array of physical volume informations. + // The object is documented below. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + PhysicalVolumes []PhysicalVolumesParameters `json:"physicalVolumes,omitempty" tf:"physical_volumes,omitempty"` + + // Specifies the volume size in MB. Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + Size *float64 `json:"size" tf:"size,omitempty"` + + // Specifies the used space in MB. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + UsedSize *float64 `json:"usedSize,omitempty" tf:"used_size,omitempty"` +} + +type TaskObservation struct { + + // The enterprise project id of the target server. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // The resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The migration rate, in MB/s. + MigrateSpeed *float64 `json:"migrateSpeed,omitempty" tf:"migrate_speed,omitempty"` + + // The status of the migration task. + State *string `json:"state,omitempty" tf:"state,omitempty"` + + // The name of the target server. + TargetServerName *string `json:"targetServerName,omitempty" tf:"target_server_name,omitempty"` +} + +type TaskParameters struct { + + // Specifies the operation after the task is created. + // The value can be start, stop and restart. + // +kubebuilder:validation:Optional + Action *string `json:"action,omitempty" tf:"action,omitempty"` + + // Specifies the IP address of the target server. + // Use the EIP of the target server if the migration network type is Internet. + // Use the private IP address of the target server if the migration network type is Direct Connect or VPN. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + MigrationIP *string `json:"migrationIp,omitempty" tf:"migration_ip,omitempty"` + + // Specifies the OS type of the source server. The value can be WINDOWS and LINUX. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + OsType *string `json:"osType" tf:"os_type,omitempty"` + + // Specifies the project ID where the target server is located. + // If omitted, the default project in the region will be used. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"` + + // Specifies the region where the target server is located. + // If omitted, the provider-level region will be used. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the ID of the source server. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + SourceServerID *string `json:"sourceServerId" tf:"source_server_id,omitempty"` + + // Specifies whether to start the target server after the migration. + // The default value is true. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + StartTargetServer *bool `json:"startTargetServer,omitempty" tf:"start_target_server,omitempty"` + + // - Specifies whether to perform a continuous synchronization after the first replication. + // The default value is false. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Syncing *bool `json:"syncing,omitempty" tf:"syncing,omitempty"` + + // Specifies the disk configurations of the target server. + // If omitted, it will be obtained from the source server. The object + // is documented below. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + TargetServerDisks []TargetServerDisksParameters `json:"targetServerDisks,omitempty" tf:"target_server_disks,omitempty"` + + // Specifies the existing server ID as the target server. + // This parameter and vm_template_id are alternative. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + TargetServerID *string `json:"targetServerId,omitempty" tf:"target_server_id,omitempty"` + + // Specifies the type of the migration task. Available values are + // MIGRATE_FILE(file-level migration) and MIGRATE_BLOCK(block-level migration). + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Required + Type *string `json:"type" tf:"type,omitempty"` + + // Specifies whether to use a public IP address for migration. + // The default value is true. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + UsePublicIP *bool `json:"usePublicIp,omitempty" tf:"use_public_ip,omitempty"` + + // Specifies the template used to create the target server automatically. + // This parameter and target_server_id are alternative. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=ServerTemplate + // +kubebuilder:validation:Optional + VMTemplateID *string `json:"vmTemplateId,omitempty" tf:"vm_template_id,omitempty"` + + // Reference to a ServerTemplate to populate vmTemplateId. + // +kubebuilder:validation:Optional + VMTemplateIDRef *v1.Reference `json:"vmTemplateIdRef,omitempty" tf:"-"` + + // Selector for a ServerTemplate to populate vmTemplateId. + // +kubebuilder:validation:Optional + VMTemplateIDSelector *v1.Selector `json:"vmTemplateIdSelector,omitempty" tf:"-"` +} + +// TaskSpec defines the desired state of Task +type TaskSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider TaskParameters `json:"forProvider"` +} + +// TaskStatus defines the observed state of Task. +type TaskStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider TaskObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Task is the Schema for the Tasks API. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,flexibleengine} +type Task struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec TaskSpec `json:"spec"` + Status TaskStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// TaskList contains a list of Tasks +type TaskList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Task `json:"items"` +} + +// Repository type metadata. +var ( + Task_Kind = "Task" + Task_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Task_Kind}.String() + Task_KindAPIVersion = Task_Kind + "." + CRDGroupVersion.String() + Task_GroupVersionKind = CRDGroupVersion.WithKind(Task_Kind) +) + +func init() { + SchemeBuilder.Register(&Task{}, &TaskList{}) +} diff --git a/apis/zz_register.go b/apis/zz_register.go index c4f6a3e9..59a7bafa 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -50,6 +50,7 @@ import ( v1beta1sdrs "github.com/FrangipaneTeam/provider-flexibleengine/apis/sdrs/v1beta1" v1beta1sfs "github.com/FrangipaneTeam/provider-flexibleengine/apis/sfs/v1beta1" v1beta1smn "github.com/FrangipaneTeam/provider-flexibleengine/apis/smn/v1beta1" + v1beta1sms "github.com/FrangipaneTeam/provider-flexibleengine/apis/sms/v1beta1" v1beta1swr "github.com/FrangipaneTeam/provider-flexibleengine/apis/swr/v1beta1" v1beta1tms "github.com/FrangipaneTeam/provider-flexibleengine/apis/tms/v1beta1" v1alpha1 "github.com/FrangipaneTeam/provider-flexibleengine/apis/v1alpha1" @@ -103,6 +104,7 @@ func init() { v1beta1sdrs.SchemeBuilder.AddToScheme, v1beta1sfs.SchemeBuilder.AddToScheme, v1beta1smn.SchemeBuilder.AddToScheme, + v1beta1sms.SchemeBuilder.AddToScheme, v1beta1swr.SchemeBuilder.AddToScheme, v1beta1tms.SchemeBuilder.AddToScheme, v1alpha1.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index ae7c4024..57ce851e 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -830,6 +830,17 @@ var ExternalNameConfigs = map[string]config.ExternalName{ // flexibleengine_dws_cluster_v1 - No import documentation // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/dws_cluster_v1 "flexibleengine_dws_cluster_v1": config.IdentifierFromProvider, + + /* + Server Migration Service (SMS) + */ + // flexibleengine_sms_task - Imported using the ID + // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/sms_task + "flexibleengine_sms_task": config.IdentifierFromProvider, + + // flexibleengine_sms_server_template - Imported using the ID + // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/sms_server_template + "flexibleengine_sms_server_template": config.IdentifierFromProvider, } // TemplatedStringAsIdentifierWithNoName uses TemplatedStringAsIdentifier but diff --git a/config/provider.go b/config/provider.go index 3d0e66bc..2ae1a6e8 100644 --- a/config/provider.go +++ b/config/provider.go @@ -42,6 +42,7 @@ import ( "github.com/FrangipaneTeam/provider-flexibleengine/config/sdrs" "github.com/FrangipaneTeam/provider-flexibleengine/config/sfs" "github.com/FrangipaneTeam/provider-flexibleengine/config/smn" + "github.com/FrangipaneTeam/provider-flexibleengine/config/sms" "github.com/FrangipaneTeam/provider-flexibleengine/config/swr" "github.com/FrangipaneTeam/provider-flexibleengine/config/tms" "github.com/FrangipaneTeam/provider-flexibleengine/config/vbs" @@ -149,6 +150,7 @@ func GetProvider() *ujconfig.Provider { sfs.Configure, cce.Configure, rts.Configure, + sms.Configure, } { configure(pc) } diff --git a/config/sms/config.go b/config/sms/config.go new file mode 100644 index 00000000..44d2f9f2 --- /dev/null +++ b/config/sms/config.go @@ -0,0 +1,33 @@ +// Package sms contains custom ResourceConfigurators for FlexibleEngine SMS resources. +package sms + +import ( + "github.com/upbound/upjet/pkg/config" + + "github.com/FrangipaneTeam/provider-flexibleengine/pkg/tools" +) + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + // flexibleengine_sms_task + // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/sms_task + p.AddResourceConfigurator("flexibleengine_sms_task", func(r *config.Resource) { + r.References["vm_template_id"] = config.Reference{ + Type: "ServerTemplate", + } + }) + + p.AddResourceConfigurator("flexibleengine_sms_server_template", func(r *config.Resource) { + r.References["subnet_ids"] = config.Reference{ + Type: tools.GenerateType("vpc", "VPCSubnet"), + Extractor: tools.GenerateExtractor(true, "id"), + RefFieldName: "SubnetIDRefs", + SelectorFieldName: "SubnetIDSelector", + } + r.References["security_group_ids"] = config.Reference{ + Type: tools.GenerateType("vpc", "SecurityGroup"), + RefFieldName: "SecurityGroupIDRefs", + SelectorFieldName: "SecurityGroupIDSelector", + } + }) +} diff --git a/examples-generated/sms/servertemplate.yaml b/examples-generated/sms/servertemplate.yaml new file mode 100644 index 00000000..3d28bef5 --- /dev/null +++ b/examples-generated/sms/servertemplate.yaml @@ -0,0 +1,15 @@ +apiVersion: sms.flexibleengine.upbound.io/v1beta1 +kind: ServerTemplate +metadata: + annotations: + meta.upbound.io/example-id: sms/v1beta1/servertemplate + labels: + testing.upbound.io/example-name: demo + name: demo +spec: + forProvider: + availabilityZone: ${data.flexibleengine_availability_zones.demo.names[0]} + name: demo + +--- + diff --git a/examples-generated/sms/task.yaml b/examples-generated/sms/task.yaml new file mode 100644 index 00000000..968d1b8f --- /dev/null +++ b/examples-generated/sms/task.yaml @@ -0,0 +1,20 @@ +apiVersion: sms.flexibleengine.upbound.io/v1beta1 +kind: Task +metadata: + annotations: + meta.upbound.io/example-id: sms/v1beta1/task + labels: + testing.upbound.io/example-name: migration + name: migration +spec: + forProvider: + action: start + osType: LINUX + sourceServerId: ${var.source_server} + type: MIGRATE_FILE + vmTemplateIdSelector: + matchLabels: + testing.upbound.io/example-name: example + +--- + diff --git a/examples/sms/servertemplate.yaml b/examples/sms/servertemplate.yaml new file mode 100644 index 00000000..d6336164 --- /dev/null +++ b/examples/sms/servertemplate.yaml @@ -0,0 +1,12 @@ +apiVersion: sms.flexibleengine.upbound.io/v1beta1 +kind: ServerTemplate +metadata: + annotations: + meta.upbound.io/example-id: sms/v1beta1/servertemplate + labels: + testing.upbound.io/example-name: example_sms_servertemplate + name: example-sms-servertemplate +spec: + forProvider: + availabilityZone: eu-west-0a + name: demo \ No newline at end of file diff --git a/examples/sms/task.yaml b/examples/sms/task.yaml new file mode 100644 index 00000000..2d51de19 --- /dev/null +++ b/examples/sms/task.yaml @@ -0,0 +1,15 @@ +apiVersion: sms.flexibleengine.upbound.io/v1beta1 +kind: Task +metadata: + annotations: + meta.upbound.io/example-id: sms/v1beta1/task + labels: + testing.upbound.io/example-name: example_sms_task + name: example-sms-task +spec: + forProvider: + action: start + osType: LINUX + sourceServerId: 1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p + type: MIGRATE_FILE + vmTemplateId: 1a45v3c4d-5e6f-7g8h-9i0j-1k2l3m4n5ohy9e \ No newline at end of file diff --git a/internal/controller/sms/servertemplate/zz_controller.go b/internal/controller/sms/servertemplate/zz_controller.go new file mode 100755 index 00000000..b2d06797 --- /dev/null +++ b/internal/controller/sms/servertemplate/zz_controller.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package servertemplate + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/FrangipaneTeam/provider-flexibleengine/apis/sms/v1beta1" +) + +// Setup adds a controller that reconciles ServerTemplate managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.ServerTemplate_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1beta1.ServerTemplate_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["flexibleengine_sms_server_template"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServerTemplate_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1beta1.ServerTemplate{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/sms/task/zz_controller.go b/internal/controller/sms/task/zz_controller.go new file mode 100755 index 00000000..c132477c --- /dev/null +++ b/internal/controller/sms/task/zz_controller.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package task + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/FrangipaneTeam/provider-flexibleengine/apis/sms/v1beta1" +) + +// Setup adds a controller that reconciles Task managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.Task_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1beta1.Task_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["flexibleengine_sms_task"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Task_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1beta1.Task{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 76ebfeab..7a304008 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -140,6 +140,8 @@ import ( turbo "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/sfs/turbo" subscription "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/smn/subscription" topicsmn "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/smn/topic" + servertemplate "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/sms/servertemplate" + task "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/sms/task" organization "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/swr/organization" organizationusers "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/swr/organizationusers" repository "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/swr/repository" @@ -311,6 +313,8 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { turbo.Setup, subscription.Setup, topicsmn.Setup, + servertemplate.Setup, + task.Setup, organization.Setup, organizationusers.Setup, repository.Setup, diff --git a/list-tested.md b/list-tested.md index b99bb681..9b0fec0f 100644 --- a/list-tested.md +++ b/list-tested.md @@ -67,6 +67,13 @@ | Backup | :white_check_mark: | | BackupPolicy | :white_check_mark: | +## cse.flexibleengine.upbound.io +| Kind | Tested | +| ---- | ------ | +| Microservice | :x: | +| MicroserviceEngine | :x: | +| MicroserviceInstance | :x: | + ## css.flexibleengine.upbound.io | Kind | Tested | | ---- | ------ | @@ -229,6 +236,8 @@ ## modelarts.flexibleengine.upbound.io | Kind | Tested | | ---- | ------ | +| Dataset | :x: | +| DatasetVersion | :x: | | Dataset | :white_check_mark: | | DatasetVersion | :white_check_mark: | @@ -306,6 +315,12 @@ | Subscription | :white_check_mark: | | Topic | :white_check_mark: | +## sms.flexibleengine.upbound.io +| Kind | Tested | +| ---- | ------ | +| ServerTemplate | :white_check_mark: | +| Task | :white_check_mark: | + ## swr.flexibleengine.upbound.io | Kind | Tested | | ---- | ------ | diff --git a/package/crds/sms.flexibleengine.upbound.io_servertemplates.yaml b/package/crds/sms.flexibleengine.upbound.io_servertemplates.yaml new file mode 100644 index 00000000..b4dc1df5 --- /dev/null +++ b/package/crds/sms.flexibleengine.upbound.io_servertemplates.yaml @@ -0,0 +1,578 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: null + name: servertemplates.sms.flexibleengine.upbound.io +spec: + group: sms.flexibleengine.upbound.io + names: + categories: + - crossplane + - managed + - flexibleengine + kind: ServerTemplate + listKind: ServerTemplateList + plural: servertemplates + singular: servertemplate + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: ServerTemplate is the Schema for the ServerTemplates API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ServerTemplateSpec defines the desired state of ServerTemplate + properties: + deletionPolicy: + default: Delete + description: DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + availabilityZone: + description: Specifies the availability zone where the target + server is located. + type: string + bandwidthSize: + description: Specifies the bandwidth size in Mbit/s about the + public IP address that will be used for migration. + type: number + flavor: + description: Specifies the flavor ID for the target server. + type: string + name: + description: Specifies the server template name. + type: string + projectId: + description: Specifies the project ID where the target server + is located. If omitted, the default project in the region will + be used. + type: string + region: + description: Specifies the region where the target server is located. + If omitted, the provider-level region will be used. + type: string + securityGroupIdRefs: + description: References to SecurityGroup in vpc to populate securityGroupIds. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution + of this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which + will attempt to resolve the reference only when the + corresponding field is not present. Use 'Always' to + resolve the reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + securityGroupIdSelector: + description: Selector for a list of SecurityGroup in vpc to populate + securityGroupIds. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + securityGroupIds: + description: Specifies an array of one or more security group + IDs to associate with the target server. If omitted or set to + ["autoCreate"], a new security group will be created automatically + during migration. + items: + type: string + type: array + subnetIdRefs: + description: References to VPCSubnet in vpc to populate subnetIds. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution + of this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which + will attempt to resolve the reference only when the + corresponding field is not present. Use 'Always' to + resolve the reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + subnetIdSelector: + description: Selector for a list of VPCSubnet in vpc to populate + subnetIds. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + subnetIds: + description: Specifies an array of one or more VPC subnet IDs + to attach to the target server. If omitted or set to ["autoCreate"], + a new subnet will be created automatically during migration. + items: + type: string + type: array + targetServerName: + description: Specifies the name of the target server. Defaults + to the template name. + type: string + volumeType: + description: 'Specifies the disk type of the target server. Available + values are: SAS, SSD, GPSSD and ESSD, defaults to SAS.' + type: string + vpcId: + description: Specifies the ID of the VPC which the target server + belongs to. If omitted or set to "autoCreate", a new VPC will + be created automatically during migration. + type: string + vpcIdRef: + description: Reference to a VPC in vpc to populate vpcId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + vpcIdSelector: + description: Selector for a VPC in vpc to populate vpcId. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + required: + - availabilityZone + - name + type: object + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: ServerTemplateStatus defines the observed state of ServerTemplate. + properties: + atProvider: + properties: + id: + description: The resource ID in UUID format. + type: string + vpcName: + description: The name of the VPC which the target server belongs + to. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/package/crds/sms.flexibleengine.upbound.io_tasks.yaml b/package/crds/sms.flexibleengine.upbound.io_tasks.yaml new file mode 100644 index 00000000..1a7cfad2 --- /dev/null +++ b/package/crds/sms.flexibleengine.upbound.io_tasks.yaml @@ -0,0 +1,524 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: null + name: tasks.sms.flexibleengine.upbound.io +spec: + group: sms.flexibleengine.upbound.io + names: + categories: + - crossplane + - managed + - flexibleengine + kind: Task + listKind: TaskList + plural: tasks + singular: task + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: Task is the Schema for the Tasks API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: TaskSpec defines the desired state of Task + properties: + deletionPolicy: + default: Delete + description: DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + action: + description: Specifies the operation after the task is created. + The value can be start, stop and restart. + type: string + migrationIp: + description: Specifies the IP address of the target server. Use + the EIP of the target server if the migration network type is + Internet. Use the private IP address of the target server if + the migration network type is Direct Connect or VPN. Changing + this parameter will create a new resource. + type: string + osType: + description: Specifies the OS type of the source server. The value + can be WINDOWS and LINUX. Changing this parameter will create + a new resource. + type: string + projectId: + description: Specifies the project ID where the target server + is located. If omitted, the default project in the region will + be used. Changing this parameter will create a new resource. + type: string + region: + description: Specifies the region where the target server is located. + If omitted, the provider-level region will be used. Changing + this parameter will create a new resource. + type: string + sourceServerId: + description: Specifies the ID of the source server. Changing this + parameter will create a new resource. + type: string + startTargetServer: + description: Specifies whether to start the target server after + the migration. The default value is true. Changing this parameter + will create a new resource. + type: boolean + syncing: + description: '- Specifies whether to perform a continuous synchronization + after the first replication. The default value is false. Changing + this parameter will create a new resource.' + type: boolean + targetServerDisks: + description: Specifies the disk configurations of the target server. + If omitted, it will be obtained from the source server. The + object is documented below. Changing this parameter will create + a new resource. + items: + properties: + deviceType: + description: Specifies the disk type. The value can be NORMAL + and BOOT. Changing this parameter will create a new resource. + type: string + diskId: + description: Specifies the disk index, e.g. "0". Changing + this parameter will create a new resource. + type: string + name: + description: Specifies the disk name, e.g. "/dev/sda". Changing + this parameter will create a new resource. + type: string + physicalVolumes: + description: Specifies an array of physical volume informations. + The object is documented below. Changing this parameter + will create a new resource. + items: + properties: + deviceType: + description: Specifies the disk type. The value can + be NORMAL and BOOT. Changing this parameter will + create a new resource. + type: string + fileSystem: + description: Specifies the file system type, e.g. + "ext4". Changing this parameter will create a new + resource. + type: string + index: + description: Specifies the serial number of the volume. + Changing this parameter will create a new resource. + type: number + mountPoint: + description: Specifies the mount point, e.g. "/". + Changing this parameter will create a new resource. + type: string + name: + description: Specifies the disk name, e.g. "/dev/sda". + Changing this parameter will create a new resource. + type: string + size: + description: Specifies the volume size in MB. Changing + this parameter will create a new resource. + type: number + usedSize: + description: Specifies the used space in MB. Changing + this parameter will create a new resource. + type: number + uuid: + description: Specifies the GUID of the volume. Changing + this parameter will create a new resource. + type: string + required: + - deviceType + - fileSystem + - index + - mountPoint + - name + - size + type: object + type: array + size: + description: Specifies the volume size in MB. Changing this + parameter will create a new resource. + type: number + usedSize: + description: Specifies the used space in MB. Changing this + parameter will create a new resource. + type: number + required: + - deviceType + - name + - size + type: object + type: array + targetServerId: + description: Specifies the existing server ID as the target server. + This parameter and vm_template_id are alternative. Changing + this parameter will create a new resource. + type: string + type: + description: Specifies the type of the migration task. Available + values are MIGRATE_FILE(file-level migration) and MIGRATE_BLOCK(block-level + migration). Changing this parameter will create a new resource. + type: string + usePublicIp: + description: Specifies whether to use a public IP address for + migration. The default value is true. Changing this parameter + will create a new resource. + type: boolean + vmTemplateId: + description: Specifies the template used to create the target + server automatically. This parameter and target_server_id are + alternative. Changing this parameter will create a new resource. + type: string + vmTemplateIdRef: + description: Reference to a ServerTemplate to populate vmTemplateId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + vmTemplateIdSelector: + description: Selector for a ServerTemplate to populate vmTemplateId. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + required: + - osType + - sourceServerId + - type + type: object + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: TaskStatus defines the observed state of Task. + properties: + atProvider: + properties: + enterpriseProjectId: + description: The enterprise project id of the target server. + type: string + id: + description: The resource ID in UUID format. + type: string + migrateSpeed: + description: The migration rate, in MB/s. + type: number + state: + description: The status of the migration task. + type: string + targetServerName: + description: The name of the target server. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: []