This commit is contained in:
2026-06-02 11:28:16 +03:00
parent af79f6ab3e
commit c734dcfff7
254 changed files with 10439 additions and 3751 deletions

View File

@@ -6,7 +6,6 @@ import (
)
func flattenStoragePolicyData(d *schema.ResourceData, storagePolicy *stpolicy.InfoStoragePolicy) {
d.Set("storage_policy_id", storagePolicy.ID)
d.Set("description", storagePolicy.Description)
d.Set("guid", storagePolicy.GUID)
d.Set("limit_iops", storagePolicy.LimitIOPS)
@@ -62,13 +61,28 @@ func flattenStoragePolicyList(storagePolicyList *stpolicy.ListStoragePolicies) [
return res
}
func flattenAccessSEPPoolsResource(accessSEPPools stpolicy.ListAccessSEPPools) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
for _, asp := range accessSEPPools {
for _, poolName := range asp.PoolNames {
temp := map[string]interface{}{
"sep_id": asp.SEPID,
"sep_name": asp.Name,
"pool_name": poolName,
"sep_tech_status": asp.SepTechStatus,
}
res = append(res, temp)
}
}
return res
}
func flattenStoragePolicyResource(d *schema.ResourceData, storagePolicy *stpolicy.InfoStoragePolicy) {
d.Set("storage_policy_id", storagePolicy.ID)
d.Set("description", storagePolicy.Description)
d.Set("guid", storagePolicy.GUID)
d.Set("limit_iops", storagePolicy.LimitIOPS)
d.Set("name", storagePolicy.Name)
d.Set("status", storagePolicy.Status)
d.Set("access_seps_pools", flattenAccessSEPPools(storagePolicy.AccessSEPPools))
d.Set("access_seps_pools", flattenAccessSEPPoolsResource(storagePolicy.AccessSEPPools))
d.Set("usage", flattenUsage(storagePolicy.Usage))
}

View File

@@ -61,7 +61,6 @@ func resourceStoragePolicyCreate(ctx context.Context, d *schema.ResourceData, m
}
d.SetId(strconv.FormatUint(storagePolicyID, 10))
d.Set("storage_policy_id", storagePolicyID)
if enabled, ok := d.GetOk("enabled"); ok {
isToEnable := enabled.(bool)

View File

@@ -7,10 +7,6 @@ import (
func resourceStoragePolicySchemaMake() map[string]*schema.Schema {
res := map[string]*schema.Schema{
"storage_policy_id": {
Type: schema.TypeInt,
Computed: true,
},
"name": {
Type: schema.TypeString,
Required: true,
@@ -32,6 +28,10 @@ func resourceStoragePolicySchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Required: true,
},
"sep_tech_status": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
@@ -129,6 +129,10 @@ func dataSourceStoragePolicySchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"sep_tech_status": {
Type: schema.TypeString,
Computed: true,
},
},
},
},