diff --git a/ibm/service/power/data_source_ibm_pi_catalog_images.go b/ibm/service/power/data_source_ibm_pi_catalog_images.go index 62adf75a8e..e32f8d17ff 100644 --- a/ibm/service/power/data_source_ibm_pi_catalog_images.go +++ b/ibm/service/power/data_source_ibm_pi_catalog_images.go @@ -7,108 +7,125 @@ import ( "context" "time" + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "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" ) -/* -Datasource to get the list of images that are available when a power instance is created -*/ +// Datasource to list images that are available when a power instance is created func DataSourceIBMPICatalogImages() *schema.Resource { - return &schema.Resource{ ReadContext: dataSourceIBMPICatalogImagesRead, 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, }, - "sap": { - Type: schema.TypeBool, - Optional: true, + Arg_SAP: { + Description: "Set true to include SAP images. The default value is false.", + Optional: true, + Type: schema.TypeBool, }, - "vtl": { - Type: schema.TypeBool, - Optional: true, + Arg_VTL: { + Description: "Set true to include VTL images. The default value is false.", + Optional: true, + Type: schema.TypeBool, }, - "images": { - Type: schema.TypeList, - Computed: true, + + // Attributes + Attr_Images: { + Computed: true, + Description: "Lists all the images in the IBM Power Virtual Server Cloud.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "image_id": { - Type: schema.TypeString, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Computed: true, - }, - "state": { - Type: schema.TypeString, - Computed: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - "storage_type": { - Type: schema.TypeString, - Computed: true, - }, - "storage_pool": { - Type: schema.TypeString, - Computed: true, - }, - "creation_date": { - Type: schema.TypeString, - Computed: true, - }, - "last_update_date": { - Type: schema.TypeString, - Computed: true, - }, - "image_type": { - Type: schema.TypeString, - Computed: true, - }, - "container_format": { - Type: schema.TypeString, - Computed: true, - }, - "disk_format": { - Type: schema.TypeString, - Computed: true, - }, - "operating_system": { - Type: schema.TypeString, - Computed: true, - }, - "hypervisor_type": { - Type: schema.TypeString, - Computed: true, - }, - "architecture": { - Type: schema.TypeString, - Computed: true, - }, - "endianness": { - Type: schema.TypeString, - Computed: true, - }, - "href": { - Type: schema.TypeString, - Computed: true, + Attr_Architecture: { + Computed: true, + Description: "The CPU architecture that the image is designed for.", + Type: schema.TypeString, + }, + Attr_ContainerFormat: { + Computed: true, + Description: "The container format.", + Type: schema.TypeString, + }, + Attr_CreationDate: { + Computed: true, + Description: "Date of image creation", + Type: schema.TypeString, + }, + Attr_Description: { + Computed: true, + Description: "The description of an image.", + Type: schema.TypeString, + }, + Attr_DiskFormat: { + Computed: true, + Description: "The disk format.", + Type: schema.TypeString, + }, + Attr_Endianness: { + Computed: true, + Description: "The Endianness order.", + Type: schema.TypeString, + }, + Attr_Href: { + Computed: true, + Description: "The href of an image.", + Type: schema.TypeString, + }, + Attr_HypervisorType: { + Computed: true, + Description: "Hypervisor type.", + Type: schema.TypeString, + }, + Attr_ImageID: { + Computed: true, + Description: "The unique identifier of an image.", + Type: schema.TypeString, + }, + Attr_ImageType: { + Computed: true, + Description: "The identifier of this image type.", + Type: schema.TypeString, + }, + Attr_LastUpdateDate: { + Computed: true, + Description: "The last updated date of an image.", + Type: schema.TypeString, + }, + Attr_Name: { + Computed: true, + Description: "The name of the image.", + Type: schema.TypeString, + }, + Attr_OperatingSystem: { + Computed: true, + Description: "Operating System.", + Type: schema.TypeString, + }, + Attr_State: { + Computed: true, + Description: "The state of an Operating System.", + Type: schema.TypeString, + }, + Attr_StoragePool: { + Computed: true, + Description: "Storage pool where image resides.", + Type: schema.TypeString, + }, + Attr_StorageType: { + Computed: true, + Description: "The storage type of an image.", + Type: schema.TypeString, }, }, }, + Type: schema.TypeList, }, }, } @@ -120,13 +137,13 @@ func dataSourceIBMPICatalogImagesRead(ctx context.Context, d *schema.ResourceDat return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) includeSAP := false - if s, ok := d.GetOk("sap"); ok { + if s, ok := d.GetOk(Arg_SAP); ok { includeSAP = s.(bool) } includeVTL := false - if v, ok := d.GetOk("vtl"); ok { + if v, ok := d.GetOk(Arg_VTL); ok { includeVTL = v.(bool) } imageC := instance.NewIBMPIImageClient(ctx, sess, cloudInstanceID) @@ -138,57 +155,58 @@ func dataSourceIBMPICatalogImagesRead(ctx context.Context, d *schema.ResourceDat images := make([]map[string]interface{}, 0) for _, i := range stockImages.Images { image := make(map[string]interface{}) - image["image_id"] = *i.ImageID - image["name"] = *i.Name - if i.State != nil { - image["state"] = *i.State - } + image[Attr_ImageID] = *i.ImageID + image[Attr_Name] = *i.Name + if i.Description != nil { - image["description"] = *i.Description - } - if i.StorageType != nil { - image["storage_type"] = *i.StorageType - } - if i.StoragePool != nil { - image["storage_pool"] = *i.StoragePool + image[Attr_Description] = *i.Description } if i.CreationDate != nil { - image["creation_date"] = i.CreationDate.String() - } - if i.LastUpdateDate != nil { - image["last_update_date"] = i.LastUpdateDate.String() + image[Attr_CreationDate] = i.CreationDate.String() } if i.Href != nil { - image["href"] = *i.Href + image[Attr_Href] = *i.Href + } + if i.LastUpdateDate != nil { + image[Attr_LastUpdateDate] = i.LastUpdateDate.String() } if i.Specifications != nil { s := i.Specifications - if s.ImageType != "" { - image["image_type"] = s.ImageType + if s.Architecture != "" { + image[Attr_Architecture] = s.Architecture } if s.ContainerFormat != "" { - image["container_format"] = s.ContainerFormat + image[Attr_ContainerFormat] = s.ContainerFormat } if s.DiskFormat != "" { - image["disk_format"] = s.DiskFormat + image[Attr_DiskFormat] = s.DiskFormat } - if s.OperatingSystem != "" { - image["operating_system"] = s.OperatingSystem + if s.Endianness != "" { + image[Attr_Endianness] = s.Endianness } if s.HypervisorType != "" { - image["hypervisor_type"] = s.HypervisorType + image[Attr_HypervisorType] = s.HypervisorType } - if s.Architecture != "" { - image["architecture"] = s.Architecture + if s.ImageType != "" { + image[Attr_ImageType] = s.ImageType } - if s.Endianness != "" { - image["endianness"] = s.Endianness + if s.OperatingSystem != "" { + image[Attr_OperatingSystem] = s.OperatingSystem } } + if i.State != nil { + image[Attr_State] = *i.State + } + if i.StoragePool != nil { + image[Attr_StoragePool] = *i.StoragePool + } + if i.StorageType != nil { + image[Attr_StorageType] = *i.StorageType + } images = append(images, image) } d.SetId(time.Now().UTC().String()) - d.Set("images", images) - return nil + d.Set(Attr_Images, images) + return nil } diff --git a/ibm/service/power/data_source_ibm_pi_catalog_images_test.go b/ibm/service/power/data_source_ibm_pi_catalog_images_test.go index a18020ff3d..f317397229 100644 --- a/ibm/service/power/data_source_ibm_pi_catalog_images_test.go +++ b/ibm/service/power/data_source_ibm_pi_catalog_images_test.go @@ -14,38 +14,34 @@ import ( func testAccCheckIBMPICatalogImagesDataSourceBasicConfig() string { return fmt.Sprintf(` - data "ibm_pi_catalog_images" "power_catalog_images_basic" { - pi_cloud_instance_id = "%s" - } - `, acc.Pi_cloud_instance_id) + data "ibm_pi_catalog_images" "power_catalog_images_basic" { + pi_cloud_instance_id = "%s" + }`, acc.Pi_cloud_instance_id) } func testAccCheckIBMPICatalogImagesDataSourceSAPConfig() string { return fmt.Sprintf(` - data "ibm_pi_catalog_images" "power_catalog_images_sap" { - pi_cloud_instance_id = "%s" - sap = "true" - } - `, acc.Pi_cloud_instance_id) + data "ibm_pi_catalog_images" "power_catalog_images_sap" { + pi_cloud_instance_id = "%s" + sap = "true" + }`, acc.Pi_cloud_instance_id) } func testAccCheckIBMPICatalogImagesDataSourceVTLConfig() string { return fmt.Sprintf(` - data "ibm_pi_catalog_images" "power_catalog_images_vtl" { - pi_cloud_instance_id = "%s" - vtl = "true" - } - `, acc.Pi_cloud_instance_id) + data "ibm_pi_catalog_images" "power_catalog_images_vtl" { + pi_cloud_instance_id = "%s" + vtl = "true" + }`, acc.Pi_cloud_instance_id) } func testAccCheckIBMPICatalogImagesDataSourceSAP_And_VTLConfig() string { return fmt.Sprintf(` - data "ibm_pi_catalog_images" "power_catalog_images_sap_and_vtl" { - pi_cloud_instance_id = "%s" - sap = "true" - vtl = "true" - } - `, acc.Pi_cloud_instance_id) + data "ibm_pi_catalog_images" "power_catalog_images_sap_and_vtl" { + pi_cloud_instance_id = "%s" + sap = "true" + vtl = "true" + }`, acc.Pi_cloud_instance_id) } func TestAccIBMPICatalogImagesDataSourceBasic(t *testing.T) { diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index 8e66a4bd83..7229f23831 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -3,18 +3,238 @@ package power import "time" const ( - // used by all - Arg_CloudInstanceID = "pi_cloud_instance_id" + // 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" - // Keys - Arg_KeyName = "pi_key_name" - Arg_Key = "pi_ssh_key" + // 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_KeyID = "key_id" - Attr_Keys = "keys" - Attr_KeyCreationDate = "creation_date" - Attr_Key = "ssh_key" - Attr_KeyName = "name" + // TODO: Second Half Cleanup, remove extra variables // SAP Profile PISAPProfiles = "profiles" @@ -47,10 +267,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" @@ -58,14 +274,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" @@ -104,37 +330,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" diff --git a/website/docs/d/pi_catalog_images.html.markdown b/website/docs/d/pi_catalog_images.html.markdown index 8693c9e211..a40655476a 100644 --- a/website/docs/d/pi_catalog_images.html.markdown +++ b/website/docs/d/pi_catalog_images.html.markdown @@ -10,7 +10,7 @@ description: |- Retrieve the details of an image that you can use in your Power Systems Virtual Server instance for copying into IBM Cloud instances. For more information, about catalog images, see [provisioning a virtual server instance from a third-party image](https://cloud.ibm.com/docs/virtual-servers?topic=virtual-servers-ordering-3P). ## Example usage -The following example shows how to retrieve information by using `ibm_pi_catalog_images`. +The following example shows how to retrieve information using `ibm_pi_catalog_images`. ```terraform data "ibm_pi_catalog_images" "ds_images" { @@ -19,13 +19,12 @@ data "ibm_pi_catalog_images" "ds_images" { ``` **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` - - Example usage: +- 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: ```terraform provider "ibm" { region = "lon" @@ -46,18 +45,19 @@ In addition to the argument reference list, you can access the following attribu - `images`- (List) Lists all the images in the IBM Power Virtual Server Cloud. Nested scheme for `images`: - - `architecture` - (String) Architecture. - - `creation_date` - (String) The creation date of an image. + - `architecture` - (String) The CPU architecture that the image is designed for. + - `container_format` - (String) The container format. + - `creation_date` - (String) Date of image creation. - `description` - (String) The description of an image. - `disk_format` - (String) The disk format. - `endianness` - (String) The `Endianness` order. - - `hypervisor_type` - (String) Hypervisor type. - `href` - (String) The `href` of an image. + - `hypervisor_type` - (String) Hypervisor type. - `image_id` - (String) The unique identifier of an image. - - `image_type` - (String) The type of the format. + - `image_type` - (String) The identifier of this image type. - `last_update_date` - (String) The last updated date of an image. - `name` - (String) The name of the image. - `operating_system` - (String) Operating System. + - `state` - (String) The state of an Operating System. - `storage_pool` - (String) Storage pool where image resides. - `storage_type` - (String) The storage type of an image. - - `state` - (String) The state of an Operating System.