Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b60f32c570 |
53
CHANGELOG.md
53
CHANGELOG.md
@@ -1,51 +1,4 @@
|
|||||||
## Version 4.3.0
|
## Version 4.3.1
|
||||||
|
|
||||||
## Features
|
## Bugfixes
|
||||||
- CloudBroker (requires admin privileges):
|
- Deleted custom_fields field from kvmvm resource
|
||||||
- Created "decort_cb_extnet" resource - used to create and manage Extnet instances
|
|
||||||
- Created "decort_cb_extnet" data source - used to read information about Extnet instance
|
|
||||||
- Created "decort_cb_extnet_list" data source - used to read information about multiple Extnet instances
|
|
||||||
- CloudAPI:
|
|
||||||
- Updated resource_compute: added "custom_fields" and "with_default_vins" parameters:
|
|
||||||
- Set "with_default_vins" to false to create compute without any attached networks. This parameter is ignored if any network block is specified
|
|
||||||
- Added ability to create stateless computes (SVA_KVM_X86)
|
|
||||||
- Created "decort_k8ci_list" data source - used to read information about available K8CI instances
|
|
||||||
- Updated resources && data sources to platform version 3.8.7, which includes:
|
|
||||||
- Added new optional fields to all list data sources, used to filter results, which are:
|
|
||||||
- decort_account_list
|
|
||||||
- decort_bservice_list
|
|
||||||
- decort_kvmvm_list
|
|
||||||
- decort_disk_list
|
|
||||||
- decort_extnet_list
|
|
||||||
- decort_flipgroup_list
|
|
||||||
- decort_image_list
|
|
||||||
- decort_k8s_list
|
|
||||||
- decort_k8s_list_deleted
|
|
||||||
- decort_rg_list
|
|
||||||
- decort_vins_list
|
|
||||||
- decort_account_deleted_list
|
|
||||||
- decort_account_computes_list
|
|
||||||
- decort_account_disks_list
|
|
||||||
- decort_account_flipgroups_list
|
|
||||||
- decort_account_rg_list
|
|
||||||
- decort_account_vins_list
|
|
||||||
- decort_disk_list_deleted
|
|
||||||
- decort_disk_list_unattached
|
|
||||||
- decort_lb_list
|
|
||||||
- decort_lb_list_deleted
|
|
||||||
- decort_rg_list_computes
|
|
||||||
- decort_rg_list_deleted
|
|
||||||
- decort_rg_list_lb
|
|
||||||
- decort_rg_list_pfw
|
|
||||||
- decort_rg_list_vins
|
|
||||||
- decort_vins_list_deleted
|
|
||||||
- Added "cu_dm" field to resgroup and account resource limits and consumed units
|
|
||||||
- Added "reference_id" field to compute snapshots model
|
|
||||||
- Added "stateless_sep_id" and "stateless_sep_type" fields to compute models
|
|
||||||
- Misc:
|
|
||||||
- Added darwin_arm64, linux_arm64 as release build targets
|
|
||||||
- Every release starting from version 4.3.0 will have installers included in the archive
|
|
||||||
- install.sh - used on linux, darwin and bsd systems
|
|
||||||
- install.bat - used on windows machines
|
|
||||||
- Updated samples
|
|
||||||
- Updated README
|
|
||||||
2
Makefile
2
Makefile
@@ -7,7 +7,7 @@ ZIPDIR = ./zip
|
|||||||
BINARY=${NAME}
|
BINARY=${NAME}
|
||||||
WORKPATH= ./examples/terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAMESPACE}/${VERSION}/${OS_ARCH}
|
WORKPATH= ./examples/terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAMESPACE}/${VERSION}/${OS_ARCH}
|
||||||
MAINPATH = ./cmd/decort/
|
MAINPATH = ./cmd/decort/
|
||||||
VERSION=4.3.0
|
VERSION=4.3.1
|
||||||
#OS_ARCH=darwin_amd64
|
#OS_ARCH=darwin_amd64
|
||||||
# OS_ARCH=windows_amd64
|
# OS_ARCH=windows_amd64
|
||||||
OS_ARCH=linux_amd64
|
OS_ARCH=linux_amd64
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
|
||||||
Authors:
|
|
||||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
|
||||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
|
||||||
Kasim Baybikov, <kmbaybikov@basistech.ru>
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package constants
|
|
||||||
|
|
||||||
//CloudApi - a part of url for cloudapi
|
|
||||||
const CloudApi = "/restmachine/cloudapi"
|
|
||||||
|
|
||||||
//CloudBroker - a part of url for cloudbroker
|
|
||||||
const CloudBroker = "/restmachine/cloudbroker"
|
|
||||||
@@ -637,10 +637,10 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"custom_fields": {
|
// "custom_fields": {
|
||||||
Type: schema.TypeString,
|
// Type: schema.TypeString,
|
||||||
Computed: true,
|
// Computed: true,
|
||||||
},
|
// },
|
||||||
"deleted_by": {
|
"deleted_by": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|||||||
@@ -154,10 +154,10 @@ func itemComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"custom_fields": { //NEED
|
// "custom_fields": { //NEED
|
||||||
Type: schema.TypeString,
|
// Type: schema.TypeString,
|
||||||
Computed: true,
|
// Computed: true,
|
||||||
},
|
// },
|
||||||
"deleted_by": {
|
"deleted_by": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ func flattenListACL(listAcl compute.ListACL) []map[string]interface{} {
|
|||||||
func flattenComputeList(computes *compute.ListComputes) []map[string]interface{} {
|
func flattenComputeList(computes *compute.ListComputes) []map[string]interface{} {
|
||||||
res := make([]map[string]interface{}, 0)
|
res := make([]map[string]interface{}, 0)
|
||||||
for _, compute := range computes.Data {
|
for _, compute := range computes.Data {
|
||||||
customFields, _ := json.Marshal(compute.CustomFields)
|
// customFields, _ := json.Marshal(compute.CustomFields)
|
||||||
devices, _ := json.Marshal(compute.Devices)
|
devices, _ := json.Marshal(compute.Devices)
|
||||||
temp := map[string]interface{}{
|
temp := map[string]interface{}{
|
||||||
"acl": flattenListACL(compute.ACL),
|
"acl": flattenListACL(compute.ACL),
|
||||||
@@ -169,44 +169,44 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
|
|||||||
"cpus": compute.CPU,
|
"cpus": compute.CPU,
|
||||||
"created_by": compute.CreatedBy,
|
"created_by": compute.CreatedBy,
|
||||||
"created_time": compute.CreatedTime,
|
"created_time": compute.CreatedTime,
|
||||||
"custom_fields": string(customFields),
|
// "custom_fields": string(customFields),
|
||||||
"deleted_by": compute.DeletedBy,
|
"deleted_by": compute.DeletedBy,
|
||||||
"deleted_time": compute.DeletedTime,
|
"deleted_time": compute.DeletedTime,
|
||||||
"desc": compute.Description,
|
"desc": compute.Description,
|
||||||
"devices": string(devices),
|
"devices": string(devices),
|
||||||
"disks": flattenDisks(compute.Disks),
|
"disks": flattenDisks(compute.Disks),
|
||||||
"driver": compute.Driver,
|
"driver": compute.Driver,
|
||||||
"gid": compute.GID,
|
"gid": compute.GID,
|
||||||
"guid": compute.GUID,
|
"guid": compute.GUID,
|
||||||
"compute_id": compute.ID,
|
"compute_id": compute.ID,
|
||||||
"image_id": compute.ImageID,
|
"image_id": compute.ImageID,
|
||||||
"interfaces": flattenInterfaces(compute.Interfaces),
|
"interfaces": flattenInterfaces(compute.Interfaces),
|
||||||
"lock_status": compute.LockStatus,
|
"lock_status": compute.LockStatus,
|
||||||
"manager_id": compute.ManagerID,
|
"manager_id": compute.ManagerID,
|
||||||
"manager_type": compute.ManagerType,
|
"manager_type": compute.ManagerType,
|
||||||
"migrationjob": compute.MigrationJob,
|
"migrationjob": compute.MigrationJob,
|
||||||
"milestones": compute.Milestones,
|
"milestones": compute.Milestones,
|
||||||
"name": compute.Name,
|
"name": compute.Name,
|
||||||
"pinned": compute.Pinned,
|
"pinned": compute.Pinned,
|
||||||
"ram": compute.RAM,
|
"ram": compute.RAM,
|
||||||
"reference_id": compute.ReferenceID,
|
"reference_id": compute.ReferenceID,
|
||||||
"registered": compute.Registered,
|
"registered": compute.Registered,
|
||||||
"res_name": compute.ResName,
|
"res_name": compute.ResName,
|
||||||
"rg_id": compute.RGID,
|
"rg_id": compute.RGID,
|
||||||
"rg_name": compute.RGName,
|
"rg_name": compute.RGName,
|
||||||
"snap_sets": flattenSnapSets(compute.SnapSets),
|
"snap_sets": flattenSnapSets(compute.SnapSets),
|
||||||
"stateless_sep_id": compute.StatelessSepID,
|
"stateless_sep_id": compute.StatelessSepID,
|
||||||
"stateless_sep_type": compute.StatelessSepType,
|
"stateless_sep_type": compute.StatelessSepType,
|
||||||
"status": compute.Status,
|
"status": compute.Status,
|
||||||
"tags": flattenTags(compute.Tags),
|
"tags": flattenTags(compute.Tags),
|
||||||
"tech_status": compute.TechStatus,
|
"tech_status": compute.TechStatus,
|
||||||
"total_disk_size": compute.TotalDiskSize,
|
"total_disk_size": compute.TotalDiskSize,
|
||||||
"updated_by": compute.UpdatedBy,
|
"updated_by": compute.UpdatedBy,
|
||||||
"updated_time": compute.UpdatedTime,
|
"updated_time": compute.UpdatedTime,
|
||||||
"user_managed": compute.UserManaged,
|
"user_managed": compute.UserManaged,
|
||||||
"vgpus": compute.VGPUs,
|
"vgpus": compute.VGPUs,
|
||||||
"vins_connected": compute.VINSConnected,
|
"vins_connected": compute.VINSConnected,
|
||||||
"virtual_image_id": compute.VirtualImageID,
|
"virtual_image_id": compute.VirtualImageID,
|
||||||
}
|
}
|
||||||
res = append(res, temp)
|
res = append(res, temp)
|
||||||
}
|
}
|
||||||
@@ -541,7 +541,7 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
|
|||||||
d.Set("cpus", computeRec.CPU)
|
d.Set("cpus", computeRec.CPU)
|
||||||
d.Set("created_by", computeRec.CreatedBy)
|
d.Set("created_by", computeRec.CreatedBy)
|
||||||
d.Set("created_time", computeRec.CreatedTime)
|
d.Set("created_time", computeRec.CreatedTime)
|
||||||
d.Set("custom_fields", flattenCustomFields(computeRec.CustomFields))
|
// d.Set("custom_fields", flattenCustomFields(computeRec.CustomFields))
|
||||||
d.Set("deleted_by", computeRec.DeletedBy)
|
d.Set("deleted_by", computeRec.DeletedBy)
|
||||||
d.Set("deleted_time", computeRec.DeletedTime)
|
d.Set("deleted_time", computeRec.DeletedTime)
|
||||||
d.Set("desc", computeRec.Description)
|
d.Set("desc", computeRec.Description)
|
||||||
|
|||||||
@@ -192,16 +192,6 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
|
|
||||||
createReqX86.Driver = driver
|
createReqX86.Driver = driver
|
||||||
|
|
||||||
if custom_fields, ok := d.GetOk("custom_fields"); ok {
|
|
||||||
val := custom_fields.(string)
|
|
||||||
val = strings.ReplaceAll(val, "\\", "")
|
|
||||||
val = strings.ReplaceAll(val, "\n", "")
|
|
||||||
val = strings.ReplaceAll(val, "\t", "")
|
|
||||||
val = strings.TrimSpace(val)
|
|
||||||
|
|
||||||
createReqX86.CustomFields = val
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Debugf("resourceComputeCreate: creating Compute of type KVM VM x86")
|
log.Debugf("resourceComputeCreate: creating Compute of type KVM VM x86")
|
||||||
apiResp, err := c.CloudAPI().KVMX86().Create(ctx, createReqX86)
|
apiResp, err := c.CloudAPI().KVMX86().Create(ctx, createReqX86)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -1345,35 +1335,6 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.HasChange("custom_fields") {
|
|
||||||
val := d.Get("custom_fields").(string)
|
|
||||||
val = strings.ReplaceAll(val, "\\", "")
|
|
||||||
val = strings.ReplaceAll(val, "\n", "")
|
|
||||||
val = strings.ReplaceAll(val, "\t", "")
|
|
||||||
val = strings.TrimSpace(val)
|
|
||||||
|
|
||||||
if len(val) > 0 {
|
|
||||||
req := compute.SetCustomFieldsRequest{
|
|
||||||
ComputeID: computeRec.ID,
|
|
||||||
CustomFields: val,
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err := c.CloudAPI().Compute().SetCustomFields(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return diag.FromErr(err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
req := compute.DeleteCustomFieldsRequest{
|
|
||||||
ComputeID: computeRec.ID,
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err := c.CloudAPI().Compute().DeleteCustomFields(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return diag.FromErr(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// we may reuse dataSourceComputeRead here as we maintain similarity
|
// we may reuse dataSourceComputeRead here as we maintain similarity
|
||||||
// between Compute resource and Compute data source schemas
|
// between Compute resource and Compute data source schemas
|
||||||
defer resourceComputeRead(ctx, d, m)
|
defer resourceComputeRead(ctx, d, m)
|
||||||
@@ -1717,10 +1678,6 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Schema: disksSubresourceSchemaMake(),
|
Schema: disksSubresourceSchemaMake(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"custom_fields": {
|
|
||||||
Type: schema.TypeString,
|
|
||||||
Optional: true,
|
|
||||||
},
|
|
||||||
"stateless": {
|
"stateless": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user