parent
							
								
									f731cf246f
								
							
						
					
					
						commit
						272e385318
					
				| @ -1,6 +1,51 @@ | |||||||
| ## Version 4.2.4 | ## Version 4.3.0 | ||||||
| 
 | 
 | ||||||
| ## Bug Fixes | ## Features | ||||||
| - Fixed incorrect network validation in decort_kvmvm resource | - CloudBroker (requires admin privileges): | ||||||
| - Fixed inability to remove all networks at once in decort_kvmvm resource | 	- Created "decort_cb_extnet" resource - used to create and manage Extnet instances | ||||||
| - Deleted "check__ips" (duplicate) field in decort_extnet data source | 	- 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 | ||||||
|  | |||||||
| @ -0,0 +1,92 @@ | |||||||
|  | /* | ||||||
|  | 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> | ||||||
|  | Tim Tkachev, <tvtkachev@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. | ||||||
|  | */ | ||||||
|  | 
 | ||||||
|  | /* | ||||||
|  | Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud | ||||||
|  | Orchestration Technology) with Terraform by Hashicorp. | ||||||
|  | 
 | ||||||
|  | Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
 | ||||||
|  | 
 | ||||||
|  | Please see README.md to learn where to place source code so that it | ||||||
|  | builds seamlessly. | ||||||
|  | 
 | ||||||
|  | Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
 | ||||||
|  | */ | ||||||
|  | 
 | ||||||
|  | package disks | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"context" | ||||||
|  | 
 | ||||||
|  | 	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||||||
|  | 	log "github.com/sirupsen/logrus" | ||||||
|  | 	"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/disks" | ||||||
|  | 	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | func utilityDiskListDeletedCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*disks.ListDisks, error) { | ||||||
|  | 	c := m.(*controller.ControllerCfg) | ||||||
|  | 	req := disks.ListDeletedRequest{} | ||||||
|  | 
 | ||||||
|  | 	if account_id, ok := d.GetOk("account_id"); ok { | ||||||
|  | 		req.AccountID = uint64(account_id.(int)) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if typev, ok := d.GetOk("type"); ok { | ||||||
|  | 		req.Type = typev.(string) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if page, ok := d.GetOk("page"); ok { | ||||||
|  | 		req.Page = uint64(page.(int)) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if size, ok := d.GetOk("size"); ok { | ||||||
|  | 		req.Size = uint64(size.(int)) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if by_id, ok := d.GetOk("by_id"); ok { | ||||||
|  | 		req.ByID = uint64(by_id.(int)) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if name, ok := d.GetOk("name"); ok { | ||||||
|  | 		req.Name = name.(string) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if account_name, ok := d.GetOk("account_name"); ok { | ||||||
|  | 		req.AccountName = account_name.(string) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if disk_max_size, ok := d.GetOk("disk_max_size"); ok { | ||||||
|  | 		req.DiskMaxSize = int64(disk_max_size.(int)) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if shared, ok := d.GetOk("shared"); ok { | ||||||
|  | 		req.Shared = shared.(bool) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	log.Debugf("utilityDiskListDeletedCheckPresence: load disk list") | ||||||
|  | 	diskList, err := c.CloudAPI().Disks().ListDeleted(ctx, req) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	return diskList, nil | ||||||
|  | } | ||||||
| @ -0,0 +1,175 @@ | |||||||
|  | /* | ||||||
|  | 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> | ||||||
|  | Tim Tkachev, <tvtkachev@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. | ||||||
|  | */ | ||||||
|  | 
 | ||||||
|  | /* | ||||||
|  | Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud | ||||||
|  | Orchestration Technology) with Terraform by Hashicorp. | ||||||
|  | 
 | ||||||
|  | Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
 | ||||||
|  | 
 | ||||||
|  | Please see README.md to learn where to place source code so that it | ||||||
|  | builds seamlessly. | ||||||
|  | 
 | ||||||
|  | Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
 | ||||||
|  | */ | ||||||
|  | 
 | ||||||
|  | package k8s | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"context" | ||||||
|  | 
 | ||||||
|  | 	"github.com/google/uuid" | ||||||
|  | 	"github.com/hashicorp/terraform-plugin-sdk/v2/diag" | ||||||
|  | 	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||||||
|  | 	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | func dataSourceK8CIListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { | ||||||
|  | 	list, err := utilityK8CIListCheckPresence(ctx, d, m) | ||||||
|  | 	if err != nil { | ||||||
|  | 		d.SetId("") | ||||||
|  | 		return diag.FromErr(err) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	d.SetId(uuid.New().String()) | ||||||
|  | 	flattenK8CIList(d, list) | ||||||
|  | 	d.Set("entry_count", list.EntryCount) | ||||||
|  | 
 | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func dataSourceK8CIListSchemaMake() map[string]*schema.Schema { | ||||||
|  | 	return map[string]*schema.Schema{ | ||||||
|  | 		"by_id": { | ||||||
|  | 			Type:        schema.TypeInt, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Description: "Filter by ID", | ||||||
|  | 		}, | ||||||
|  | 		"name": { | ||||||
|  | 			Type:        schema.TypeString, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Description: "Filter by name", | ||||||
|  | 		}, | ||||||
|  | 		"status": { | ||||||
|  | 			Type:        schema.TypeString, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Description: "Filter by status", | ||||||
|  | 		}, | ||||||
|  | 		"worker_driver": { | ||||||
|  | 			Type:        schema.TypeString, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Description: "Filter by worker driver", | ||||||
|  | 		}, | ||||||
|  | 		"master_driver": { | ||||||
|  | 			Type:        schema.TypeString, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Description: "Filter by master driver", | ||||||
|  | 		}, | ||||||
|  | 		"network_plugin": { | ||||||
|  | 			Type:        schema.TypeString, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Description: "Filter by network plugin", | ||||||
|  | 		}, | ||||||
|  | 		"include_disabled": { | ||||||
|  | 			Type:        schema.TypeBool, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Default:     false, | ||||||
|  | 			Description: "Include deleted k8cis in result", | ||||||
|  | 		}, | ||||||
|  | 		"page": { | ||||||
|  | 			Type:        schema.TypeInt, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Description: "Page number", | ||||||
|  | 		}, | ||||||
|  | 		"size": { | ||||||
|  | 			Type:        schema.TypeInt, | ||||||
|  | 			Optional:    true, | ||||||
|  | 			Description: "Page size", | ||||||
|  | 		}, | ||||||
|  | 		"items": { | ||||||
|  | 			Type:     schema.TypeList, | ||||||
|  | 			Computed: true, | ||||||
|  | 			Elem: &schema.Resource{ | ||||||
|  | 				Schema: map[string]*schema.Schema{ | ||||||
|  | 					"k8ci_id": { | ||||||
|  | 						Type:        schema.TypeInt, | ||||||
|  | 						Computed:    true, | ||||||
|  | 						Description: "K8CI ID", | ||||||
|  | 					}, | ||||||
|  | 					"name": { | ||||||
|  | 						Type:        schema.TypeString, | ||||||
|  | 						Computed:    true, | ||||||
|  | 						Description: "K8CI name", | ||||||
|  | 					}, | ||||||
|  | 					"lb_image_id": { | ||||||
|  | 						Type:        schema.TypeInt, | ||||||
|  | 						Computed:    true, | ||||||
|  | 						Description: "LB Image ID", | ||||||
|  | 					}, | ||||||
|  | 					"network_plugins": { | ||||||
|  | 						Type:        schema.TypeList, | ||||||
|  | 						Computed:    true, | ||||||
|  | 						Description: "List of available network plugins", | ||||||
|  | 						Elem: &schema.Schema{ | ||||||
|  | 							Type: schema.TypeString, | ||||||
|  | 						}, | ||||||
|  | 					}, | ||||||
|  | 					"status": { | ||||||
|  | 						Type:        schema.TypeString, | ||||||
|  | 						Computed:    true, | ||||||
|  | 						Description: "K8CI Status", | ||||||
|  | 					}, | ||||||
|  | 					"desc": { | ||||||
|  | 						Type:     schema.TypeString, | ||||||
|  | 						Computed: true, | ||||||
|  | 					}, | ||||||
|  | 					"created_time": { | ||||||
|  | 						Type:     schema.TypeInt, | ||||||
|  | 						Computed: true, | ||||||
|  | 					}, | ||||||
|  | 					"version": { | ||||||
|  | 						Type:     schema.TypeString, | ||||||
|  | 						Computed: true, | ||||||
|  | 					}, | ||||||
|  | 				}, | ||||||
|  | 			}, | ||||||
|  | 		}, | ||||||
|  | 		"entry_count": { | ||||||
|  | 			Type:     schema.TypeInt, | ||||||
|  | 			Computed: true, | ||||||
|  | 		}, | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func DataSourceK8CIList() *schema.Resource { | ||||||
|  | 	return &schema.Resource{ | ||||||
|  | 		SchemaVersion: 1, | ||||||
|  | 
 | ||||||
|  | 		ReadContext: dataSourceK8CIListRead, | ||||||
|  | 
 | ||||||
|  | 		Timeouts: &schema.ResourceTimeout{ | ||||||
|  | 			Read:    &constants.Timeout30s, | ||||||
|  | 			Default: &constants.Timeout60s, | ||||||
|  | 		}, | ||||||
|  | 
 | ||||||
|  | 		Schema: dataSourceK8CIListSchemaMake(), | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @ -0,0 +1,83 @@ | |||||||
|  | /* | ||||||
|  | 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> | ||||||
|  | Tim Tkachev, <tvtkachev@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. | ||||||
|  | */ | ||||||
|  | 
 | ||||||
|  | /* | ||||||
|  | Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud | ||||||
|  | Orchestration Technology) with Terraform by Hashicorp. | ||||||
|  | 
 | ||||||
|  | Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
 | ||||||
|  | 
 | ||||||
|  | Please see README.md to learn where to place source code so that it | ||||||
|  | builds seamlessly. | ||||||
|  | 
 | ||||||
|  | Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
 | ||||||
|  | */ | ||||||
|  | 
 | ||||||
|  | package k8s | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"context" | ||||||
|  | 
 | ||||||
|  | 	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||||||
|  | 	"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/k8ci" | ||||||
|  | 	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | func utilityK8CIListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*k8ci.ListK8CI, error) { | ||||||
|  | 	c := m.(*controller.ControllerCfg) | ||||||
|  | 
 | ||||||
|  | 	req := k8ci.ListRequest{} | ||||||
|  | 
 | ||||||
|  | 	if by_id, ok := d.GetOk("by_id"); ok { | ||||||
|  | 		req.ByID = uint64(by_id.(int)) | ||||||
|  | 	} | ||||||
|  | 	if name, ok := d.GetOk("name"); ok { | ||||||
|  | 		req.Name = name.(string) | ||||||
|  | 	} | ||||||
|  | 	if status, ok := d.GetOk("status"); ok { | ||||||
|  | 		req.Status = status.(string) | ||||||
|  | 	} | ||||||
|  | 	if worker_driver, ok := d.GetOk("worker_driver"); ok { | ||||||
|  | 		req.WorkerDriver = worker_driver.(string) | ||||||
|  | 	} | ||||||
|  | 	if master_driver, ok := d.GetOk("master_driver"); ok { | ||||||
|  | 		req.MasterDriver = master_driver.(string) | ||||||
|  | 	} | ||||||
|  | 	if network_plugin, ok := d.GetOk("network_plugin"); ok { | ||||||
|  | 		req.NetworkPlugins = network_plugin.(string) | ||||||
|  | 	} | ||||||
|  | 	if include_disabled, ok := d.GetOk("include_disabled"); ok { | ||||||
|  | 		req.IncludeDisabled = include_disabled.(bool) | ||||||
|  | 	} | ||||||
|  | 	if page, ok := d.GetOk("page"); ok { | ||||||
|  | 		req.Page = uint64(page.(int)) | ||||||
|  | 	} | ||||||
|  | 	if size, ok := d.GetOk("size"); ok { | ||||||
|  | 		req.Size = uint64(size.(int)) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	resList, err := c.CloudAPI().K8CI().List(ctx, req) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	return resList, nil | ||||||
|  | } | ||||||
Some files were not shown because too many files have changed in this diff Show More
					Loading…
					
					
				
		Reference in new issue