From bd190612ea560c47c3bc2bfc9b72d1d0909e169e Mon Sep 17 00:00:00 2001 From: Diptipowervs Date: Fri, 29 Dec 2023 15:23:52 +0530 Subject: [PATCH 1/3] disaster recovery refactor --- ...ource_ibm_pi_disaster_recovery_location.go | 51 ++++++++++--------- ..._ibm_pi_disaster_recovery_location_test.go | 7 ++- ...urce_ibm_pi_disaster_recovery_locations.go | 47 ++++++++--------- ...ibm_pi_disaster_recovery_locations_test.go | 2 +- ibm/service/power/ibm_pi_constants.go | 14 +++-- ...i_disaster_recovery_location.html.markdown | 20 ++++---- ..._disaster_recovery_locations.html.markdown | 18 +++---- 7 files changed, 83 insertions(+), 76 deletions(-) diff --git a/ibm/service/power/data_source_ibm_pi_disaster_recovery_location.go b/ibm/service/power/data_source_ibm_pi_disaster_recovery_location.go index f7f2f3e85c..4c839ab37f 100644 --- a/ibm/service/power/data_source_ibm_pi_disaster_recovery_location.go +++ b/ibm/service/power/data_source_ibm_pi_disaster_recovery_location.go @@ -6,47 +6,50 @@ package power import ( "context" + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - - "github.com/IBM-Cloud/power-go-client/clients/instance" - "github.com/IBM-Cloud/power-go-client/helpers" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) func DataSourceIBMPIDisasterRecoveryLocation() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIDisasterRecoveryLocation, Schema: map[string]*schema.Schema{ - helpers.PICloudInstanceId: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - // Computed Attributes - PIDRLocation: { - Type: schema.TypeString, + // Attributes + Attr_Location: { Computed: true, - Description: "RegionZone of a site", + Description: "The region zone of a site.", + Type: schema.TypeString, }, - "replication_sites": { - Type: schema.TypeList, - Computed: true, + Attr_ReplicationSites: { + Computed: true, + Description: "List of replication sites.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "is_active": { - Type: schema.TypeBool, - Computed: true, + Attr_IsActive: { + Computed: true, + Description: "Indicates the location is active or not, true if location is active , otherwise it is false.", + Type: schema.TypeBool, }, - PIDRLocation: { - Type: schema.TypeString, - Computed: true, + Attr_Location: { + Computed: true, + Description: "The region zone of the location.", + Type: schema.TypeString, }, }, }, + Type: schema.TypeList, }, }, } @@ -58,7 +61,7 @@ func dataSourceIBMPIDisasterRecoveryLocation(ctx context.Context, d *schema.Reso return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) drClient := instance.NewIBMPIDisasterRecoveryLocationClient(ctx, sess, cloudInstanceID) drLocationSite, err := drClient.Get() if err != nil { @@ -69,8 +72,8 @@ func dataSourceIBMPIDisasterRecoveryLocation(ctx context.Context, d *schema.Reso for _, i := range drLocationSite.ReplicationSites { if i != nil { l := map[string]interface{}{ - "is_active": i.IsActive, - PIDRLocation: i.Location, + Attr_IsActive: i.IsActive, + Attr_Location: i.Location, } result = append(result, l) } @@ -78,8 +81,8 @@ func dataSourceIBMPIDisasterRecoveryLocation(ctx context.Context, d *schema.Reso var clientgenU, _ = uuid.GenerateUUID() d.SetId(clientgenU) - d.Set(PIDRLocation, drLocationSite.Location) - d.Set("replication_sites", result) + d.Set(Attr_Location, drLocationSite.Location) + d.Set(Attr_ReplicationSites, result) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_disaster_recovery_location_test.go b/ibm/service/power/data_source_ibm_pi_disaster_recovery_location_test.go index 561a451c2a..ef7f68307e 100644 --- a/ibm/service/power/data_source_ibm_pi_disaster_recovery_location_test.go +++ b/ibm/service/power/data_source_ibm_pi_disaster_recovery_location_test.go @@ -30,8 +30,7 @@ func TestAccIBMPIDisasterRecoveryLocationDataSourceBasic(t *testing.T) { func testAccCheckIBMPIDisasterRecoveryLocationDataSourceConfig() string { return fmt.Sprintf(` -data "ibm_pi_disaster_recovery_location" "testacc_disaster_recovery_location" { - pi_cloud_instance_id = "%s" -}`, acc.Pi_cloud_instance_id) - + data "ibm_pi_disaster_recovery_location" "testacc_disaster_recovery_location" { + pi_cloud_instance_id = "%s" + }`, acc.Pi_cloud_instance_id) } diff --git a/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations.go b/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations.go index 49d77fe170..c838348000 100644 --- a/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations.go +++ b/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations.go @@ -6,45 +6,46 @@ package power import ( "context" + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/power-go-client/clients/instance" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) func DataSourceIBMPIDisasterRecoveryLocations() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIDisasterRecoveryLocations, Schema: map[string]*schema.Schema{ - - // Computed Attributes - "disaster_recovery_locations": { + // Attributes + Attr_DisasterRecoveryLocations: { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - PIDRLocation: { - Type: schema.TypeString, + Attr_Location: { Computed: true, - Description: "RegionZone of a site", + Description: "The region zone of a site.", + Type: schema.TypeString, }, - "replication_sites": { - Type: schema.TypeList, - Computed: true, + Attr_ReplicationSites: { + Computed: true, + Description: "List of Replication Sites.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "is_active": { - Type: schema.TypeBool, - Computed: true, + Attr_IsActive: { + Computed: true, + Description: "Indicates the location is active or not, true if location is active, otherwise it is false.", + Type: schema.TypeBool, }, - PIDRLocation: { - Type: schema.TypeString, - Computed: true, + Attr_Location: { + Computed: true, + Description: "The region zone of the location.", + Type: schema.TypeString, }, }, }, + Type: schema.TypeList, }, }, }, @@ -72,15 +73,15 @@ func dataSourceIBMPIDisasterRecoveryLocations(ctx context.Context, d *schema.Res for _, j := range i.ReplicationSites { if j != nil { r := map[string]interface{}{ - "is_active": j.IsActive, - PIDRLocation: j.Location, + Attr_IsActive: j.IsActive, + Attr_Location: j.Location, } replicationSites = append(replicationSites, r) } } l := map[string]interface{}{ - "location": i.Location, - "replication_sites": replicationSites, + Attr_Location: i.Location, + Attr_ReplicationSites: replicationSites, } results = append(results, l) } @@ -88,7 +89,7 @@ func dataSourceIBMPIDisasterRecoveryLocations(ctx context.Context, d *schema.Res var clientgenU, _ = uuid.GenerateUUID() d.SetId(clientgenU) - d.Set("disaster_recovery_locations", results) + d.Set(Attr_DisasterRecoveryLocations, results) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations_test.go b/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations_test.go index 6320f451b3..49b3e3b47f 100644 --- a/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations_test.go +++ b/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations_test.go @@ -27,5 +27,5 @@ func TestAccIBMPIDisasterRecoveryLocationsDataSourceBasic(t *testing.T) { } func testAccCheckIBMPIDisasterRecoveryLocationsDataSourceConfig() string { - return "data \"ibm_pi_disaster_recovery_locations\" \"testacc_disaster_recovery_locations\" {}" + return `data "ibm_pi_disaster_recovery_locations" "testacc_disaster_recovery_locations" {}` } diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index 8e66a4bd83..dcf14dcb14 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -10,11 +10,15 @@ const ( Arg_KeyName = "pi_key_name" Arg_Key = "pi_ssh_key" - Attr_KeyID = "key_id" - Attr_Keys = "keys" - Attr_KeyCreationDate = "creation_date" - Attr_Key = "ssh_key" - Attr_KeyName = "name" + Attr_KeyID = "key_id" + Attr_Keys = "keys" + Attr_KeyCreationDate = "creation_date" + Attr_Key = "ssh_key" + Attr_KeyName = "name" + Attr_Location = "location" + Attr_ReplicationSites = "replication_sites" + Attr_IsActive = "is_active" + Attr_DisasterRecoveryLocations = "disaster_recovery_locations" // SAP Profile PISAPProfiles = "profiles" diff --git a/website/docs/d/pi_disaster_recovery_location.html.markdown b/website/docs/d/pi_disaster_recovery_location.html.markdown index 171b827268..300c4c1591 100644 --- a/website/docs/d/pi_disaster_recovery_location.html.markdown +++ b/website/docs/d/pi_disaster_recovery_location.html.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_disaster_recovery_location" @@ -18,20 +17,21 @@ data "ibm_pi_disaster_recovery_location" "ds_disaster_recovery_location" { pi_cloud_instance_id = "49fba6c9-23f8-40bc-9899-aca322ee7d5b" } ``` + **Notes** -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` - Example usage: +Example usage: ```terraform provider "ibm" { region = "lon" zone = "lon04" } ``` - + ## Argument reference Review the argument references that you can specify for your data source. @@ -41,8 +41,8 @@ Review the argument references that you can specify for your data source. In addition to all argument reference list, you can access the following attribute references after your data source is created. - `location` - (String) The region zone of a site. -- `replication_sites` - List of replication sites. +- `replication_sites` - (List) List of replication sites. Nested scheme for `replication_sites`: - - `is_active` - (Boolean) Indicates the location is active or not, `true` if location is active , otherwise it is `false`. - - `location` - (String) The region zone of the location. \ No newline at end of file + - `is_active` - (Bool) Indicates the location is active or not, `true` if location is active , otherwise it is `false`. + - `location` - (String) The region zone of the location. diff --git a/website/docs/d/pi_disaster_recovery_locations.html.markdown b/website/docs/d/pi_disaster_recovery_locations.html.markdown index 412e73a193..4cb52f6ea8 100644 --- a/website/docs/d/pi_disaster_recovery_locations.html.markdown +++ b/website/docs/d/pi_disaster_recovery_locations.html.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_disaster_recovery_locations" @@ -16,13 +15,14 @@ The following example retrieves information about the disaster recovery location ```terraform data "ibm_pi_disaster_recovery_locations" "ds_disaster_recovery_locations" {} ``` + **Notes** -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` - Example usage: +Example usage: ```terraform provider "ibm" { region = "lon" @@ -39,6 +39,6 @@ In addition to all argument reference list, you can access the following attribu - `location` - (String) The region zone of a site. - `replication_sites` - List of Replication Sites. - Nested scheme for `replication_sites`: - - `is_active` - (Boolean) Indicates the location is active or not, `true` if location is active, otherwise it is `false`. - - `location` - (String) The region zone of the location. \ No newline at end of file + Nested scheme for `replication_sites`: + - `is_active` - (Bool) Indicates the location is active or not, `true` if location is active, otherwise it is `false`. + - `location` - (String) The region zone of the location. From 0c59add1c170e7d0f1d977cf78e957ba8ef8bb9b Mon Sep 17 00:00:00 2001 From: Diptipowervs Date: Fri, 5 Jan 2024 15:33:29 +0530 Subject: [PATCH 2/3] Pull ibm_ pi_constants.go from constant-refactor --- ibm/service/power/ibm_pi_constants.go | 322 +++++++++++++++++++++----- 1 file changed, 266 insertions(+), 56 deletions(-) diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index dcf14dcb14..71e084f5db 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -3,22 +3,253 @@ package power import "time" const ( - // used by all - Arg_CloudInstanceID = "pi_cloud_instance_id" - - // Keys - Arg_KeyName = "pi_key_name" - Arg_Key = "pi_ssh_key" - - Attr_KeyID = "key_id" - Attr_Keys = "keys" - Attr_KeyCreationDate = "creation_date" - Attr_Key = "ssh_key" - Attr_KeyName = "name" - Attr_Location = "location" - Attr_ReplicationSites = "replication_sites" - Attr_IsActive = "is_active" - Attr_DisasterRecoveryLocations = "disaster_recovery_locations" + // Arguments + Arg_CloudConnectionName = "pi_cloud_connection_name" + Arg_CloudInstanceID = "pi_cloud_instance_id" + Arg_ImageName = "pi_image_name" + Arg_InstanceName = "pi_instance_name" + Arg_Key = "pi_ssh_key" + Arg_KeyName = "pi_key_name" + Arg_NetworkName = "pi_network_name" + Arg_PlacementGroupName = "pi_placement_group_name" + Arg_SAP = "sap" + Arg_SAPProfileID = "pi_sap_profile_id" + Arg_SPPPlacementGroupID = "pi_spp_placement_group_id" + Arg_SPPPlacementGroupName = "pi_spp_placement_group_name" + Arg_SPPPlacementGroupPolicy = "pi_spp_placement_group_policy" + Arg_SharedProcessorPoolHostGroup = "pi_shared_processor_pool_host_group" + Arg_SharedProcessorPoolID = "pi_shared_processor_pool_id" + Arg_SharedProcessorPoolName = "pi_shared_processor_pool_name" + Arg_SharedProcessorPoolPlacementGroupID = "pi_shared_processor_pool_placement_group_id" + Arg_SharedProcessorPoolReservedCores = "pi_shared_processor_pool_reserved_cores" + Arg_StoragePool = "pi_storage_pool" + Arg_StorageType = "pi_storage_type" + Arg_VTL = "vtl" + Arg_VolumeGroupID = "pi_volume_group_id" + Arg_VolumeID = "pi_volume_id" + Arg_VolumeOnboardingID = "pi_volume_onboarding_id" + + // Attributes + Attr_AccessConfig = "access_config" + Attr_Action = "action" + Attr_Addresses = "addresses" + Attr_AllocatedCores = "allocated_cores" + Attr_Architecture = "architecture" + Attr_Auxiliary = "auxiliary" + Attr_AuxiliaryChangedVolumeName = "auxiliary_changed_volume_name" + Attr_AuxiliaryVolumeName = "auxiliary_volume_name" + Attr_AvailabilityZone = "availability_zone" + Attr_AvailableCores = "available_cores" + Attr_AvailableIPCount = "available_ip_count" + Attr_BootVolumeID = "boot_volume_id" + Attr_Bootable = "bootable" + Attr_CIDR = "cidr" + Attr_CPUs = "cpus" + Attr_CRN = "crn" + Attr_Capabilities = "capabilities" + Attr_Capacity = "capacity" + Attr_Certified = "certified" + Attr_ClassicEnabled = "classic_enabled" + Attr_CloudConnectionID = "cloud_connection_id" + Attr_CloudInstanceID = "cloud_instance_id" + Attr_CloudInstances = "cloud_instances" + Attr_Code = "code" + Attr_ConnectionMode = "connection_mode" + Attr_Connections = "connections" + Attr_ConsistencyGroupName = "consistency_group_name" + Attr_ConsoleLanguages = "console_languages" + Attr_ContainerFormat = "container_format" + Attr_CopyRate = "copy_rate" + Attr_CopyType = "copy_type" + Attr_CoreMemoryRatio = "core_memory_ratio" + Attr_Cores = "cores" + Attr_CreateTime = "create_time" + Attr_CreationDate = "creation_date" + Attr_CyclePeriodSeconds = "cycle_period_seconds" + Attr_CyclingMode = "cycling_mode" + Attr_DNS = "dns" + Attr_Datacenters = "datacenters" + Attr_Default = "default" + Attr_DeploymentType = "deployment_type" + Attr_Description = "description" + Attr_DisasterRecoveryLocations = "disaster_recovery_locations" + Attr_DiskFormat = "disk_format" + Attr_DiskType = "disk_type" + Attr_Enabled = "enabled" + Attr_Endianness = "endianness" + Attr_ExternalIP = "external_ip" + Attr_FailureMessage = "failure_message" + Attr_FlashCopyMappings = "flash_copy_mappings" + Attr_FlashCopyName = "flash_copy_name" + Attr_FreezeTime = "freeze_time" + Attr_Gateway = "gateway" + Attr_GlobalRouting = "global_routing" + Attr_GreDestinationAddress = "gre_destination_address" + Attr_GreSourceAddress = "gre_source_address" + Attr_GroupID = "group_id" + Attr_HealthStatus = "health_status" + Attr_HostID = "host_id" + Attr_Href = "href" + Attr_Hypervisor = "hypervisor" + Attr_HypervisorType = "hypervisor_type" + Attr_IBMIPAddress = "ibm_ip_address" + Attr_ID = "id" + Attr_IP = "ip" + Attr_IPAddress = "ipaddress" + Attr_IPOctet = "ipoctet" + Attr_ImageID = "image_id" + Attr_ImageInfo = "image_info" + Attr_ImageType = "image_type" + Attr_Images = "images" + Attr_InputVolumes = "input_volumes" + Attr_InstanceSnapshots = "instance_snapshots" + Attr_InstanceVolumes = "instance_volumes" + Attr_Instances = "instances" + Attr_IsActive = "is_active" + Attr_Jumbo = "jumbo" + Attr_Key = "key" + Attr_KeyCreationDate = "creation_date" + Attr_KeyID = "key_id" + Attr_KeyName = "name" + Attr_Keys = "keys" + Attr_Language = "language" + Attr_LastUpdateDate = "last_update_date" + Attr_LastUpdatedDate = "last_updated_date" + Attr_Leases = "leases" + Attr_LicenseRepositoryCapacity = "license_repository_capacity" + Attr_Location = "location" + Attr_MTU = "mtu" + Attr_MacAddress = "macaddress" + Attr_MasterChangedVolumeName = "master_changed_volume_name" + Attr_MasterVolumeName = "master_volume_name" + Attr_Max = "max" + Attr_MaxAllocationSize = "max_allocation_size" + Attr_MaxAvailable = "max_available" + Attr_MaxCoresAvailable = "max_cores_available" + Attr_MaxMem = "maxmem" + Attr_MaxMemoryAvailable = "max_memory_available" + Attr_MaxProc = "maxproc" + Attr_MaxVirtualCores = "max_virtual_cores" + Attr_MaximumStorageAllocation = "max_storage_allocation" + Attr_Members = "members" + Attr_Memory = "memory" + Attr_Message = "message" + Attr_Metered = "metered" + Attr_Min = "min" + Attr_MinMem = "minmem" + Attr_MinProc = "minproc" + Attr_MinVirtualCores = "min_virtual_cores" + Attr_MirroringState = "mirroring_state" + Attr_Name = "name" + Attr_NetworkID = "network_id" + Attr_NetworkName = "network_name" + Attr_NetworkPorts = "network_ports" + Attr_Networks = "networks" + Attr_NumberOfVolumes = "number_of_volumes" + Attr_Onboardings = "onboardings" + Attr_OperatingSystem = "operating_system" + Attr_PVMInstanceID = "pvm_instance_id" + Attr_PVMInstances = "pvm_instances" + Attr_PVMSnapshots = "pvm_snapshots" + Attr_PercentComplete = "percent_complete" + Attr_PinPolicy = "pin_policy" + Attr_PlacementGroupID = "placement_group_id" + Attr_PlacementGroups = "placement_groups" + Attr_Policy = "policy" + Attr_Pool = "pool" + Attr_PoolName = "pool_name" + Attr_Port = "port" + Attr_PortID = "portid" + Attr_PrimaryRole = "primary_role" + Attr_ProcType = "proctype" + Attr_Processors = "processors" + Attr_ProfileID = "profile_id" + Attr_Profiles = "profiles" + Attr_Progress = "progress" + Attr_PublicIP = "public_ip" + Attr_Region = "region" + Attr_RemoteCopyID = "remote_copy_id" + Attr_RemoteCopyRelationshipNames = "remote_copy_relationship_names" + Attr_RemoteCopyRelationships = "remote_copy_relationships" + Attr_ReplicationEnabled = "replication_enabled" + Attr_ReplicationSites = "replication_sites" + Attr_ReplicationStatus = "replication_status" + Attr_ReplicationType = "replication_type" + Attr_ReservedCores = "reserved_cores" + Attr_ResultsOnboardedVolumes = "results_onboarded_volumes" + Attr_ResultsVolumeOnboardingFailures = "results_volume_onboarding_failures" + Attr_SPPPlacementGroups = "spp_placement_groups" + Attr_SSHKey = "ssh_key" + Attr_Shareable = "shreable" + Attr_SharedCoreRatio = "shared_core_ratio" + Attr_SharedProcessorPool = "shared_processor_pool" + Attr_SharedProcessorPoolID = "shared_processor_pool_id" + Attr_SharedProcessorPoolPlacementGroups = "spp_placement_groups" + Attr_SharedProcessorPoolStatus = "status" + Attr_SharedProcessorPools = "shared_processor_pools" + Attr_Size = "size" + Attr_SourceVolumeName = "source_volume_name" + Attr_Speed = "speed" + Attr_StartTime = "start_time" + Attr_State = "state" + Attr_Status = "status" + Attr_StatusDescriptionErrors = "status_description_errors" + Attr_StatusDetail = "status_detail" + Attr_StoragePool = "storage_pool" + Attr_StoragePoolAffinity = "storage_pool_affinity" + Attr_StoragePoolsCapacity = "storage_pools_capacity" + Attr_StorageType = "storage_type" + Attr_StorageTypesCapacity = "storage_types_capacity" + Attr_Synchronized = "synchronized" + Attr_SysType = "systype" + Attr_SystemPoolName = "system_pool_name" + Attr_SystemPools = "system_pools" + Attr_Systems = "systems" + Attr_TargetVolumeName = "target_volume_name" + Attr_TenantID = "tenant_id" + Attr_TenantName = "tenant_name" + Attr_TotalCapacity = "total_capacity" + Attr_TotalInstances = "total_instances" + Attr_TotalMemoryConsumed = "total_memory_consumed" + Attr_TotalProcessorsConsumed = "total_processors_consumed" + Attr_TotalSSDStorageConsumed = "total_ssd_storage_consumed" + Attr_TotalStandardStorageConsumed = "total_standard_storage_consumed" + Attr_Type = "type" + Attr_URL = "url" + Attr_Uncapped = "uncapped" + Attr_UsedIPCount = "used_ip_count" + Attr_UsedIPPercent = "used_ip_percent" + Attr_UserIPAddress = "user_ip_address" + Attr_VCPUs = "vcpus" + Attr_VLanID = "vlan_id" + Attr_VPCCRNs = "vpc_crns" + Attr_VPCEnabled = "vpc_enabled" + Attr_VirtualCoresAssigned = "virtual_cores_assigned" + Attr_VolumeGroupName = "volume_group_name" + Attr_VolumeGroups = "volume_groups" + Attr_VolumeIDs = "volume_ids" + Attr_VolumePool = "volume_pool" + Attr_VolumeSnapshots = "volume_snapshots" + Attr_Volumes = "volumes" + Attr_WWN = "wwn" + Attr_Workspaces = "workspaces" + Attr_SharedProcessorPoolName = "name" + Attr_SharedProcessorPoolHostID = "host_id" + Attr_SharedProcessorPoolReservedCores = "reserved_cores" + Attr_SharedProcessorPoolAvailableCores = "available_cores" + Attr_SharedProcessorPoolAllocatedCores = "allocated_cores" + Attr_SharedProcessorPoolStatusDetail = "status_detail" + Attr_SharedProcessorPoolInstances = "instances" + Attr_SharedProcessorPoolInstanceCpus = "cpus" + Attr_SharedProcessorPoolInstanceUncapped = "uncapped" + Attr_SharedProcessorPoolInstanceAvailabilityZone = "availability_zone" + Attr_SharedProcessorPoolInstanceId = "id" + Attr_SharedProcessorPoolInstanceMemory = "memory" + Attr_SharedProcessorPoolInstanceName = "name" + Attr_SharedProcessorPoolInstanceStatus = "status" + Attr_SharedProcessorPoolInstanceVcpus = "vcpus" + Arg_PIInstanceSharedProcessorPool = "pi_shared_processor_pool" + // TODO: Second Half Cleanup, remove extra variables // SAP Profile PISAPProfiles = "profiles" @@ -51,10 +282,6 @@ const ( Arg_PVMInstanceActionType = "pi_action" Arg_PVMInstanceHealthStatus = "pi_health_status" - Attr_Status = "status" - Attr_Progress = "progress" - Attr_HealthStatus = "health_status" - PVMInstanceHealthOk = "OK" PVMInstanceHealthWarning = "WARNING" @@ -62,14 +289,24 @@ const ( warningTimeOut = 60 * time.Second activeTimeOut = 2 * time.Minute // power service instance capabilities - CUSTOM_VIRTUAL_CORES = "custom-virtualcores" - PIInstanceDeploymentType = "pi_deployment_type" - PIInstanceNetwork = "pi_network" - PIInstanceStoragePool = "pi_storage_pool" - PISAPInstanceProfileID = "pi_sap_profile_id" - PISAPInstanceDeploymentType = "pi_sap_deployment_type" - PIInstanceStoragePoolAffinity = "pi_storage_pool_affinity" - Arg_PIInstanceSharedProcessorPool = "pi_shared_processor_pool" + CUSTOM_VIRTUAL_CORES = "custom-virtualcores" + + //Arg_CloudInstanceID = "pi_cloud_instance_id" + PIInstanceDeploymentType = "pi_deployment_type" + PIInstanceMigratable = "pi_migratable" + PIInstanceNetwork = "pi_network" + PIInstanceLicenseRepositoryCapacity = "pi_license_repository_capacity" + PIInstanceStoragePool = "pi_storage_pool" + PIInstanceStorageType = "pi_storage_type" + PISAPInstanceProfileID = "pi_sap_profile_id" + PISAPInstanceDeploymentType = "pi_sap_deployment_type" + PIInstanceSharedProcessorPool = "pi_shared_processor_pool" + PIInstanceStorageConnection = "pi_storage_connection" + PIInstanceStoragePoolAffinity = "pi_storage_pool_affinity" + + PIInstanceUserData = "pi_user_data" + PIInstanceVolumeIds = "pi_volume_ids" + Attr_PIInstanceSharedProcessorPool = "shared_processor_pool" Attr_PIInstanceSharedProcessorPoolID = "shared_processor_pool_id" @@ -108,37 +345,10 @@ const ( // Cloud Connections PICloudConnectionTransitEnabled = "pi_cloud_connection_transit_enabled" - // Shared Processor Pool - Arg_SharedProcessorPoolName = "pi_shared_processor_pool_name" - Arg_SharedProcessorPoolHostGroup = "pi_shared_processor_pool_host_group" - Arg_SharedProcessorPoolPlacementGroupID = "pi_shared_processor_pool_placement_group_id" - Arg_SharedProcessorPoolReservedCores = "pi_shared_processor_pool_reserved_cores" - Arg_SharedProcessorPoolID = "pi_shared_processor_pool_id" - Attr_SharedProcessorPoolID = "shared_processor_pool_id" - Attr_SharedProcessorPoolName = "name" - Attr_SharedProcessorPoolReservedCores = "reserved_cores" - Attr_SharedProcessorPoolAvailableCores = "available_cores" - Attr_SharedProcessorPoolAllocatedCores = "allocated_cores" - Attr_SharedProcessorPoolHostID = "host_id" - Attr_SharedProcessorPoolStatus = "status" - Attr_SharedProcessorPoolStatusDetail = "status_detail" - Attr_SharedProcessorPoolPlacementGroups = "spp_placement_groups" - Attr_SharedProcessorPoolInstances = "instances" - Attr_SharedProcessorPoolInstanceCpus = "cpus" - Attr_SharedProcessorPoolInstanceUncapped = "uncapped" - Attr_SharedProcessorPoolInstanceAvailabilityZone = "availability_zone" - Attr_SharedProcessorPoolInstanceId = "id" - Attr_SharedProcessorPoolInstanceMemory = "memory" - Attr_SharedProcessorPoolInstanceName = "name" - Attr_SharedProcessorPoolInstanceStatus = "status" - Attr_SharedProcessorPoolInstanceVcpus = "vcpus" - // SPP Placement Group - Arg_SPPPlacementGroupName = "pi_spp_placement_group_name" - Arg_SPPPlacementGroupPolicy = "pi_spp_placement_group_policy" + Attr_SPPPlacementGroupID = "spp_placement_group_id" Attr_SPPPlacementGroupMembers = "members" - Arg_SPPPlacementGroupID = "pi_spp_placement_group_id" Attr_SPPPlacementGroupPolicy = "policy" Attr_SPPPlacementGroupName = "name" From 2ff21d44944c838f13aada8655164a1ee317f2cd Mon Sep 17 00:00:00 2001 From: Diptipowervs <152427968+Diptipowervs@users.noreply.github.com> Date: Thu, 18 Jan 2024 20:54:01 +0530 Subject: [PATCH 3/3] Apply suggestions from code review Add Boolean in place of bool Co-authored-by: michaelkad <45772690+michaelkad@users.noreply.github.com> --- website/docs/d/pi_disaster_recovery_location.html.markdown | 2 +- website/docs/d/pi_disaster_recovery_locations.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/d/pi_disaster_recovery_location.html.markdown b/website/docs/d/pi_disaster_recovery_location.html.markdown index 300c4c1591..60e7415568 100644 --- a/website/docs/d/pi_disaster_recovery_location.html.markdown +++ b/website/docs/d/pi_disaster_recovery_location.html.markdown @@ -44,5 +44,5 @@ In addition to all argument reference list, you can access the following attribu - `replication_sites` - (List) List of replication sites. Nested scheme for `replication_sites`: - - `is_active` - (Bool) Indicates the location is active or not, `true` if location is active , otherwise it is `false`. + - `is_active` - (Boolean) Indicates the location is active or not, `true` if location is active , otherwise it is `false`. - `location` - (String) The region zone of the location. diff --git a/website/docs/d/pi_disaster_recovery_locations.html.markdown b/website/docs/d/pi_disaster_recovery_locations.html.markdown index 4cb52f6ea8..6ed0e43817 100644 --- a/website/docs/d/pi_disaster_recovery_locations.html.markdown +++ b/website/docs/d/pi_disaster_recovery_locations.html.markdown @@ -40,5 +40,5 @@ In addition to all argument reference list, you can access the following attribu - `replication_sites` - List of Replication Sites. Nested scheme for `replication_sites`: - - `is_active` - (Bool) Indicates the location is active or not, `true` if location is active, otherwise it is `false`. + - `is_active` - (Boolean) Indicates the location is active or not, `true` if location is active, otherwise it is `false`. - `location` - (String) The region zone of the location.