gos_tech_4.4.3 4.3.1
Nikita Sorokin 2 years ago
parent 272e385318
commit b60f32c570

@ -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

@ -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,7 +169,7 @@ 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,
@ -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,

Loading…
Cancel
Save