Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
754b4e1143 | ||
| 069d63a65c | |||
| 67830db3eb |
221
CHANGELOG.md
221
CHANGELOG.md
@@ -1,223 +1,8 @@
|
|||||||
## Version 4.10.1
|
## Version 4.10.4
|
||||||
|
|
||||||
### Добавлено
|
|
||||||
|
|
||||||
#### access group
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1109 | Resource `decort_sdn_access_group` и datasources `decort_sdn_access_group`, `decort_sdn_access_group_list`, `decort_sdn_access_group_user_list` в sdn/access_group |
|
|
||||||
|
|
||||||
#### account
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1061 | Опциональный блок `storage_policy` в блок `resource_limits` в resource `decort_cb_account` в cloudbroker/account |
|
|
||||||
| BATF-1061 | Вычисляемое поля `storage_policy` в блок `resource_limits` resource `decort_account` и datasources `decort_account`, `decort_account_resource_consumption_get` в cloudapi/account и resource `decort_cb_account` и datasources `decort_cb_account`, `decort_cb_account_list,` `decort_cb_account_list_deleted` в cloudbroker/account |
|
|
||||||
| BATF-1075 | Опциональное поле `zone_id` в datasource `decort_account_list` в cloudapi/account и в datasource `decort_cb_account_list` в cloudbroker/account |
|
|
||||||
| BATF-1087 | Вычислямый блок `policies` в блоки `consumed` и `reserved` в datasources `decort_account_resource_consumption_get`, `decort_account_resource_consumption_list` в cloudapi/account и в `decort_cb_account_resource_consumption_get`, `decort_cb_account_resource_consumption_list` в cloudbroker/account |
|
|
||||||
| BATF-1085| Вычисляемое поле `zone_ids` в datasources `decort_account_list` и `decort_account_deleted_list` в cloudapi/account |
|
|
||||||
|
|
||||||
#### audit
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1080 | Вычисляемое поле `correlation_id` в datasources `decort_audit` в cloudapi/audit и в`decort_cb_audit_list`, `decort_cb_audit` в cloudbroker/audit |
|
|
||||||
| BATF-1095 | Опциональные поля `resgroup_id`, `compute_id`, `account_id`, `vins_id`, `service_id`, `k8s_id`, `flipgroup_id`, `lb_id`, `sep_id`, `node_id` и `exclude_audit_lines` в datasource `decort_cb_audit_list` в cloudbroker/audit |
|
|
||||||
| BATF-1095 | Datasource `decort_audit_list` в cloudapi/audit |
|
|
||||||
|
|
||||||
#### bservice
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1065 | Обязательное поле `storage_policy` в resource `decort_bservice_group` в cloudapi/bservice |
|
|
||||||
| BATF-1075 | Опциональное поле `zone_id` в datasource `decort_bservice_list` в cloudapi/bservice |
|
|
||||||
|
|
||||||
#### default security policy
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1111 | Datasource `decort_sdn_default_security_policy_list` в sdn/default_security_policy |
|
|
||||||
|
|
||||||
#### disks
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1063 | Обязательное поле `storage_policy_id` в resources `decort_disk` в cloudapi/disk и `decort_cb_disk` в cloudbroker/disk |
|
|
||||||
| BATF-1063 | Вычисляемое поле `storage_policy_id` в data_sources `decort_disk`, `decort_disk_list` и `decort_disk_deleted` в cloudapi/disk и `decort_cb_disk`, `decort_cb_disk_list`, `decort_cb_disk_list_deleted` в cloudbroker/disk |
|
|
||||||
| BATF-1079 | Вычисляемое поле `to_clean` в data_sources `decort_disk`, `decort_disk_list` и `decort_disk_deleted` в cloudapi/disk и `decort_cb_disk`, `decort_cb_disk_list`, `decort_cb_disk_list_deleted` в cloudbroker/disk |
|
|
||||||
| BATF-1079 | Вычисляемое поле `to_clean` в resources `decort_disk` в cloudapi/disk и `decort_cb_disk` в cloudbroker/disk |
|
|
||||||
|
|
||||||
#### extnet
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1074 | Опциональное поле `enable_secgroups` в resource `decort_cb_extnet` в cloudbroker/extnet |
|
|
||||||
| BATF-1075 | Опциональное поле `zone_id` в datasource `decort_extnet_list` в cloudapi/extnet и в datasource `decort_cb_extnet_list` в cloudbroker/extnet |
|
|
||||||
|
|
||||||
#### dpdk
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1074 | Опциональное поле `enable_secgroups` в resource `decort_cb_dpdknet` в cloudbroker/dpdk |
|
|
||||||
|
|
||||||
#### image
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1005 | Опциональный поле `account_id` в resource `decort_image_virtual` в cloudapi/image |
|
|
||||||
| BATF-1093 | Опциональное поле `storage_policy_id` в datasource `decort_image_list` в cloudapi/image и в datasource `decort_cb_image_list` в cloudbroker/image |
|
|
||||||
| BATF-1067 | Обязательное поле `storage_policy_id` в resources `decort_image` в cloudapi/image и `decort_cb_image` и `decort_cb_image_cdrom` в cloudbroker/image |
|
|
||||||
| BATF-1067 | Вычисляемое поле `storage_policy_id` в datasources `decort_image` и `decort_image_list` в cloudapi/image и datasources `decort_cb_image` и `decort_cb_image_list` в cloudbroker/image |
|
|
||||||
| BATF-1127 | Вычисляемое поле `to_clean` в datasources `decort_image` в cloudapi/image и datasources `decort_cb_image` и `decort_cb_image_list` в cloudbroker/image |
|
|
||||||
| BATF-1127 | Вычисляемое поле `to_clean` в resources `decort_image`, `decort_image_from_blank_compute`, `decort_image_from_platform_disk`, `decort_image_virtual` в cloudapi/image и resources `decort_cb_image`, `decort_cb_cdrom_image`, `decort_cb_image_from_blank_compute`, `decort_cb_image_from_platform_disk`, `decort_cb_image_virtual` в cloudbroker/image |
|
|
||||||
|
|
||||||
#### k8s
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1066 | Обязательное поле `storage_policy_id`, в resources `decort_k8s`, `decort_k8s_cp`, `decort_k8s_wg` в cloudapi/kvmvm и `decort_cb_k8s_cp`, `decort_cb_k8s_wg`, в cloudbroker/k8s |
|
|
||||||
| BATF-1075 | Опциональное поле `zone_id` в datasource `decort_kvmvm_list` в cloudapi/kvmvm и в datasource `decort_cb_kvmvm_list` в cloudbroker/kvmvm |
|
|
||||||
|
|
||||||
#### kvmvm
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1057 | Опциональные поля `timestamp_at`, `timestamp_to`, `user`, `call`, `sort_by`, `page`, `size`, `min_status_code`, `max_status_code` в datasources `decort_kvmvm_audits` в cloudapi/kvmvm и `decort_cb_kvmvm_audits` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1064 | Обязательное поле `storage_policy_id` в resources `decort_kvmvmv` в cloudapi/kvmvm и `decort_cb_kvmvm` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1064 | Вычисляемое поле `storage_policy_id` в data_sources `decort_kvmvmv` в cloudapi/kvmvm и `decort_cb_kvmvm` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1073 | Вычисляемые поля `security_groups` и `enable_secgroups` в блоке `interfaces` в data_sources `decort_kvmvmv`, `decort_kvmvmv_list` и `decort_kvmvmv_list_deleted` и resource `decort_kvmvmv` в cloudapi/kvmvm |
|
|
||||||
| BATF-1073 | Вычисляемые поля `security_groups` и `enable_secgroups` в блоке `interfaces` data_sources `decort_cb_kvmvmv`, `decort_cb_kvmvmv_list` и `decort_cb_kvmvmv_list_deleted` и resource `decort_cb_kvmvmv` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1073 | Опциональный блок `security_groups` в resource `decort_kvmvmv` в cloudapi/kvmvm и resource `decort_cb_kvmvmv` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1078 | Опциональное поле `enabled` в блоке `network` в resources `decort_kvmvm` в cloudapi/kvmvm и `decort_cb_kvmvm` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1079 | Вычисляемое поле `to_clean` в resources `decort_kvmvm` в cloudapi/kvmvm и `decort_cb_kvmvm` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1083 | Опциональное поле `os_version` в resources `decort_kvmvm` в cloudapi/kvmvm и `decort_cb_kvmvm` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1083 | Вычисляемое поле `os_version` в datasources `decort_kvmvmv`, `decort_kvmvm_list`, `decort_kvmvm_list_deleted` в cloudapi/kvmvm и `decort_cb_kvmvm`, `decort_cb_kvmvm_list`, `decort_cb_kvmvm_list_deleted` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1098 | Вычисляемое поле `boot_image_id` в resources `decort_kvmvm` в cloudapi/kvmvm и `decort_cb_kvmvm` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1098 | Вычисляемое поле `boot_image_id` в datasources `decort_kvmvmv`, `decort_kvmvm_list`, `decort_kvmvm_list_deleted` в cloudapi/kvmvm и `decort_cb_kvmvm`, `decort_cb_kvmvm_list`, `decort_cb_kvmvm_list_deleted` в cloudbroker/kvmvm |
|
|
||||||
| BATF-1088 | Вызов метода `Start` перед методом `pinToStack` в cloudapi/kvmvm |
|
|
||||||
| BATF-1128 | Перезагрузка виртуальной машины при изменении полей "hot_resize", "cpu" в resources `decort_kvmvm` и `decort_cb_kvmvm` в cloudapi/kvmvm и в cloudbroker/kvmvm |
|
|
||||||
|
|
||||||
#### lb
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1075 | Опциональное поле `zone_id` в datasource `decort_lb_list` в cloudapi/lb и в datasource `decort_cb_lb_list` в cloudbroker/lb |
|
|
||||||
|
|
||||||
#### logical ports
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1114 | Datasources `decort_sdn_logical_port`, `decort_sdn_logical_port_get_by_unique_identifier` и `decort_sdn_logical_port_list` и resource `decort_sdn_logical_port` в sdn/logicalports |
|
|
||||||
|
|
||||||
#### node
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1081 | Вычисляемое поле `vcpu` в блоке `free` в datasource `decort_cb_node` в cloudbroker/node |
|
|
||||||
|
|
||||||
#### rg
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1062 | Опциональное поле `storage_policy` в resources `decort_resgroup` в cloudapi/rg и в `decort_cb_rg` в cloudbroker/rg |
|
|
||||||
| BATF-1062 | Вычисляемое поле `storage_policy_ids` в resources `decort_resgroup` в cloudapi/rg и в `decort_cb_rg` в cloudbroker/rg|
|
|
||||||
| BATF-1062 | Вычисляемое поле `storage_policy_ids` datasources в cloudapi/rg и в cloudbroker/rg |
|
|
||||||
|
|
||||||
#### security group
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1071 | Datasources `decort_security_group` и `decort_security_group_list` в cloudapi/secgroup и datasources `decort_cb_security_group` и `decort_cb_security_group_list` в cloudbroker/secgroup |
|
|
||||||
| BATF-1072 | Resources `decort_security_group` в cloudapi/secgroup и `decort_cb_security_group` в cloudbroker/secgroup |
|
|
||||||
|
|
||||||
#### sdn segment
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1120 | Resource `decort_sdn_segment` и datasources `decort_sdn_segment`, `decort_sdn_segment_get_status` и `decort_sdn_segment_list` в sdn/segments |
|
|
||||||
|
|
||||||
#### storage policy
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1058 | Datasources `decort_storage_policy` и `decort_storage_policy_list` в cloudapi/storage_policy и datasources `decort_cb_storage_policy` и `decort_cb_storage_policy_list` в cloudbroker/storage_policy |
|
|
||||||
| BATF-1059 | Resource `decort_cb_storage_policy` в cloudbroker/storage_policy |
|
|
||||||
|
|
||||||
#### vins
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1048 | Вычисляемое поле `routes` в блоках `NAT` и `GW` в datasource `decort_vins`, resource `decort_vins` в cloudapi/vins, datasource `decort_cb_vins`, resource `decort_cb_vins` в cloudbroker/vins |
|
|
||||||
| BATF-1074 | Опциональное поле `enable_secgroups` в resource `decort_cb_vins` в cloudbroker/vins |
|
|
||||||
| BATF-1094 | Вычисляемое поле `zone_id` в блоках `DHCP`, `GW`, `NAT` и `VNFDev` и вычисляемые поля `security_groups` и `enable_secgroups` в блоке `VNFInterface` в datasource `decort_vins` и в resource `decort_vins` в cloudapi/vins и в datasource `decort_cb_vins` и в resource `decort_cb_vins` в cloudbroker/vins |
|
|
||||||
| BATF-1075 | Опциональное поле `zone_id` в datasource `decort_vins_list` в cloudapi/vins и в datasource `decort_cb_vins_list` в cloudbroker/vins |
|
|
||||||
| BATF-1104 | Вычисляемое поле `live_migration_job_id` в блоке `VNFDev` в datasource `decort_vins` и в resource `decort_vins` в cloudapi/vins и в datasource `decort_cb_vins` и в resource `decort_cb_vins` в cloudbroker/vins |
|
|
||||||
|
|
||||||
#### zone
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-1076 | Вычисляемые поля `account_ids`, `compute_ids`, `extnet_ids`, `vins_ids`, `lb_ids`, `bservice_ids` и `k8s_ids` в datasource `decort_zone` в cloudapi/zone и в datasource `decort_cb_zone` в cloudbroker/zone |
|
|
||||||
|
|
||||||
### Исправлено
|
### Исправлено
|
||||||
|
|
||||||
#### общие изменения
|
#### kvmvmm
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BATF-1116 | Исправлены уязвимости, обновлена версия go до v1.24.0 |
|
| BATF-1220 | Ошибки применения новой конфигурации после импортирования в resource `decort_kvmvm` в cloudapi/kvmvm и в `decort_cb_kvmvm` в cloudbroker/kvmvm |
|
||||||
|
|
||||||
#### account
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-894 | Исправлено отображение вычисляемого поля `zone_ids` в resource `decort_account` в cloudapi/account |
|
|
||||||
| BATF-894 | Исправлено некорректное поведение метода `resourceAccountUpdate` resource `decort_cb_account` в cloudbroker/account |
|
|
||||||
|
|
||||||
#### bservice
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1060 | Изменен тип поля `driver` с required на optional в resource `decort_bservice_group` в cloudapi/bservice |
|
|
||||||
|
|
||||||
#### extnet
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-893 | Исправлено отображение вычисляемого поля `network_ids` в datasource `decort_cb_extnet_list` в cloudbroker/extnet |
|
|
||||||
| BATF-972 | Возможность изменения поля `mtu` в resource `decort_cb_extnet` в cloudbroker/extnet |
|
|
||||||
|
|
||||||
#### image
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1005 | Опциональный `account_id` теперь может быть использован при создании resource `decort_cb_virtual_image` в cloudbroker/image |
|
|
||||||
| BATF-1007 | Изменен тип поля `drivers` с required на computed в resources `decort_image`, `decort_image_from_platform_disk` в cloudapi/image и в `decort_cb_image`, `decort_cb_image_from_platform_disk`, `decort_cb_cdrom_image` в cloudbroker/image |
|
|
||||||
|
|
||||||
#### kvmvm
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1049 | Перезагрузка виртуальной машины при изменении полей `ram` и `cpu` в resources `decort_kvmvm` и `decort_cb_kvmvm` в cloudapi/kvmvm и в cloudbroker/kvmvm |
|
|
||||||
| BATF-1122 | Перезагрузка виртуальной машины при изменении поля "disks" в resources `decort_kvmvm` и `decort_cb_kvmvm` в cloudapi/kvmvm и в cloudbroker/kvmvm |
|
|
||||||
| BATF-888 | Исправлено получение вычисляемого поля `zone_ids` в datasources `decort_kvmvm_list` и `decort_kvmvm_list_deleted` в cloudapi/kvmvm |
|
|
||||||
|
|
||||||
#### trunk
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1012 | Изменен тип поля `status` с computed на optional в datasource `decort_trunk_list` в cloudapi/trunk и в datasource `decort_cb_trunk_list` в cloudbroker/trunk |
|
|
||||||
|
|
||||||
#### zone
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-887 | Исправлена ошибка при изменении поля `name` в resource `decort_cb_zone` в cloudbroker/zone |
|
|
||||||
|
|
||||||
|
|
||||||
### Удалено
|
|
||||||
|
|
||||||
#### account
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1086 | Вычисляемые поля `ckey`, `meta` и `service_account` в datasource `decort_account` в cloudapi/account и в datasources `decort_cb_account`, `decort_cb_account_list` и `decort_cb_account_list_deleted` в cloudbroker/account |
|
|
||||||
| BATF-1086 | Вычисляемые поля `ckey`, `meta` и `service_account` в resource `decort_account` в cloudapi/account и в resource `decort_cb_account` в cloudbroker/account |
|
|
||||||
|
|
||||||
#### audit
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1095 | Поле `tags` в datasource `decort_cb_audit_list` в cloudbroker/audit |
|
|
||||||
|
|
||||||
#### disks
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1096 | Опциональное поле `iops` в resource `decort_cb_disk` в cloudbroker/disks |
|
|
||||||
| BATF-1089 | Опциональное поле `storage_policy_id` в datasources `decort_disk_list`, `decort_disk_list_unattached` в cloudapi/disks и `decort_cb_disk_list`, `decort_cb_disk_list_unattached` в cloudbroker/disks |
|
|
||||||
|
|
||||||
#### image
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1084 | Поле `enabled_stacks` в resources `decort_cb_cdrom_image`, `decort_cb_image_from_blank_compute`, `decort_cb_image_from_platform_disk`, `decort_cb_image` в cloudbroker/image |
|
|
||||||
|
|
||||||
#### k8ci
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1007 | Поля `worker_driver`, `master_driver` в resource `decort_cb_k8ci` и datasources `decort_cb_k8ci_list`, `decort_cb_k8ci_list_deleted` в cloudbroker/k8ci |
|
|
||||||
|
|
||||||
#### kvmvm
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BATF-1091 | Опциональное поле `image_id` в datasources `decort_cb_kvmvm_list` в cloudbroker/kvmvm |
|
|
||||||
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.10.1
|
VERSION=4.10.4
|
||||||
OS_ARCH=$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH)
|
OS_ARCH=$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH)
|
||||||
|
|
||||||
FILES = ${BINARY}_${VERSION}_darwin_amd64\
|
FILES = ${BINARY}_${VERSION}_darwin_amd64\
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ description: |-
|
|||||||
- `image_name` (String)
|
- `image_name` (String)
|
||||||
- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
|
- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
|
||||||
- `live_migration_job_id` (Number)
|
- `live_migration_job_id` (Number)
|
||||||
|
- `loader_meta_iso` (List of Object) (see [below for nested schema](#nestedatt--loader_meta_iso))
|
||||||
- `loader_type` (String)
|
- `loader_type` (String)
|
||||||
- `lock_status` (String)
|
- `lock_status` (String)
|
||||||
- `manager_id` (Number)
|
- `manager_id` (Number)
|
||||||
@@ -170,10 +171,13 @@ Read-Only:
|
|||||||
- `boot_partition` (Number)
|
- `boot_partition` (Number)
|
||||||
- `bus_number` (Number)
|
- `bus_number` (Number)
|
||||||
- `ckey` (String)
|
- `ckey` (String)
|
||||||
|
- `created_by` (String)
|
||||||
- `created_time` (Number)
|
- `created_time` (Number)
|
||||||
|
- `deleted_by` (String)
|
||||||
- `deleted_time` (Number)
|
- `deleted_time` (Number)
|
||||||
- `desc` (String)
|
- `desc` (String)
|
||||||
- `destruction_time` (Number)
|
- `destruction_time` (Number)
|
||||||
|
- `devicename` (String)
|
||||||
- `disk_id` (Number)
|
- `disk_id` (Number)
|
||||||
- `disk_path` (String)
|
- `disk_path` (String)
|
||||||
- `gid` (Number)
|
- `gid` (Number)
|
||||||
@@ -211,6 +215,7 @@ Read-Only:
|
|||||||
- `tech_status` (String)
|
- `tech_status` (String)
|
||||||
- `to_clean` (Boolean)
|
- `to_clean` (Boolean)
|
||||||
- `type` (String)
|
- `type` (String)
|
||||||
|
- `updated_time` (Number)
|
||||||
|
|
||||||
<a id="nestedobjatt--disks--iotune"></a>
|
<a id="nestedobjatt--disks--iotune"></a>
|
||||||
### Nested Schema for `disks.iotune`
|
### Nested Schema for `disks.iotune`
|
||||||
@@ -317,6 +322,15 @@ Read-Only:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a id="nestedatt--loader_meta_iso"></a>
|
||||||
|
### Nested Schema for `loader_meta_iso`
|
||||||
|
|
||||||
|
Read-Only:
|
||||||
|
|
||||||
|
- `device_name` (String)
|
||||||
|
- `path` (String)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--os_users"></a>
|
<a id="nestedatt--os_users"></a>
|
||||||
### Nested Schema for `os_users`
|
### Nested Schema for `os_users`
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ Read-Only:
|
|||||||
- `resource_limits` (List of Object) (see [below for nested schema](#nestedobjatt--items--resource_limits))
|
- `resource_limits` (List of Object) (see [below for nested schema](#nestedobjatt--items--resource_limits))
|
||||||
- `resource_types` (List of String)
|
- `resource_types` (List of String)
|
||||||
- `rg_id` (Number)
|
- `rg_id` (Number)
|
||||||
|
- `sdn_access_group_id` (String)
|
||||||
- `secret` (String)
|
- `secret` (String)
|
||||||
- `status` (String)
|
- `status` (String)
|
||||||
- `storage_policy_ids` (List of Number)
|
- `storage_policy_ids` (List of Number)
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ Read-Only:
|
|||||||
|
|
||||||
- `pool_names` (List of String)
|
- `pool_names` (List of String)
|
||||||
- `sep_id` (Number)
|
- `sep_id` (Number)
|
||||||
|
- `sep_name` (String)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedobjatt--items--usage"></a>
|
<a id="nestedobjatt--items--usage"></a>
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ description: |-
|
|||||||
- `image_id` (Number)
|
- `image_id` (Number)
|
||||||
- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
|
- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
|
||||||
- `live_migration_job_id` (Number)
|
- `live_migration_job_id` (Number)
|
||||||
|
- `loader_meta_iso` (List of Object) (see [below for nested schema](#nestedatt--loader_meta_iso))
|
||||||
- `loader_type` (String)
|
- `loader_type` (String)
|
||||||
- `lock_status` (String)
|
- `lock_status` (String)
|
||||||
- `manager_id` (Number)
|
- `manager_id` (Number)
|
||||||
@@ -201,10 +202,13 @@ Read-Only:
|
|||||||
- `acl` (String)
|
- `acl` (String)
|
||||||
- `boot_partition` (Number)
|
- `boot_partition` (Number)
|
||||||
- `bus_number` (Number)
|
- `bus_number` (Number)
|
||||||
|
- `created_by` (String)
|
||||||
- `created_time` (Number)
|
- `created_time` (Number)
|
||||||
|
- `deleted_by` (String)
|
||||||
- `deleted_time` (Number)
|
- `deleted_time` (Number)
|
||||||
- `description` (String)
|
- `description` (String)
|
||||||
- `destruction_time` (Number)
|
- `destruction_time` (Number)
|
||||||
|
- `devicename` (String)
|
||||||
- `disk_id` (Number)
|
- `disk_id` (Number)
|
||||||
- `disk_path` (String)
|
- `disk_path` (String)
|
||||||
- `gid` (Number)
|
- `gid` (Number)
|
||||||
@@ -239,6 +243,7 @@ Read-Only:
|
|||||||
- `tech_status` (String)
|
- `tech_status` (String)
|
||||||
- `to_clean` (Boolean)
|
- `to_clean` (Boolean)
|
||||||
- `type` (String)
|
- `type` (String)
|
||||||
|
- `updated_time` (Number)
|
||||||
|
|
||||||
<a id="nestedobjatt--disks--iotune"></a>
|
<a id="nestedobjatt--disks--iotune"></a>
|
||||||
### Nested Schema for `disks.iotune`
|
### Nested Schema for `disks.iotune`
|
||||||
@@ -346,6 +351,15 @@ Read-Only:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a id="nestedatt--loader_meta_iso"></a>
|
||||||
|
### Nested Schema for `loader_meta_iso`
|
||||||
|
|
||||||
|
Read-Only:
|
||||||
|
|
||||||
|
- `device_name` (String)
|
||||||
|
- `path` (String)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--os_users"></a>
|
<a id="nestedatt--os_users"></a>
|
||||||
### Nested Schema for `os_users`
|
### Nested Schema for `os_users`
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ Read-Only:
|
|||||||
- `resource_limits` (List of Object) (see [below for nested schema](#nestedobjatt--items--resource_limits))
|
- `resource_limits` (List of Object) (see [below for nested schema](#nestedobjatt--items--resource_limits))
|
||||||
- `resource_types` (List of String)
|
- `resource_types` (List of String)
|
||||||
- `rg_id` (Number)
|
- `rg_id` (Number)
|
||||||
|
- `sdn_access_group_id` (String)
|
||||||
- `secret` (String)
|
- `secret` (String)
|
||||||
- `status` (String)
|
- `status` (String)
|
||||||
- `storage_policy_ids` (List of Number)
|
- `storage_policy_ids` (List of Number)
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ Read-Only:
|
|||||||
|
|
||||||
- `pool_names` (List of String)
|
- `pool_names` (List of String)
|
||||||
- `sep_id` (Number)
|
- `sep_id` (Number)
|
||||||
|
- `sep_name` (String)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedobjatt--items--usage"></a>
|
<a id="nestedobjatt--items--usage"></a>
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ description: |-
|
|||||||
- `id` (String) The ID of this resource.
|
- `id` (String) The ID of this resource.
|
||||||
- `image_name` (String)
|
- `image_name` (String)
|
||||||
- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
|
- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
|
||||||
|
- `loader_meta_iso` (List of Object) (see [below for nested schema](#nestedatt--loader_meta_iso))
|
||||||
- `lock_status` (String)
|
- `lock_status` (String)
|
||||||
- `manager_id` (Number)
|
- `manager_id` (Number)
|
||||||
- `manager_type` (String)
|
- `manager_type` (String)
|
||||||
@@ -196,12 +197,18 @@ Optional:
|
|||||||
|
|
||||||
Read-Only:
|
Read-Only:
|
||||||
|
|
||||||
|
- `create_by` (String)
|
||||||
|
- `create_time` (Number)
|
||||||
|
- `delete_by` (String)
|
||||||
|
- `delete_time` (Number)
|
||||||
|
- `devicename` (String)
|
||||||
- `disk_id` (Number) Disk ID
|
- `disk_id` (Number) Disk ID
|
||||||
- `present_to` (Map of Number)
|
- `present_to` (Map of Number)
|
||||||
- `shareable` (Boolean)
|
- `shareable` (Boolean)
|
||||||
- `size_max` (Number)
|
- `size_max` (Number)
|
||||||
- `size_used` (Number)
|
- `size_used` (Number)
|
||||||
- `to_clean` (Boolean)
|
- `to_clean` (Boolean)
|
||||||
|
- `update_time` (Number)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedblock--libvirt_settings"></a>
|
<a id="nestedblock--libvirt_settings"></a>
|
||||||
@@ -389,6 +396,15 @@ Read-Only:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a id="nestedatt--loader_meta_iso"></a>
|
||||||
|
### Nested Schema for `loader_meta_iso`
|
||||||
|
|
||||||
|
Read-Only:
|
||||||
|
|
||||||
|
- `device_name` (String)
|
||||||
|
- `path` (String)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--os_users"></a>
|
<a id="nestedatt--os_users"></a>
|
||||||
### Nested Schema for `os_users`
|
### Nested Schema for `os_users`
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ description: |-
|
|||||||
- `guid` (Number)
|
- `guid` (Number)
|
||||||
- `id` (String) The ID of this resource.
|
- `id` (String) The ID of this resource.
|
||||||
- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
|
- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
|
||||||
|
- `loader_meta_iso` (List of Object) (see [below for nested schema](#nestedatt--loader_meta_iso))
|
||||||
- `lock_status` (String)
|
- `lock_status` (String)
|
||||||
- `manager_id` (Number)
|
- `manager_id` (Number)
|
||||||
- `manager_type` (String)
|
- `manager_type` (String)
|
||||||
@@ -189,12 +190,18 @@ Optional:
|
|||||||
|
|
||||||
Read-Only:
|
Read-Only:
|
||||||
|
|
||||||
|
- `created_by` (String)
|
||||||
|
- `created_time` (Number)
|
||||||
|
- `deleted_by` (String)
|
||||||
|
- `deleted_time` (Number)
|
||||||
|
- `devicename` (String)
|
||||||
- `disk_id` (Number) Disk ID
|
- `disk_id` (Number) Disk ID
|
||||||
- `present_to` (Map of Number)
|
- `present_to` (Map of Number)
|
||||||
- `shareable` (Boolean)
|
- `shareable` (Boolean)
|
||||||
- `size_max` (Number)
|
- `size_max` (Number)
|
||||||
- `size_used` (Number)
|
- `size_used` (Number)
|
||||||
- `to_clean` (Boolean)
|
- `to_clean` (Boolean)
|
||||||
|
- `updated_time` (Number)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedblock--network"></a>
|
<a id="nestedblock--network"></a>
|
||||||
@@ -294,7 +301,12 @@ Required:
|
|||||||
|
|
||||||
Read-Only:
|
Read-Only:
|
||||||
|
|
||||||
|
- `created_by` (String)
|
||||||
|
- `created_time` (Number)
|
||||||
|
- `deleted_by` (String)
|
||||||
|
- `deleted_time` (Number)
|
||||||
- `desc` (String)
|
- `desc` (String)
|
||||||
|
- `devicename` (String)
|
||||||
- `disk_id` (Number)
|
- `disk_id` (Number)
|
||||||
- `disk_name` (String)
|
- `disk_name` (String)
|
||||||
- `disk_type` (String)
|
- `disk_type` (String)
|
||||||
@@ -309,6 +321,7 @@ Read-Only:
|
|||||||
- `size_used` (Number)
|
- `size_used` (Number)
|
||||||
- `storage_policy_id` (Number)
|
- `storage_policy_id` (Number)
|
||||||
- `to_clean` (Boolean)
|
- `to_clean` (Boolean)
|
||||||
|
- `updated_time` (Number)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--interfaces"></a>
|
<a id="nestedatt--interfaces"></a>
|
||||||
@@ -369,6 +382,15 @@ Read-Only:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a id="nestedatt--loader_meta_iso"></a>
|
||||||
|
### Nested Schema for `loader_meta_iso`
|
||||||
|
|
||||||
|
Read-Only:
|
||||||
|
|
||||||
|
- `device_name` (String)
|
||||||
|
- `path` (String)
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--os_users"></a>
|
<a id="nestedatt--os_users"></a>
|
||||||
### Nested Schema for `os_users`
|
### Nested Schema for `os_users`
|
||||||
|
|
||||||
|
|||||||
421
internal/service/cloudapi/disks/old_schemas.go
Normal file
421
internal/service/cloudapi/disks/old_schemas.go
Normal file
@@ -0,0 +1,421 @@
|
|||||||
|
package disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||||
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
|
||||||
|
)
|
||||||
|
|
||||||
|
func resourceDiskV1() *schema.Resource {
|
||||||
|
return &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"account_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
//ForceNew: true,
|
||||||
|
Description: "The unique ID of the subscriber-owner of the disk",
|
||||||
|
},
|
||||||
|
"disk_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
Description: "Name of disk",
|
||||||
|
},
|
||||||
|
"size_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
Description: "Size in GB",
|
||||||
|
},
|
||||||
|
"gid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
//ForceNew: true,
|
||||||
|
Description: "ID of the grid (platform)",
|
||||||
|
},
|
||||||
|
"pool": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Pool for disk location",
|
||||||
|
},
|
||||||
|
"sep_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Storage endpoint provider ID to create disk",
|
||||||
|
},
|
||||||
|
"desc": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Description of disk",
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"D", "B", "T"}, false),
|
||||||
|
Description: "The type of disk in terms of its role in compute: 'B=Boot, D=Data, T=Temp'",
|
||||||
|
},
|
||||||
|
"detach": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Default: false,
|
||||||
|
Description: "Detaching the disk from compute",
|
||||||
|
},
|
||||||
|
"permanently": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Default: false,
|
||||||
|
Description: "Whether to completely delete the disk, works only with non attached disks",
|
||||||
|
},
|
||||||
|
"shareable": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"iotune": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Optional: true,
|
||||||
|
MaxItems: 1,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"read_bytes_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Number of bytes to read per second",
|
||||||
|
},
|
||||||
|
"read_bytes_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Maximum number of bytes to read",
|
||||||
|
},
|
||||||
|
"read_iops_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Number of io read operations per second",
|
||||||
|
},
|
||||||
|
"read_iops_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Maximum number of io read operations",
|
||||||
|
},
|
||||||
|
"size_iops_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Size of io operations",
|
||||||
|
},
|
||||||
|
"total_bytes_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Total size bytes per second",
|
||||||
|
},
|
||||||
|
"total_bytes_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Maximum total size of bytes per second",
|
||||||
|
},
|
||||||
|
"total_iops_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Total number of io operations per second",
|
||||||
|
},
|
||||||
|
"total_iops_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Maximum total number of io operations per second",
|
||||||
|
},
|
||||||
|
"write_bytes_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Number of bytes to write per second",
|
||||||
|
},
|
||||||
|
"write_bytes_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Maximum number of bytes to write per second",
|
||||||
|
},
|
||||||
|
"write_iops_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Number of write operations per second",
|
||||||
|
},
|
||||||
|
"write_iops_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Maximum number of write operations per second",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"present_to": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"disk_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Disk ID. Duplicates the value of the ID parameter",
|
||||||
|
},
|
||||||
|
"account_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "The name of the subscriber '(account') to whom this disk belongs",
|
||||||
|
},
|
||||||
|
"acl": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
// "boot_partition": {
|
||||||
|
// Type: schema.TypeInt,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Number of disk partitions",
|
||||||
|
// },
|
||||||
|
"computes": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"compute_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"compute_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"created_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Created time",
|
||||||
|
},
|
||||||
|
"deleted_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Deleted time",
|
||||||
|
},
|
||||||
|
"destruction_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Time of final deletion",
|
||||||
|
},
|
||||||
|
"devicename": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Name of the device",
|
||||||
|
},
|
||||||
|
// "disk_path": {
|
||||||
|
// Type: schema.TypeString,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Disk path",
|
||||||
|
// },
|
||||||
|
// "guid": {
|
||||||
|
// Type: schema.TypeInt,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Disk ID on the storage side",
|
||||||
|
// },
|
||||||
|
"image_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Image ID",
|
||||||
|
},
|
||||||
|
"images": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
},
|
||||||
|
Description: "IDs of images using the disk",
|
||||||
|
},
|
||||||
|
// "iqn": {
|
||||||
|
// Type: schema.TypeString,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Disk IQN",
|
||||||
|
// },
|
||||||
|
// "login": {
|
||||||
|
// Type: schema.TypeString,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Login to access the disk",
|
||||||
|
// },
|
||||||
|
// "milestones": {
|
||||||
|
// Type: schema.TypeInt,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Milestones",
|
||||||
|
// },
|
||||||
|
"order": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Disk order",
|
||||||
|
},
|
||||||
|
"params": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Disk params",
|
||||||
|
},
|
||||||
|
"parent_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "ID of the parent disk",
|
||||||
|
},
|
||||||
|
// "passwd": {
|
||||||
|
// Type: schema.TypeString,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Password to access the disk",
|
||||||
|
// },
|
||||||
|
"pci_slot": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "ID of the pci slot to which the disk is connected",
|
||||||
|
},
|
||||||
|
// "purge_attempts": {
|
||||||
|
// Type: schema.TypeInt,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Number of deletion attempts",
|
||||||
|
// },
|
||||||
|
"purge_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Time of the last deletion attempt",
|
||||||
|
},
|
||||||
|
"replication": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"disk_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"pool_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"self_volume_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"storage_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"volume_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Description: "Replication status",
|
||||||
|
},
|
||||||
|
// "reality_device_number": {
|
||||||
|
// Type: schema.TypeInt,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "Reality device number",
|
||||||
|
// },
|
||||||
|
// "reference_id": {
|
||||||
|
// Type: schema.TypeString,
|
||||||
|
// Computed: true,
|
||||||
|
// Description: "ID of the reference to the disk",
|
||||||
|
// },
|
||||||
|
"res_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Resource ID",
|
||||||
|
},
|
||||||
|
"res_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Name of the resource",
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Disk role",
|
||||||
|
},
|
||||||
|
"sep_type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Type SEP. Defines the type of storage system and contains one of the values set in the cloud platform",
|
||||||
|
},
|
||||||
|
"size_used": {
|
||||||
|
Type: schema.TypeFloat,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Number of used space, in GB",
|
||||||
|
},
|
||||||
|
"snapshots": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "ID of the snapshot",
|
||||||
|
},
|
||||||
|
"label": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Name of the snapshot",
|
||||||
|
},
|
||||||
|
"res_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Reference to the snapshot",
|
||||||
|
},
|
||||||
|
"snap_set_guid": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "The set snapshot ID",
|
||||||
|
},
|
||||||
|
"snap_set_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "The set time of the snapshot",
|
||||||
|
},
|
||||||
|
"timestamp": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Snapshot time",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Disk status",
|
||||||
|
},
|
||||||
|
"tech_status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Technical status of the disk",
|
||||||
|
},
|
||||||
|
"vmid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Virtual Machine ID (Deprecated)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -805,7 +805,7 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
|
|||||||
|
|
||||||
func ResourceDisk() *schema.Resource {
|
func ResourceDisk() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceDiskCreate,
|
CreateContext: resourceDiskCreate,
|
||||||
ReadContext: resourceDiskRead,
|
ReadContext: resourceDiskRead,
|
||||||
@@ -825,5 +825,12 @@ func ResourceDisk() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceDiskSchemaMake(),
|
Schema: resourceDiskSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceDiskV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourceDiskUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
internal/service/cloudapi/disks/state_upgraders.go
Normal file
14
internal/service/cloudapi/disks/state_upgraders.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
func resourceDiskUpgradeV1(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
|
||||||
|
log.Debug("resourceDiskUpgradeV1: upgrading state")
|
||||||
|
rawState["present_to"] = make(map[string]uint64)
|
||||||
|
|
||||||
|
return rawState, nil
|
||||||
|
}
|
||||||
782
internal/service/cloudapi/image/old_schemas.go
Normal file
782
internal/service/cloudapi/image/old_schemas.go
Normal file
@@ -0,0 +1,782 @@
|
|||||||
|
package image
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||||
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
|
||||||
|
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/statefuncs"
|
||||||
|
)
|
||||||
|
|
||||||
|
func resourceImageFromBlankComputeSchemaV1() *schema.Resource {
|
||||||
|
return &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"compute_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
Description: "Compute Id",
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
Description: "Name of the rescue disk",
|
||||||
|
},
|
||||||
|
"boot_type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"bios", "uefi"}, true),
|
||||||
|
Description: "Boot type of image BIOS or UEFI",
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "other"}, true),
|
||||||
|
Description: "Image type linux, windows or other",
|
||||||
|
},
|
||||||
|
|
||||||
|
"username": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Optional username for the image",
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Optional password for the image",
|
||||||
|
},
|
||||||
|
"account_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "AccountId to make the image exclusive",
|
||||||
|
},
|
||||||
|
"sep_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "storage endpoint provider ID",
|
||||||
|
},
|
||||||
|
"pool_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "pool for image create",
|
||||||
|
},
|
||||||
|
"hot_resize": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Does this machine supports hot resize",
|
||||||
|
},
|
||||||
|
"async_mode": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Default: false,
|
||||||
|
Description: "create an image in async/sync mode",
|
||||||
|
},
|
||||||
|
|
||||||
|
"image_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"unc_path": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"ckey": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"acl": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"architecture": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"bootable": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"compute_ci_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"cd_presented_to": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"deleted_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"desc": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"drivers": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"gid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"history": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"timestamp": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"last_modified": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"link_to": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"milestones": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"image_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"network_interface_naming": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"provider_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"purge_attempts": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"present_to": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"res_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"rescuecd": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"shared_with": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"size": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"tech_status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func resourceImageFromBlankDiskSchemaV1() *schema.Resource {
|
||||||
|
return &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"disk_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
Description: "Disk Id",
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
Description: "Name of the rescue disk",
|
||||||
|
},
|
||||||
|
"boot_type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"bios", "uefi"}, true),
|
||||||
|
Description: "Boot type of image BIOS or UEFI",
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "other"}, true),
|
||||||
|
Description: "Image type linux, windows or other",
|
||||||
|
},
|
||||||
|
"architecture": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"X86_64"}, true),
|
||||||
|
Description: "binary architecture of this image, one of X86_64",
|
||||||
|
},
|
||||||
|
|
||||||
|
"username": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Optional username for the image",
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Optional password for the image",
|
||||||
|
},
|
||||||
|
"account_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "AccountId to make the image exclusive",
|
||||||
|
},
|
||||||
|
"sep_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "storage endpoint provider ID",
|
||||||
|
},
|
||||||
|
"pool_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "pool for image create",
|
||||||
|
},
|
||||||
|
"drivers": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Required: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
StateFunc: statefuncs.StateFuncToUpper,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"SVA_KVM_X86", "KVM_X86"}, false), // observe case while validating
|
||||||
|
Type: schema.TypeString,
|
||||||
|
},
|
||||||
|
Description: "List of types of compute suitable for image. Example: [ \"KVM_X86\" ]",
|
||||||
|
},
|
||||||
|
"bootable": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Default: true,
|
||||||
|
Description: "bootable image",
|
||||||
|
},
|
||||||
|
"hot_resize": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Does this machine supports hot resize",
|
||||||
|
},
|
||||||
|
"async_mode": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Default: false,
|
||||||
|
Description: "create an image in async/sync mode",
|
||||||
|
},
|
||||||
|
|
||||||
|
"image_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"unc_path": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"ckey": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"acl": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"compute_ci_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"cd_presented_to": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"deleted_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"desc": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"gid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"history": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"timestamp": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"last_modified": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"link_to": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"milestones": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"image_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"network_interface_naming": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"provider_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"purge_attempts": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"present_to": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"res_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"rescuecd": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"shared_with": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"size": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"tech_status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func dataSourceImageExtendSchemaV1() map[string]*schema.Schema {
|
||||||
|
return map[string]*schema.Schema{
|
||||||
|
"image_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
},
|
||||||
|
"show_all": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Default: false,
|
||||||
|
Optional: true,
|
||||||
|
},
|
||||||
|
"unc_path": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"ckey": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"account_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"acl": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"architecture": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"boot_type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"bootable": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"compute_ci_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"cd_presented_to": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"deleted_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"desc": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"drivers": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"gid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"history": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"timestamp": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"hot_resize": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"last_modified": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"link_to": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"milestones": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"image_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"network_interface_naming": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"pool_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"provider_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"purge_attempts": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"present_to": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"res_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"rescuecd": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"sep_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"shared_with": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"size": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"tech_status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func resourceMainImageSchemaV1(sch map[string]*schema.Schema) map[string]*schema.Schema {
|
||||||
|
delete(sch, "show_all")
|
||||||
|
sch["name"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
Description: "Name of the rescue disk",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["url"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
Description: "URL where to download media from",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["image_id"] = &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "image id",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["boot_type"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"bios", "uefi"}, true),
|
||||||
|
Description: "Boot type of image bios or uefi",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["type"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "other"}, true),
|
||||||
|
Description: "Image type linux, windows or other",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["hot_resize"] = &schema.Schema{
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Does this machine supports hot resize",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["username"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Optional username for the image",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["password"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Optional password for the image",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["account_id"] = &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
Description: "AccountId to make the image exclusive",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["username_dl"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Description: "username for upload binary media",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["password_dl"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Description: "password for upload binary media",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["pool_name"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "pool for image create",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["sep_id"] = &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
Description: "storage endpoint provider ID",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["architecture"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"X86_64"}, true),
|
||||||
|
Description: "binary architecture of this image, one of X86_64",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["drivers"] = &schema.Schema{
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Required: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["network_interface_naming"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"eth", "ens"}, true),
|
||||||
|
Description: "select a network interface naming pattern for your Linux machine. eth - onboard, ens - pci slot naming",
|
||||||
|
}
|
||||||
|
|
||||||
|
return sch
|
||||||
|
}
|
||||||
|
|
||||||
|
func resourceImageSchemaV1() *schema.Resource {
|
||||||
|
return &schema.Resource{Schema: resourceMainImageSchemaV1(dataSourceImageExtendSchemaV1())}
|
||||||
|
}
|
||||||
|
|
||||||
|
func resourceMainImageVirtualSchemaV1(sch map[string]*schema.Schema) map[string]*schema.Schema {
|
||||||
|
delete(sch, "show_all")
|
||||||
|
sch["name"] = &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
Description: "Name of the rescue disk",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["link_to"] = &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
Description: "ID of real image to link this virtual image to upon creation",
|
||||||
|
}
|
||||||
|
|
||||||
|
sch["image_id"] = &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
Description: "Image id",
|
||||||
|
}
|
||||||
|
|
||||||
|
return sch
|
||||||
|
}
|
||||||
|
|
||||||
|
func resourceImageVirtualSchemaV1() *schema.Resource {
|
||||||
|
return &schema.Resource{Schema: resourceMainImageVirtualSchemaV1(dataSourceImageExtendSchemaV1())}
|
||||||
|
}
|
||||||
@@ -272,7 +272,7 @@ func resourceImageUpdate(ctx context.Context, d *schema.ResourceData, m interfac
|
|||||||
|
|
||||||
func ResourceImage() *schema.Resource {
|
func ResourceImage() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceImageCreate,
|
CreateContext: resourceImageCreate,
|
||||||
ReadContext: resourceImageRead,
|
ReadContext: resourceImageRead,
|
||||||
@@ -292,5 +292,12 @@ func ResourceImage() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceImageSchemaMake(dataSourceImageExtendSchemaMake()),
|
Schema: resourceImageSchemaMake(dataSourceImageExtendSchemaMake()),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceImageSchemaV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentToUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ func resourceImageFromBlankComputeUpdate(ctx context.Context, d *schema.Resource
|
|||||||
|
|
||||||
func ResourceImageFromBlankCompute() *schema.Resource {
|
func ResourceImageFromBlankCompute() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceImageFromBlankComputeCreate,
|
CreateContext: resourceImageFromBlankComputeCreate,
|
||||||
ReadContext: resourceImageFromBlankComputeRead,
|
ReadContext: resourceImageFromBlankComputeRead,
|
||||||
@@ -275,6 +275,13 @@ func ResourceImageFromBlankCompute() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceImageFromBlankComputeSchemaMake(),
|
Schema: resourceImageFromBlankComputeSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceImageFromBlankComputeSchemaV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentToUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ func resourceImageFromPlatformDiskUpdate(ctx context.Context, d *schema.Resource
|
|||||||
|
|
||||||
func ResourceImageFromPlatformDisk() *schema.Resource {
|
func ResourceImageFromPlatformDisk() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceImageFromPlatformDiskCreate,
|
CreateContext: resourceImageFromPlatformDiskCreate,
|
||||||
ReadContext: resourceImageFromPlatformDiskRead,
|
ReadContext: resourceImageFromPlatformDiskRead,
|
||||||
@@ -258,6 +258,13 @@ func ResourceImageFromPlatformDisk() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceImageFromPlatformDiskSchemaMake(),
|
Schema: resourceImageFromPlatformDiskSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceImageFromBlankDiskSchemaV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentToUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ func resourceImageVirtualLink(ctx context.Context, d *schema.ResourceData, m int
|
|||||||
|
|
||||||
func ResourceImageVirtual() *schema.Resource {
|
func ResourceImageVirtual() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceImageVirtualCreate,
|
CreateContext: resourceImageVirtualCreate,
|
||||||
ReadContext: resourceImageRead,
|
ReadContext: resourceImageRead,
|
||||||
@@ -128,5 +128,12 @@ func ResourceImageVirtual() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceImageVirtualSchemaMake(dataSourceImageExtendSchemaMake()),
|
Schema: resourceImageVirtualSchemaMake(dataSourceImageExtendSchemaMake()),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceImageVirtualSchemaV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentToUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
internal/service/cloudapi/image/state_upgraders.go
Normal file
14
internal/service/cloudapi/image/state_upgraders.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package image
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
func resourcePresentToUpgradeV1(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
|
||||||
|
log.Debug("resourcePresentToUpgradeV1: upgrading state")
|
||||||
|
rawState["present_to"] = make(map[string]uint64)
|
||||||
|
|
||||||
|
return rawState, nil
|
||||||
|
}
|
||||||
@@ -457,6 +457,22 @@ func computeListDisksSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"devicename": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"created_by": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"deleted_by": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"updated_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1148,6 +1164,22 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"loader_meta_iso": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"device_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
"os_version": {
|
"os_version": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|||||||
@@ -225,28 +225,28 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
|
|||||||
"numa_affinity": compute.NumaAffinity,
|
"numa_affinity": compute.NumaAffinity,
|
||||||
"numa_node_id": compute.NumaNodeId,
|
"numa_node_id": compute.NumaNodeId,
|
||||||
"os_version": compute.OSVersion,
|
"os_version": compute.OSVersion,
|
||||||
// "pinned": compute.Pinned,
|
"pinned": compute.PinnedToStack,
|
||||||
"preferred_cpu": compute.PreferredCPU,
|
"preferred_cpu": compute.PreferredCPU,
|
||||||
"qemu_guest": flattenQemuQuest(compute.QemuQuest),
|
"qemu_guest": flattenQemuQuest(compute.QemuQuest),
|
||||||
"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,
|
||||||
"reserved_node_cpus": compute.ReservedNodeCpus,
|
"reserved_node_cpus": compute.ReservedNodeCpus,
|
||||||
"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,
|
||||||
//TODO
|
//TODO
|
||||||
// "virtual_image_id": compute.VirtualImageID,
|
// "virtual_image_id": compute.VirtualImageID,
|
||||||
"loader_type": compute.LoaderType,
|
"loader_type": compute.LoaderType,
|
||||||
@@ -289,10 +289,6 @@ func flattenBootDisk(bootDisk *compute.ItemComputeDisk) []map[string]interface{}
|
|||||||
func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, extraDisks []interface{}, bootDiskId uint64) []map[string]interface{} {
|
func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, extraDisks []interface{}, bootDiskId uint64) []map[string]interface{} {
|
||||||
res := make([]map[string]interface{}, 0, len(disksList))
|
res := make([]map[string]interface{}, 0, len(disksList))
|
||||||
|
|
||||||
if len(disksBlocks) == 0 {
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Slice(disksList, func(i, j int) bool {
|
sort.Slice(disksList, func(i, j int) bool {
|
||||||
return disksList[i].ID < disksList[j].ID
|
return disksList[i].ID < disksList[j].ID
|
||||||
})
|
})
|
||||||
@@ -304,9 +300,19 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
pernamentlyValue := disksBlocks[indexDataDisks].(map[string]interface{})["permanently"].(bool)
|
var pernamentlyValue bool
|
||||||
|
if indexDataDisks < len(disksBlocks) {
|
||||||
|
if diskBlock, ok := disksBlocks[indexDataDisks].(map[string]interface{}); ok {
|
||||||
|
if perm, exists := diskBlock["permanently"]; exists {
|
||||||
|
if permBool, ok := perm.(bool); ok {
|
||||||
|
pernamentlyValue = permBool
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
temp := map[string]interface{}{
|
temp := map[string]interface{}{
|
||||||
|
"devicename": disk.DeviceName,
|
||||||
"disk_name": disk.Name,
|
"disk_name": disk.Name,
|
||||||
"disk_id": disk.ID,
|
"disk_id": disk.ID,
|
||||||
"disk_type": disk.Type,
|
"disk_type": disk.Type,
|
||||||
@@ -318,9 +324,15 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex
|
|||||||
"desc": disk.Description,
|
"desc": disk.Description,
|
||||||
"image_id": disk.ImageID,
|
"image_id": disk.ImageID,
|
||||||
"size": disk.SizeMax,
|
"size": disk.SizeMax,
|
||||||
"permanently": pernamentlyValue,
|
|
||||||
"present_to": disk.PresentTo,
|
"present_to": disk.PresentTo,
|
||||||
"storage_policy_id": disk.StoragePolicyID,
|
"storage_policy_id": disk.StoragePolicyID,
|
||||||
|
"to_clean": disk.ToClean,
|
||||||
|
"created_by": disk.CreatedBy,
|
||||||
|
"created_time": disk.CreatedTime,
|
||||||
|
"deleted_by": disk.DeletedBy,
|
||||||
|
"deleted_time": disk.DeletedTime,
|
||||||
|
"updated_time": disk.UpdatedTime,
|
||||||
|
"permanently": pernamentlyValue,
|
||||||
}
|
}
|
||||||
res = append(res, temp)
|
res = append(res, temp)
|
||||||
indexDataDisks++
|
indexDataDisks++
|
||||||
@@ -439,7 +451,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
|
|||||||
if err := d.Set("os_users", parseOsUsers(computeRec.OSUsers)); err != nil {
|
if err := d.Set("os_users", parseOsUsers(computeRec.OSUsers)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// d.Set("pinned", computeRec.Pinned)
|
d.Set("pinned", computeRec.PinnedToStack)
|
||||||
d.Set("preferred_cpu", computeRec.PreferredCPU)
|
d.Set("preferred_cpu", computeRec.PreferredCPU)
|
||||||
d.Set("ram", computeRec.RAM)
|
d.Set("ram", computeRec.RAM)
|
||||||
d.Set("reference_id", computeRec.ReferenceID)
|
d.Set("reference_id", computeRec.ReferenceID)
|
||||||
@@ -467,6 +479,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
|
|||||||
d.Set("hot_resize", computeRec.HotResize)
|
d.Set("hot_resize", computeRec.HotResize)
|
||||||
d.Set("network_interface_naming", computeRec.NetworkInterfaceNaming)
|
d.Set("network_interface_naming", computeRec.NetworkInterfaceNaming)
|
||||||
d.Set("zone_id", computeRec.ZoneID)
|
d.Set("zone_id", computeRec.ZoneID)
|
||||||
|
d.Set("loader_meta_iso", flattenLoaderMetaIso(computeRec.LoaderMetaIso))
|
||||||
|
|
||||||
d.Set("enabled", false)
|
d.Set("enabled", false)
|
||||||
if computeRec.Status == status.Enabled {
|
if computeRec.Status == status.Enabled {
|
||||||
@@ -483,9 +496,23 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
|
|||||||
|
|
||||||
d.Set("os_version", computeRec.OSVersion)
|
d.Set("os_version", computeRec.OSVersion)
|
||||||
|
|
||||||
|
d.Set("cpu_pin", computeRec.CPUPin)
|
||||||
|
d.Set("numa_affinity", computeRec.NumaAffinity)
|
||||||
|
d.Set("hp_backed", computeRec.HPBacked)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func flattenLoaderMetaIso(loaderMetaIso compute.LoaderMetaIso) []map[string]interface{} {
|
||||||
|
res := make([]map[string]interface{}, 0)
|
||||||
|
temp := map[string]interface{}{
|
||||||
|
"device_name": loaderMetaIso.DeviceName,
|
||||||
|
"path": loaderMetaIso.Path,
|
||||||
|
}
|
||||||
|
res = append(res, temp)
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
func flattenACL(acl compute.RecordACL) []map[string]interface{} {
|
func flattenACL(acl compute.RecordACL) []map[string]interface{} {
|
||||||
res := make([]map[string]interface{}, 0)
|
res := make([]map[string]interface{}, 0)
|
||||||
temp := map[string]interface{}{
|
temp := map[string]interface{}{
|
||||||
@@ -565,7 +592,10 @@ func flattenListComputeDisks(disks compute.ListComputeDisks) []map[string]interf
|
|||||||
"boot_partition": disk.BootPartition,
|
"boot_partition": disk.BootPartition,
|
||||||
"bus_number": disk.BusNumber,
|
"bus_number": disk.BusNumber,
|
||||||
"created_time": disk.CreatedTime,
|
"created_time": disk.CreatedTime,
|
||||||
|
"created_by": disk.CreatedBy,
|
||||||
"deleted_time": disk.DeletedTime,
|
"deleted_time": disk.DeletedTime,
|
||||||
|
"deleted_by": disk.DeletedBy,
|
||||||
|
"devicename": disk.DeviceName,
|
||||||
"description": disk.Description,
|
"description": disk.Description,
|
||||||
"destruction_time": disk.DestructionTime,
|
"destruction_time": disk.DestructionTime,
|
||||||
"disk_path": disk.DiskPath,
|
"disk_path": disk.DiskPath,
|
||||||
@@ -601,6 +631,7 @@ func flattenListComputeDisks(disks compute.ListComputeDisks) []map[string]interf
|
|||||||
"tech_status": disk.TechStatus,
|
"tech_status": disk.TechStatus,
|
||||||
"type": disk.Type,
|
"type": disk.Type,
|
||||||
"to_clean": disk.ToClean,
|
"to_clean": disk.ToClean,
|
||||||
|
"updated_time": disk.UpdatedTime,
|
||||||
}
|
}
|
||||||
res = append(res, temp)
|
res = append(res, temp)
|
||||||
}
|
}
|
||||||
@@ -726,6 +757,7 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
|
|||||||
d.Set("hot_resize", computeRec.HotResize)
|
d.Set("hot_resize", computeRec.HotResize)
|
||||||
d.Set("network_interface_naming", computeRec.NetworkInterfaceNaming)
|
d.Set("network_interface_naming", computeRec.NetworkInterfaceNaming)
|
||||||
d.Set("zone_id", computeRec.ZoneID)
|
d.Set("zone_id", computeRec.ZoneID)
|
||||||
|
d.Set("loader_meta_iso", flattenLoaderMetaIso(computeRec.LoaderMetaIso))
|
||||||
d.Set("os_version", computeRec.OSVersion)
|
d.Set("os_version", computeRec.OSVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -944,41 +944,6 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.HasChange("pin_to_stack") {
|
|
||||||
oldPin, newPin := d.GetChange("pin_to_stack")
|
|
||||||
if !newPin.(bool) {
|
|
||||||
req := compute.UnpinFromStackRequest{
|
|
||||||
ComputeID: computeRec.ID,
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err := c.CloudAPI().Compute().UnpinFromStack(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return diag.FromErr(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !oldPin.(bool) {
|
|
||||||
if !d.Get("started").(bool) {
|
|
||||||
return diag.Errorf("Cannot pin to stack a VM, that is not started")
|
|
||||||
}
|
|
||||||
reqToStart := compute.StartRequest{
|
|
||||||
ComputeID: computeRec.ID,
|
|
||||||
}
|
|
||||||
_, err := c.CloudAPI().Compute().Start(ctx, reqToStart)
|
|
||||||
if err != nil {
|
|
||||||
return diag.FromErr(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
req := compute.PinToStackRequest{
|
|
||||||
ComputeID: computeRec.ID,
|
|
||||||
}
|
|
||||||
req.AutoStart = d.Get("auto_start_w_node").(bool)
|
|
||||||
_, err = c.CloudAPI().Compute().PinToStack(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return diag.FromErr(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note bene: numa_affinity, cpu_pin and hp_backed are not allowed to be changed for compute in STARTED tech status.
|
// Note bene: numa_affinity, cpu_pin and hp_backed are not allowed to be changed for compute in STARTED tech status.
|
||||||
var isStopRequired bool
|
var isStopRequired bool
|
||||||
if d.HasChanges("numa_affinity", "cpu_pin", "hp_backed", "chipset", "preferred_cpu", "hot_resize") && d.Get("started").(bool) {
|
if d.HasChanges("numa_affinity", "cpu_pin", "hp_backed", "chipset", "preferred_cpu", "hot_resize") && d.Get("started").(bool) {
|
||||||
@@ -1810,7 +1775,6 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
return diag.FromErr(err)
|
return diag.FromErr(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
req := compute.StopRequest{
|
req := compute.StopRequest{
|
||||||
ComputeID: computeRec.ID,
|
ComputeID: computeRec.ID,
|
||||||
@@ -1821,6 +1785,34 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if d.HasChange("pin_to_stack") || d.HasChange("started") {
|
||||||
|
newPin := d.Get("pin_to_stack")
|
||||||
|
if !newPin.(bool) && d.HasChange("pin_to_stack") {
|
||||||
|
req := compute.UnpinFromStackRequest{
|
||||||
|
ComputeID: computeRec.ID,
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := c.CloudAPI().Compute().UnpinFromStack(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return diag.FromErr(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if newPin.(bool) {
|
||||||
|
if !d.Get("started").(bool) {
|
||||||
|
return diag.Errorf("Cannot pin to stack a VM, that is not started")
|
||||||
|
}
|
||||||
|
|
||||||
|
req := compute.PinToStackRequest{
|
||||||
|
ComputeID: computeRec.ID,
|
||||||
|
}
|
||||||
|
req.AutoStart = d.Get("auto_start_w_node").(bool)
|
||||||
|
_, err = c.CloudAPI().Compute().PinToStack(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
|
||||||
|
|
||||||
@@ -1900,32 +1892,6 @@ func resourceComputeDelete(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
c := m.(*controller.ControllerCfg)
|
c := m.(*controller.ControllerCfg)
|
||||||
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
|
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
|
||||||
|
|
||||||
if start, ok := d.GetOk("started"); ok {
|
|
||||||
if start.(bool) {
|
|
||||||
req := compute.StopRequest{ComputeID: computeId}
|
|
||||||
log.Debugf("resourceComputeDelete: stoping Compute ID %d", computeId)
|
|
||||||
if _, err := c.CloudAPI().Compute().Stop(ctx, req); err != nil {
|
|
||||||
diag.FromErr(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pciList, ok := d.GetOk("pci_devices")
|
|
||||||
|
|
||||||
if d.Get("permanently").(bool) && ok {
|
|
||||||
pciDevices := pciList.(*schema.Set).List()
|
|
||||||
for _, v := range pciDevices {
|
|
||||||
pciID := v.(int)
|
|
||||||
req := compute.DetachPCIDeviceRequest{
|
|
||||||
ComputeID: computeId,
|
|
||||||
DeviceID: uint64(pciID),
|
|
||||||
}
|
|
||||||
_, err := c.CloudAPI().Compute().DetachPCIDevice(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return diag.FromErr(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req := compute.DeleteRequest{
|
req := compute.DeleteRequest{
|
||||||
ComputeID: computeId,
|
ComputeID: computeId,
|
||||||
Permanently: d.Get("permanently").(bool),
|
Permanently: d.Get("permanently").(bool),
|
||||||
@@ -2022,6 +1988,30 @@ func disksSubresourceSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"devicename": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"created_by": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"created_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"deleted_by": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"deleted_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"updated_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
return rets
|
return rets
|
||||||
}
|
}
|
||||||
@@ -2154,6 +2144,7 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"chipset": {
|
"chipset": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
@@ -2841,6 +2832,22 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"loader_meta_iso": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"device_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
return rets
|
return rets
|
||||||
}
|
}
|
||||||
@@ -2867,6 +2874,10 @@ func ResourceCompute() *schema.Resource {
|
|||||||
if diff.HasChanges("pin_to_stack") {
|
if diff.HasChanges("pin_to_stack") {
|
||||||
diff.SetNewComputed("pinned")
|
diff.SetNewComputed("pinned")
|
||||||
}
|
}
|
||||||
|
if diff.HasChanges("image_id") {
|
||||||
|
diff.SetNewComputed("boot_disk")
|
||||||
|
diff.SetNewComputed("boot_image_id")
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -135,14 +135,6 @@ func dataSourceRgListDeletedSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"cpu_allocation_parameter": {
|
|
||||||
Type: schema.TypeString,
|
|
||||||
Computed: true,
|
|
||||||
},
|
|
||||||
"cpu_allocation_ratio": {
|
|
||||||
Type: schema.TypeFloat,
|
|
||||||
Computed: true,
|
|
||||||
},
|
|
||||||
"created_by": {
|
"created_by": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
@@ -243,6 +235,14 @@ func dataSourceRgListDeletedSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"cpu_allocation_parameter": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"cpu_allocation_ratio": {
|
||||||
|
Type: schema.TypeFloat,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
"uniq_pools": {
|
"uniq_pools": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
@@ -250,6 +250,10 @@ func dataSourceRgListDeletedSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"sdn_access_group_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
"storage_policy_ids": {
|
"storage_policy_ids": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ func flattenAccessSEPPools(accessSEPPools stpolicy.ListAccessSEPPools) []map[str
|
|||||||
res := make([]map[string]interface{}, 0, len(accessSEPPools))
|
res := make([]map[string]interface{}, 0, len(accessSEPPools))
|
||||||
for _, asp := range accessSEPPools {
|
for _, asp := range accessSEPPools {
|
||||||
temp := map[string]interface{}{
|
temp := map[string]interface{}{
|
||||||
"sep_id": asp.SEPID,
|
"sep_id": asp.SEPID,
|
||||||
//TODO
|
"sep_name": asp.Name,
|
||||||
//"name": asp.Name,
|
|
||||||
"pool_names": asp.PoolNames,
|
"pool_names": asp.PoolNames,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,10 @@ func dataSourceStoragePolicyListSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"sep_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ func flattenDataAccount(d *schema.ResourceData, acc *account.RecordAccount) {
|
|||||||
d.Set("resource_types", acc.ResTypes)
|
d.Set("resource_types", acc.ResTypes)
|
||||||
d.Set("send_access_emails", acc.SendAccessEmails)
|
d.Set("send_access_emails", acc.SendAccessEmails)
|
||||||
d.Set("status", acc.Status)
|
d.Set("status", acc.Status)
|
||||||
|
d.Set("storage_policy_ids", acc.StoragePolicyIDs)
|
||||||
d.Set("uniq_pools", acc.UniqPools)
|
d.Set("uniq_pools", acc.UniqPools)
|
||||||
d.Set("zone_ids", flattenZones(acc.ZoneIDs))
|
d.Set("zone_ids", flattenZones(acc.ZoneIDs))
|
||||||
d.Set("updated_time", acc.UpdatedTime)
|
d.Set("updated_time", acc.UpdatedTime)
|
||||||
|
|||||||
391
internal/service/cloudbroker/disks/old_schemas.go
Normal file
391
internal/service/cloudbroker/disks/old_schemas.go
Normal file
@@ -0,0 +1,391 @@
|
|||||||
|
package disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||||
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
|
||||||
|
)
|
||||||
|
|
||||||
|
func resourceDiskV1() *schema.Resource {
|
||||||
|
return &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"account_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
//ForceNew: true,
|
||||||
|
},
|
||||||
|
"gid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
//ForceNew: true,
|
||||||
|
},
|
||||||
|
"disk_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Required: true,
|
||||||
|
ValidateFunc: validation.StringInSlice([]string{"D", "B", "T"}, false),
|
||||||
|
Description: "The type of disk in terms of its role in compute: 'B=Boot, D=Data, T=Temp'",
|
||||||
|
},
|
||||||
|
|
||||||
|
"desc": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"size_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Required: true,
|
||||||
|
},
|
||||||
|
"ssd_size": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
},
|
||||||
|
"iops": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Description: "max IOPS disk can perform",
|
||||||
|
},
|
||||||
|
"sep_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"pool": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"node_ids": {
|
||||||
|
Type: schema.TypeSet,
|
||||||
|
Optional: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"detach": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Default: false,
|
||||||
|
Description: "detach disk from machine first",
|
||||||
|
},
|
||||||
|
"permanently": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Default: false,
|
||||||
|
Description: "whether to completely delete the disk, works only with non attached disks",
|
||||||
|
},
|
||||||
|
"shareable": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"restore": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
Default: false,
|
||||||
|
Description: "restore deleting disk",
|
||||||
|
},
|
||||||
|
"account_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"acl": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"boot_partition": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"computes": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"compute_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"compute_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"created_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"deleted_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"destruction_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"devicename": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"disk_path": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"disk_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"image_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"images": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"iotune": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Optional: true,
|
||||||
|
MaxItems: 1,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"read_bytes_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"read_bytes_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"read_iops_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"read_iops_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"size_iops_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"total_bytes_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"total_bytes_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"total_iops_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"total_iops_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"write_bytes_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"write_bytes_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"write_iops_sec": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"write_iops_sec_max": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"iqn": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"login": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"milestones": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
"order": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"params": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"parent_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"passwd": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"pci_slot": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"present_to": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"purge_attempts": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"purge_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"replication": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"disk_id": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"pool_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"self_volume_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"storage_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"volume_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Description: "Replication status",
|
||||||
|
},
|
||||||
|
"reality_device_number": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"reference_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"res_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"res_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"sep_type": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"size_used": {
|
||||||
|
Type: schema.TypeFloat,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"snapshots": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"guid": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"label": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"reference_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"res_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"snap_set_guid": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"snap_set_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"timestamp": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"tech_status": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"vmid": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -418,7 +418,7 @@ func resourceDiskChangeNodes(ctx context.Context, d *schema.ResourceData, m inte
|
|||||||
|
|
||||||
func ResourceDisk() *schema.Resource {
|
func ResourceDisk() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceDiskCreate,
|
CreateContext: resourceDiskCreate,
|
||||||
ReadContext: resourceDiskRead,
|
ReadContext: resourceDiskRead,
|
||||||
@@ -438,5 +438,12 @@ func ResourceDisk() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceDiskSchemaMake(),
|
Schema: resourceDiskSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceDiskV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourceDiskUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
internal/service/cloudbroker/disks/state_upgrader.go
Normal file
14
internal/service/cloudbroker/disks/state_upgrader.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
func resourceDiskUpgradeV1(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
|
||||||
|
log.Debug("resourceDiskUpgradeV1: upgrading state")
|
||||||
|
rawState["present_to"] = make(map[string]uint64)
|
||||||
|
|
||||||
|
return rawState, nil
|
||||||
|
}
|
||||||
1394
internal/service/cloudbroker/image/old_schemas.go
Normal file
1394
internal/service/cloudbroker/image/old_schemas.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -207,7 +207,7 @@ func resourceImageCDROMEdit(ctx context.Context, d *schema.ResourceData, m inter
|
|||||||
|
|
||||||
func ResourceCDROMImage() *schema.Resource {
|
func ResourceCDROMImage() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceCDROMImageCreate,
|
CreateContext: resourceCDROMImageCreate,
|
||||||
ReadContext: resourceCDROMImageRead,
|
ReadContext: resourceCDROMImageRead,
|
||||||
@@ -227,5 +227,12 @@ func ResourceCDROMImage() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceCDROMImageSchemaMake(),
|
Schema: resourceCDROMImageSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceCDROMImageV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentTOUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ func resourceImageEdit(ctx context.Context, d *schema.ResourceData, m interface{
|
|||||||
|
|
||||||
func ResourceImage() *schema.Resource {
|
func ResourceImage() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceImageCreate,
|
CreateContext: resourceImageCreate,
|
||||||
ReadContext: resourceImageRead,
|
ReadContext: resourceImageRead,
|
||||||
@@ -376,5 +376,12 @@ func ResourceImage() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceImageSchemaMake(),
|
Schema: resourceImageSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceImageV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentTOUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ func resourceImageFromBlankComputeUpdate(ctx context.Context, d *schema.Resource
|
|||||||
|
|
||||||
func ResourceImageFromBlankCompute() *schema.Resource {
|
func ResourceImageFromBlankCompute() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceImageFromBlankComputeCreate,
|
CreateContext: resourceImageFromBlankComputeCreate,
|
||||||
ReadContext: resourceImageFromBlankComputeRead,
|
ReadContext: resourceImageFromBlankComputeRead,
|
||||||
@@ -274,5 +274,12 @@ func ResourceImageFromBlankCompute() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceImageFromBlankComputeSchemaMake(),
|
Schema: resourceImageFromBlankComputeSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceImageFromBlankComputeV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentTOUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ func resourceImageFromPlatformDiskUpdate(ctx context.Context, d *schema.Resource
|
|||||||
|
|
||||||
func ResourceImageFromPlatformDisk() *schema.Resource {
|
func ResourceImageFromPlatformDisk() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceImageFromPlatformDiskCreate,
|
CreateContext: resourceImageFromPlatformDiskCreate,
|
||||||
ReadContext: resourceImageFromPlatformDiskRead,
|
ReadContext: resourceImageFromPlatformDiskRead,
|
||||||
@@ -276,5 +276,12 @@ func ResourceImageFromPlatformDisk() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceImageFromPlatformDiskSchemaMake(),
|
Schema: resourceImageFromPlatformDiskSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceImageFromPlatformDiskV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentTOUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ func resourceImageLink(ctx context.Context, d *schema.ResourceData, m interface{
|
|||||||
|
|
||||||
func ResourceVirtualImage() *schema.Resource {
|
func ResourceVirtualImage() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 2,
|
||||||
|
|
||||||
CreateContext: resourceVirtualImageCreate,
|
CreateContext: resourceVirtualImageCreate,
|
||||||
ReadContext: resourceVirtualImageRead,
|
ReadContext: resourceVirtualImageRead,
|
||||||
@@ -203,5 +203,12 @@ func ResourceVirtualImage() *schema.Resource {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Schema: resourceVirtualImageSchemaMake(),
|
Schema: resourceVirtualImageSchemaMake(),
|
||||||
|
StateUpgraders: []schema.StateUpgrader{
|
||||||
|
{
|
||||||
|
Type: resourceVirtualImageV1().CoreConfigSchema().ImpliedType(),
|
||||||
|
Upgrade: resourcePresentTOUpgradeV1,
|
||||||
|
Version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
internal/service/cloudbroker/image/state_upgrader.go
Normal file
14
internal/service/cloudbroker/image/state_upgrader.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package image
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
func resourcePresentTOUpgradeV1(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
|
||||||
|
log.Debug("resourcePresentTOUpgradeV1: upgrading state")
|
||||||
|
rawState["present_to"] = make(map[string]uint64)
|
||||||
|
|
||||||
|
return rawState, nil
|
||||||
|
}
|
||||||
@@ -45,6 +45,7 @@ func flattenCompute(d *schema.ResourceData, computeRec *compute.RecordCompute, p
|
|||||||
d.Set("clone_reference", computeRec.CloneReference)
|
d.Set("clone_reference", computeRec.CloneReference)
|
||||||
d.Set("clones", computeRec.Clones)
|
d.Set("clones", computeRec.Clones)
|
||||||
d.Set("computeci_id", computeRec.ComputeCIID)
|
d.Set("computeci_id", computeRec.ComputeCIID)
|
||||||
|
d.Set("cpu", computeRec.CPUs)
|
||||||
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", string(customFields))
|
d.Set("custom_fields", string(customFields))
|
||||||
@@ -64,6 +65,7 @@ func flattenCompute(d *schema.ResourceData, computeRec *compute.RecordCompute, p
|
|||||||
d.Set("image_name", computeRec.ImageName)
|
d.Set("image_name", computeRec.ImageName)
|
||||||
d.Set("interfaces", flattenInterfaces(computeRec.Interfaces))
|
d.Set("interfaces", flattenInterfaces(computeRec.Interfaces))
|
||||||
d.Set("lock_status", computeRec.LockStatus)
|
d.Set("lock_status", computeRec.LockStatus)
|
||||||
|
d.Set("loader_meta_iso", flattenLoaderMetaIso(computeRec.LoaderMetaIso))
|
||||||
d.Set("manager_id", computeRec.ManagerID)
|
d.Set("manager_id", computeRec.ManagerID)
|
||||||
d.Set("manager_type", computeRec.ManagerType)
|
d.Set("manager_type", computeRec.ManagerType)
|
||||||
d.Set("migrationjob", computeRec.MigrationJob)
|
d.Set("migrationjob", computeRec.MigrationJob)
|
||||||
@@ -78,14 +80,17 @@ func flattenCompute(d *schema.ResourceData, computeRec *compute.RecordCompute, p
|
|||||||
d.Set("os_users", flattenOSUsers(computeRec.OSUsers))
|
d.Set("os_users", flattenOSUsers(computeRec.OSUsers))
|
||||||
d.Set("pinned", computeRec.PinnedToStack)
|
d.Set("pinned", computeRec.PinnedToStack)
|
||||||
d.Set("preferred_cpu", computeRec.PreferredCPU)
|
d.Set("preferred_cpu", computeRec.PreferredCPU)
|
||||||
|
d.Set("ram", computeRec.RAM)
|
||||||
d.Set("reference_id", computeRec.ReferenceID)
|
d.Set("reference_id", computeRec.ReferenceID)
|
||||||
d.Set("registered", computeRec.Registered)
|
d.Set("registered", computeRec.Registered)
|
||||||
d.Set("res_name", computeRec.ResName)
|
d.Set("res_name", computeRec.ResName)
|
||||||
d.Set("reserved_node_cpus", computeRec.ReservedNodeCpus)
|
d.Set("reserved_node_cpus", computeRec.ReservedNodeCpus)
|
||||||
d.Set("rg_name", computeRec.RGName)
|
d.Set("rg_name", computeRec.RGName)
|
||||||
|
d.Set("rg_id", computeRec.RGID)
|
||||||
d.Set("snap_sets", flattenSnapSets(computeRec.SnapSets))
|
d.Set("snap_sets", flattenSnapSets(computeRec.SnapSets))
|
||||||
d.Set("stack_id", computeRec.StackID)
|
d.Set("stack_id", computeRec.StackID)
|
||||||
d.Set("stack_name", computeRec.StackName)
|
d.Set("stack_name", computeRec.StackName)
|
||||||
|
d.Set("started", computeRec.TechStatus == "STARTED")
|
||||||
d.Set("stateless_sep_id", computeRec.StatelessSEPID)
|
d.Set("stateless_sep_id", computeRec.StatelessSEPID)
|
||||||
d.Set("stateless_sep_type", computeRec.StatelessSEPType)
|
d.Set("stateless_sep_type", computeRec.StatelessSEPType)
|
||||||
d.Set("status", computeRec.Status)
|
d.Set("status", computeRec.Status)
|
||||||
@@ -107,6 +112,9 @@ func flattenCompute(d *schema.ResourceData, computeRec *compute.RecordCompute, p
|
|||||||
d.Set("network_interface_naming", computeRec.NetworkInterfaceNaming)
|
d.Set("network_interface_naming", computeRec.NetworkInterfaceNaming)
|
||||||
d.Set("zone_id", computeRec.ZoneID)
|
d.Set("zone_id", computeRec.ZoneID)
|
||||||
d.Set("os_version", computeRec.OSVersion)
|
d.Set("os_version", computeRec.OSVersion)
|
||||||
|
d.Set("cpu_pin", computeRec.CPUPin)
|
||||||
|
d.Set("numa_affinity", computeRec.NumaAffinity)
|
||||||
|
d.Set("hp_backed", computeRec.HPBacked)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,10 +235,6 @@ func flattenQOS(qos compute.QOS) []map[string]interface{} {
|
|||||||
func flattenComputeDisks(disksList compute.ListDisks, disksBlocks, extraDisks []interface{}, bootDiskId uint64) []map[string]interface{} {
|
func flattenComputeDisks(disksList compute.ListDisks, disksBlocks, extraDisks []interface{}, bootDiskId uint64) []map[string]interface{} {
|
||||||
res := make([]map[string]interface{}, 0, len(disksList))
|
res := make([]map[string]interface{}, 0, len(disksList))
|
||||||
|
|
||||||
if len(disksBlocks) == 0 {
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Slice(disksList, func(i, j int) bool {
|
sort.Slice(disksList, func(i, j int) bool {
|
||||||
return disksList[i].ID < disksList[j].ID
|
return disksList[i].ID < disksList[j].ID
|
||||||
})
|
})
|
||||||
@@ -242,8 +246,25 @@ func flattenComputeDisks(disksList compute.ListDisks, disksBlocks, extraDisks []
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
pernamentlyValue := disksBlocks[indexDataDisks].(map[string]interface{})["permanently"].(bool)
|
var pernamentlyValue bool
|
||||||
nodeIds := disksBlocks[indexDataDisks].(map[string]interface{})["node_ids"].(*schema.Set)
|
if indexDataDisks < len(disksBlocks) {
|
||||||
|
if diskBlock, ok := disksBlocks[indexDataDisks].(map[string]interface{}); ok {
|
||||||
|
if perm, exists := diskBlock["permanently"]; exists {
|
||||||
|
if permBool, ok := perm.(bool); ok {
|
||||||
|
pernamentlyValue = permBool
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var nodeIds *schema.Set
|
||||||
|
if indexDataDisks < len(disksBlocks) {
|
||||||
|
if diskBlock, ok := disksBlocks[indexDataDisks].(map[string]interface{}); ok {
|
||||||
|
if nodeIds, exists := diskBlock["node_ids"]; exists {
|
||||||
|
nodeIds = nodeIds.(*schema.Set)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
temp := map[string]interface{}{
|
temp := map[string]interface{}{
|
||||||
"disk_name": disk.Name,
|
"disk_name": disk.Name,
|
||||||
@@ -258,10 +279,16 @@ func flattenComputeDisks(disksList compute.ListDisks, disksBlocks, extraDisks []
|
|||||||
"shareable": disk.Shareable,
|
"shareable": disk.Shareable,
|
||||||
"size_used": disk.SizeUsed,
|
"size_used": disk.SizeUsed,
|
||||||
"size_max": disk.SizeMax,
|
"size_max": disk.SizeMax,
|
||||||
"permanently": pernamentlyValue,
|
|
||||||
"present_to": disk.PresentTo,
|
"present_to": disk.PresentTo,
|
||||||
"storage_policy_id": disk.StoragePolicyID,
|
"storage_policy_id": disk.StoragePolicyID,
|
||||||
"to_clean": disk.ToClean,
|
"to_clean": disk.ToClean,
|
||||||
|
"permanently": pernamentlyValue,
|
||||||
|
"devicename": disk.DeviceName,
|
||||||
|
"create_by": disk.CreatedBy,
|
||||||
|
"create_time": disk.CreatedTime,
|
||||||
|
"delete_by": disk.DeletedBy,
|
||||||
|
"delete_time": disk.DeletedTime,
|
||||||
|
"update_time": disk.UpdatedTime,
|
||||||
}
|
}
|
||||||
res = append(res, temp)
|
res = append(res, temp)
|
||||||
indexDataDisks++
|
indexDataDisks++
|
||||||
@@ -556,6 +583,16 @@ func flattenDisks(disks []compute.InfoDisk) []map[string]interface{} {
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func flattenLoaderMetaIso(loaderMetaIso compute.LoaderMetaIso) []map[string]interface{} {
|
||||||
|
res := make([]map[string]interface{}, 0)
|
||||||
|
temp := map[string]interface{}{
|
||||||
|
"device_name": loaderMetaIso.DeviceName,
|
||||||
|
"path": loaderMetaIso.Path,
|
||||||
|
}
|
||||||
|
res = append(res, temp)
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
func flattenComputeAudits(computeAudits compute.ListDetailedAudits) []map[string]interface{} {
|
func flattenComputeAudits(computeAudits compute.ListDetailedAudits) []map[string]interface{} {
|
||||||
res := make([]map[string]interface{}, 0, len(computeAudits.Data))
|
res := make([]map[string]interface{}, 0, len(computeAudits.Data))
|
||||||
for _, computeAudit := range computeAudits.Data {
|
for _, computeAudit := range computeAudits.Data {
|
||||||
@@ -808,6 +845,7 @@ func flattenDataCompute(d *schema.ResourceData, compFacts *compute.RecordCompute
|
|||||||
d.Set("hot_resize", compFacts.HotResize)
|
d.Set("hot_resize", compFacts.HotResize)
|
||||||
d.Set("network_interface_naming", compFacts.NetworkInterfaceNaming)
|
d.Set("network_interface_naming", compFacts.NetworkInterfaceNaming)
|
||||||
d.Set("zone_id", compFacts.ZoneID)
|
d.Set("zone_id", compFacts.ZoneID)
|
||||||
|
d.Set("loader_meta_iso", flattenLoaderMetaIso(compFacts.LoaderMetaIso))
|
||||||
d.Set("os_version", compFacts.OSVersion)
|
d.Set("os_version", compFacts.OSVersion)
|
||||||
//extra fields setting
|
//extra fields setting
|
||||||
bootDisk := findBootDisk(compFacts.Disks)
|
bootDisk := findBootDisk(compFacts.Disks)
|
||||||
@@ -868,7 +906,10 @@ func flattenDisk(diskList compute.ListDisks) []map[string]interface{} {
|
|||||||
"boot_partition": disk.BootPartition,
|
"boot_partition": disk.BootPartition,
|
||||||
"bus_number": disk.BusNumber,
|
"bus_number": disk.BusNumber,
|
||||||
"created_time": disk.CreatedTime,
|
"created_time": disk.CreatedTime,
|
||||||
|
"created_by": disk.CreatedBy,
|
||||||
"deleted_time": disk.DeletedTime,
|
"deleted_time": disk.DeletedTime,
|
||||||
|
"deleted_by": disk.DeletedBy,
|
||||||
|
"devicename": disk.DeviceName,
|
||||||
"desc": disk.Description,
|
"desc": disk.Description,
|
||||||
"destruction_time": disk.DestructionTime,
|
"destruction_time": disk.DestructionTime,
|
||||||
"disk_path": disk.DiskPath,
|
"disk_path": disk.DiskPath,
|
||||||
@@ -907,6 +948,7 @@ func flattenDisk(diskList compute.ListDisks) []map[string]interface{} {
|
|||||||
"tech_status": disk.TechStatus,
|
"tech_status": disk.TechStatus,
|
||||||
"type": disk.Type,
|
"type": disk.Type,
|
||||||
"to_clean": disk.ToClean,
|
"to_clean": disk.ToClean,
|
||||||
|
"updated_time": disk.UpdatedTime,
|
||||||
}
|
}
|
||||||
res = append(res, temp)
|
res = append(res, temp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,26 +344,6 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if pin, ok := d.GetOk("pin_to_stack"); ok && pin.(bool) {
|
|
||||||
req := compute.PinToStackRequest{
|
|
||||||
ComputeID: computeId,
|
|
||||||
TargetStackID: uint64(d.Get("stack_id").(int)),
|
|
||||||
}
|
|
||||||
|
|
||||||
if force, ok := d.Get("force_pin").(bool); ok {
|
|
||||||
req.Force = force
|
|
||||||
}
|
|
||||||
|
|
||||||
if autoStart, ok := d.Get("auto_start_w_node").(bool); ok {
|
|
||||||
req.AutoStart = autoStart
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err := c.CloudBroker().Compute().PinToStack(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
warnings.Add(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if libvirtSettings, ok := d.GetOk("libvirt_settings"); ok {
|
if libvirtSettings, ok := d.GetOk("libvirt_settings"); ok {
|
||||||
if libvirtSettings.(*schema.Set).Len() > 0 {
|
if libvirtSettings.(*schema.Set).Len() > 0 {
|
||||||
lvs := libvirtSettings.(*schema.Set).List()
|
lvs := libvirtSettings.(*schema.Set).List()
|
||||||
@@ -456,6 +436,36 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pin, ok := d.GetOk("pin_to_stack"); ok && pin.(bool) {
|
||||||
|
start, _ := d.GetOk("started")
|
||||||
|
_, stackOk := d.GetOk("stack_id")
|
||||||
|
|
||||||
|
if !start.(bool) && !stackOk {
|
||||||
|
warnings.Add(errors.New("cannot pin to stack a VM, that is not started and stack_id is not set"))
|
||||||
|
} else {
|
||||||
|
req := compute.PinToStackRequest{
|
||||||
|
ComputeID: computeId,
|
||||||
|
}
|
||||||
|
|
||||||
|
if stackID, ok := d.Get("stack_id").(int); ok {
|
||||||
|
req.TargetStackID = uint64(stackID)
|
||||||
|
}
|
||||||
|
|
||||||
|
if force, ok := d.Get("force_pin").(bool); ok {
|
||||||
|
req.Force = force
|
||||||
|
}
|
||||||
|
|
||||||
|
if autoStart, ok := d.Get("auto_start_w_node").(bool); ok {
|
||||||
|
req.AutoStart = autoStart
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := c.CloudBroker().Compute().PinToStack(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
warnings.Add(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if affinityLabel, ok := d.GetOk("affinity_label"); ok {
|
if affinityLabel, ok := d.GetOk("affinity_label"); ok {
|
||||||
req := compute.AffinityLabelSetRequest{
|
req := compute.AffinityLabelSetRequest{
|
||||||
ComputeIDs: []uint64{
|
ComputeIDs: []uint64{
|
||||||
@@ -950,33 +960,6 @@ func resourceComputeDelete(ctx context.Context, d *schema.ResourceData, m interf
|
|||||||
c := m.(*controller.ControllerCfg)
|
c := m.(*controller.ControllerCfg)
|
||||||
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
|
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
|
||||||
|
|
||||||
if start, ok := d.GetOk("started"); ok {
|
|
||||||
if start.(bool) {
|
|
||||||
req := compute.StopRequest{ComputeID: computeId}
|
|
||||||
log.Debugf("resourceComputeDelete: stoping Compute ID %d", computeId)
|
|
||||||
if _, err := c.CloudBroker().Compute().Stop(ctx, req); err != nil {
|
|
||||||
diag.FromErr(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pciList, ok := d.GetOk("pci_devices")
|
|
||||||
|
|
||||||
if d.Get("permanently").(bool) && ok {
|
|
||||||
pciDevices := pciList.(*schema.Set).List()
|
|
||||||
for _, v := range pciDevices {
|
|
||||||
pciID := v.(int)
|
|
||||||
req := compute.DetachPCIDeviceRequest{
|
|
||||||
ComputeID: computeId,
|
|
||||||
DeviceID: uint64(pciID),
|
|
||||||
}
|
|
||||||
_, err := c.CloudBroker().Compute().DetachPciDevice(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return diag.FromErr(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
req := compute.DeleteRequest{
|
req := compute.DeleteRequest{
|
||||||
ComputeID: computeId,
|
ComputeID: computeId,
|
||||||
Permanently: d.Get("permanently").(bool),
|
Permanently: d.Get("permanently").(bool),
|
||||||
|
|||||||
@@ -530,6 +530,22 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"devicename": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"created_by": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"deleted_by": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"updated_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -971,6 +987,22 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"loader_meta_iso": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"device_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
"user_data": {
|
"user_data": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
@@ -3760,6 +3792,30 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"devicename": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"create_by": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"create_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"delete_by": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"delete_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"update_time": {
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -4561,5 +4617,21 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"loader_meta_iso": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Computed: true,
|
||||||
|
Elem: &schema.Resource{
|
||||||
|
Schema: map[string]*schema.Schema{
|
||||||
|
"device_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1618,6 +1618,13 @@ func utilityComputePinToStack(ctx context.Context, d *schema.ResourceData, m int
|
|||||||
|
|
||||||
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
|
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
|
||||||
|
|
||||||
|
start, _ := d.GetOk("started")
|
||||||
|
_, stackOk := d.GetOk("stack_id")
|
||||||
|
|
||||||
|
if !start.(bool) && !stackOk {
|
||||||
|
errors.New("cannot pin to stack a VM, that is not started and stack_id is not set")
|
||||||
|
}
|
||||||
|
|
||||||
oldPin, newPin := d.GetChange("pin_to_stack")
|
oldPin, newPin := d.GetChange("pin_to_stack")
|
||||||
if oldPin.(bool) && !newPin.(bool) {
|
if oldPin.(bool) && !newPin.(bool) {
|
||||||
req := compute.UnpinFromStackRequest{
|
req := compute.UnpinFromStackRequest{
|
||||||
|
|||||||
@@ -1741,6 +1741,10 @@ func dataSourceRgListDeletedSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"sdn_access_group_id": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
"storage_policy_ids": {
|
"storage_policy_ids": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ func flattenAccessSEPPools(accessSEPPools stpolicy.ListAccessSEPPools) []map[str
|
|||||||
res := make([]map[string]interface{}, 0, len(accessSEPPools))
|
res := make([]map[string]interface{}, 0, len(accessSEPPools))
|
||||||
for _, asp := range accessSEPPools {
|
for _, asp := range accessSEPPools {
|
||||||
temp := map[string]interface{}{
|
temp := map[string]interface{}{
|
||||||
"sep_id": asp.SEPID,
|
"sep_id": asp.SEPID,
|
||||||
//TODO
|
"sep_name": asp.Name,
|
||||||
//"name": asp.Name,
|
|
||||||
"pool_names": asp.PoolNames,
|
"pool_names": asp.PoolNames,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -244,6 +244,10 @@ func dataSourceStoragePolicyListSchemaMake() map[string]*schema.Schema {
|
|||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
"sep_name": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ resource "decort_bservice_group" "bsg" {
|
|||||||
#обязательный параметр
|
#обязательный параметр
|
||||||
#тип - целое число
|
#тип - целое число
|
||||||
#используется при создании и обновлении
|
#используется при создании и обновлении
|
||||||
ram = 256
|
ram = 512
|
||||||
|
|
||||||
#размер диска для выч. ресурса, в ГБ
|
#размер диска для выч. ресурса, в ГБ
|
||||||
#обязательный параметр
|
#обязательный параметр
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ resource "decort_kvmvm" "comp" {
|
|||||||
#опциональный параметр
|
#опциональный параметр
|
||||||
#тип - блок
|
#тип - блок
|
||||||
#используется при создании и обновлении
|
#используется при создании и обновлении
|
||||||
#security groups {
|
#security_groups {
|
||||||
#тип сети
|
#тип сети
|
||||||
#обязательный параметр
|
#обязательный параметр
|
||||||
#тип - строка
|
#тип - строка
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ resource "decort_cb_account" "acc" {
|
|||||||
#id политики хранения
|
#id политики хранения
|
||||||
#обязательный параметр
|
#обязательный параметр
|
||||||
#тип - целое число
|
#тип - целое число
|
||||||
#storage_policy_id = 111
|
#id = 111
|
||||||
|
|
||||||
#лимит ресурсов хранения в ГБ
|
#лимит ресурсов хранения в ГБ
|
||||||
#опциональный параметр
|
#опциональный параметр
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ resource "decort_cb_kvmvm" "comp" {
|
|||||||
#опциональный параметр
|
#опциональный параметр
|
||||||
#тип - блок
|
#тип - блок
|
||||||
#используется при создании и обновлении
|
#используется при создании и обновлении
|
||||||
#security groups {
|
#security_groups {
|
||||||
#тип сети
|
#тип сети
|
||||||
#обязательный параметр
|
#обязательный параметр
|
||||||
#тип - строка
|
#тип - строка
|
||||||
|
|||||||
Reference in New Issue
Block a user