Skip to content

Commit f354707

Browse files
Fangyan Xusahilg11
authored andcommitted
Added - ShapeConfig in List Shape in Core service
1 parent b9cd393 commit f354707

13 files changed

+141
-27
lines changed

internal/integrationtest/core_drg_attachment_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ func drgAttachmentSweepResponseFetchOperation(client *tf_client.OracleClients, r
428428
}
429429

430430
// Adding a test case for testing the Update request. Updating both drg_route_table_id from and route_table_id simultaneously.
431+
// issue-routing-tag: core/computeSharedOwnershipVmAndBm
431432
func TestCoreDrgAttachmentUpdateRequest_basic(t *testing.T) {
432433
httpreplay.SetScenario("TestCoreDrgAttachmentResource_basic")
433434
defer httpreplay.SaveScenario()

internal/integrationtest/core_instance_resource_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,7 @@ func TestAccResourceCoreInstance_BM_Milan_instance_resource(t *testing.T) {
17001700
})
17011701
}
17021702

1703+
// issue-routing-tag: core/computeSharedOwnershipVmAndBm
17031704
func TestAccResourceCoreInstance_BM_Rome_shielded_instance_resource(t *testing.T) {
17041705
if strings.Contains(utils.GetEnvSettingWithBlankDefault("suppressed_tests"), "TestAccResourceCoreInstance_BM_Rome_shielded_instance_resource") {
17051706
t.Skip("Skipping suppressed TestAccResourceCoreInstance_BM_Rome_shielded_instance_resource")
@@ -1808,6 +1809,7 @@ func TestAccResourceCoreInstance_BM_Rome_shielded_instance_resource(t *testing.T
18081809
})
18091810
}
18101811

1812+
// issue-routing-tag: core/computeSharedOwnershipVmAndBm
18111813
func TestAccResourceCoreInstance_BM_Skylake_shielded_instance_resource(t *testing.T) {
18121814
if strings.Contains(utils.GetEnvSettingWithBlankDefault("suppressed_tests"), "TestAccResourceCoreInstance_BM_Skylake_shielded_instance_resource") {
18131815
t.Skip("Skipping suppressed TestAccResourceCoreInstance_BM_Skylake_shielded_instance_resource")
@@ -1916,6 +1918,7 @@ func TestAccResourceCoreInstance_BM_Skylake_shielded_instance_resource(t *testin
19161918
})
19171919
}
19181920

1921+
// issue-routing-tag: core/computeSharedOwnershipVmAndBm
19191922
func TestAccResourceCoreInstance_VM_Intel_shielded_instance_resource(t *testing.T) {
19201923
if strings.Contains(utils.GetEnvSettingWithBlankDefault("suppressed_tests"), "TestAccResourceCoreInstance_VM_Intel_shielded_instance_resource") {
19211924
t.Skip("Skipping suppressed TestAccResourceCoreInstance_VM_Intel_shielded_instance_resource")
@@ -2024,6 +2027,7 @@ func TestAccResourceCoreInstance_VM_Intel_shielded_instance_resource(t *testing.
20242027
})
20252028
}
20262029

2030+
// issue-routing-tag: core/computeSharedOwnershipVmAndBm
20272031
func TestAccResourceCoreInstance_VM_Amd_shielded_instance_resource(t *testing.T) {
20282032
if strings.Contains(utils.GetEnvSettingWithBlankDefault("suppressed_tests"), "TestAccResourceCoreInstance_VM_Amd_shielded_instance_resource") {
20292033
t.Skip("Skipping suppressed TestAccResourceCoreInstance_VM_Amd_shielded_instance_resource")

internal/integrationtest/core_shape_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ func TestCoreShapeResource_basic(t *testing.T) {
8989
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId),
9090

9191
resource.TestCheckResourceAttrSet(datasourceName, "shapes.#"),
92+
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.billing_type"),
9293
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.gpus"),
9394
//resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.local_disk_description"),
95+
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.is_billed_for_stopped_instance"),
96+
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.is_flexible"),
9497
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.is_live_migration_supported"),
98+
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.is_subcore"),
9599
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.local_disks"),
96100
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.local_disks_total_size_in_gbs"),
97101
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.max_vnic_attachments"),
@@ -100,6 +104,9 @@ func TestCoreShapeResource_basic(t *testing.T) {
100104
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.networking_bandwidth_in_gbps"),
101105
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.ocpus"),
102106
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.processor_description"),
107+
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.quota_names.#"),
108+
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.recommended_alternatives.#"),
109+
resource.TestCheckResourceAttrSet(datasourceName, "shapes.0.resize_compatible_shapes.#"),
103110
),
104111
},
105112

internal/integrationtest/core_volume_group_backup_copy_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var (
3838
volumeGroupBackupSourceDetailsRepresentation = map[string]interface{}{}
3939
)
4040

41+
// issue-routing-tag: core/computeSharedOwnershipVmAndBm
4142
func TestResourceCoreVolumeGroupBackup_copy(t *testing.T) {
4243
httpreplay.SetScenario("TestResourceCoreVolumeGroupBackup_copy")
4344
defer httpreplay.SaveScenario()

internal/service/core/core_shapes_data_source.go

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ func CoreShapesDataSource() *schema.Resource {
4848
Type: schema.TypeString,
4949
},
5050
},
51+
"billing_type": {
52+
Type: schema.TypeString,
53+
Computed: true,
54+
},
5155
"gpu_description": {
5256
Type: schema.TypeString,
5357
Computed: true,
@@ -56,10 +60,22 @@ func CoreShapesDataSource() *schema.Resource {
5660
Type: schema.TypeInt,
5761
Computed: true,
5862
},
63+
"is_billed_for_stopped_instance": {
64+
Type: schema.TypeBool,
65+
Computed: true,
66+
},
67+
"is_flexible": {
68+
Type: schema.TypeBool,
69+
Computed: true,
70+
},
5971
"is_live_migration_supported": {
6072
Type: schema.TypeBool,
6173
Computed: true,
6274
},
75+
"is_subcore": {
76+
Type: schema.TypeBool,
77+
Computed: true,
78+
},
6379
"local_disk_description": {
6480
Type: schema.TypeString,
6581
Computed: true,
@@ -335,6 +351,37 @@ func CoreShapesDataSource() *schema.Resource {
335351
Type: schema.TypeString,
336352
Computed: true,
337353
},
354+
"quota_names": {
355+
Type: schema.TypeList,
356+
Computed: true,
357+
Elem: &schema.Schema{
358+
Type: schema.TypeString,
359+
},
360+
},
361+
"recommended_alternatives": {
362+
Type: schema.TypeList,
363+
Computed: true,
364+
Elem: &schema.Resource{
365+
Schema: map[string]*schema.Schema{
366+
// Required
367+
368+
// Optional
369+
370+
// Computed
371+
"shape_name": {
372+
Type: schema.TypeString,
373+
Computed: true,
374+
},
375+
},
376+
},
377+
},
378+
"resize_compatible_shapes": {
379+
Type: schema.TypeList,
380+
Computed: true,
381+
Elem: &schema.Schema{
382+
Type: schema.TypeString,
383+
},
384+
},
338385
},
339386
},
340387
},
@@ -419,6 +466,8 @@ func (s *CoreShapesDataSourceCrud) SetData() error {
419466

420467
shape["baseline_ocpu_utilizations"] = bous
421468

469+
shape["billing_type"] = r.BillingType
470+
422471
if r.GpuDescription != nil {
423472
shape["gpu_description"] = *r.GpuDescription
424473
}
@@ -427,10 +476,22 @@ func (s *CoreShapesDataSourceCrud) SetData() error {
427476
shape["gpus"] = *r.Gpus
428477
}
429478

479+
if r.IsBilledForStoppedInstance != nil {
480+
shape["is_billed_for_stopped_instance"] = *r.IsBilledForStoppedInstance
481+
}
482+
483+
if r.IsFlexible != nil {
484+
shape["is_flexible"] = *r.IsFlexible
485+
}
486+
430487
if r.IsLiveMigrationSupported != nil {
431488
shape["is_live_migration_supported"] = *r.IsLiveMigrationSupported
432489
}
433490

491+
if r.IsSubcore != nil {
492+
shape["is_subcore"] = *r.IsSubcore
493+
}
494+
434495
if r.LocalDiskDescription != nil {
435496
shape["local_disk_description"] = *r.LocalDiskDescription
436497
}
@@ -501,6 +562,16 @@ func (s *CoreShapesDataSourceCrud) SetData() error {
501562
shape["processor_description"] = *r.ProcessorDescription
502563
}
503564

565+
shape["quota_names"] = r.QuotaNames
566+
567+
recommendedAlternatives := []interface{}{}
568+
for _, item := range r.RecommendedAlternatives {
569+
recommendedAlternatives = append(recommendedAlternatives, ShapeAlternativeObjectToMap(item))
570+
}
571+
shape["recommended_alternatives"] = recommendedAlternatives
572+
573+
shape["resize_compatible_shapes"] = r.ResizeCompatibleShapes
574+
504575
resources = append(resources, shape)
505576
}
506577

@@ -515,6 +586,16 @@ func (s *CoreShapesDataSourceCrud) SetData() error {
515586
return nil
516587
}
517588

589+
func ShapeAlternativeObjectToMap(obj oci_core.ShapeAlternativeObject) map[string]interface{} {
590+
result := map[string]interface{}{}
591+
592+
if obj.ShapeName != nil {
593+
result["shape_name"] = string(*obj.ShapeName)
594+
}
595+
596+
return result
597+
}
598+
518599
func ShapeMaxVnicAttachmentOptionsToMap(obj *oci_core.ShapeMaxVnicAttachmentOptions) map[string]interface{} {
519600
result := map[string]interface{}{}
520601

website/docs/d/core_instance_configuration.html.markdown

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ The following attributes are exported:
6565
Allowed values:
6666
* `0`: Represents Lower Cost option.
6767
* `10`: Represents Balanced option.
68-
* `20`: Represents Higher Performance option.
68+
* `20`: Represents Higher Performance option.
69+
70+
For performance autotune enabled volumes, It would be the Default(Minimum) VPUs/GB.
6971
* `volume_id` - The OCID of the volume.
7072
* `instance_type` - The type of instance details. Supported instanceType is compute
7173
* `launch_details` - Instance launch details for creating an instance from an instance configuration. Use the `sourceDetails` parameter to specify whether a boot volume or an image should be used to launch a new instance.
@@ -201,11 +203,11 @@ The following attributes are exported:
201203
If you provide the parameter, the instance is created with the platform configuration that you specify. For any values that you omit, the instance uses the default configuration values for the `shape` that you specify. If you don't provide the parameter, the default values for the `shape` are used.
202204

203205
Each shape only supports certain configurable values. If the values that you provide are not valid for the specified `shape`, an error is returned.
204-
* `is_measured_boot_enabled` - Whether the Measured Boot is to be enabled on the instance
205-
* `is_secure_boot_enabled` - Whether the Secure Boot is to be enabled on the instance
206-
* `is_trusted_platform_module_enabled` - Whether the Trusted Platform Module (TPM) is to be enabled on the instance
207-
* `numa_nodes_per_socket` - The number of NUMA nodes per socket.
208-
* `type` - The type of platform being configured. (Supported types=[INTEL_VM, AMD_MILAN_BM, AMD_ROME_BM, INTEL_SKYLAKE_BM])
206+
* `is_measured_boot_enabled` - Whether the Measured Boot feature is enabled on the instance.
207+
* `is_secure_boot_enabled` - Whether Secure Boot is enabled on the instance.
208+
* `is_trusted_platform_module_enabled` - Whether the Trusted Platform Module (TPM) is enabled on the instance.
209+
* `numa_nodes_per_socket` - The number of NUMA nodes per socket (NPS).
210+
* `type` - The type of platform being configured.
209211
* `preemptible_instance_config` - Configuration options for preemptible instances.
210212
* `preemption_action` - The action to run when the preemptible instance is interrupted for eviction.
211213
* `preserve_boot_volume` - Whether to preserve the boot volume that was used to launch the preemptible instance when the instance is terminated. Defaults to false if not specified.

website/docs/d/core_instance_configurations.html.markdown

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ The following attributes are exported:
7272
Allowed values:
7373
* `0`: Represents Lower Cost option.
7474
* `10`: Represents Balanced option.
75-
* `20`: Represents Higher Performance option.
75+
* `20`: Represents Higher Performance option.
76+
77+
For performance autotune enabled volumes, It would be the Default(Minimum) VPUs/GB.
7678
* `volume_id` - The OCID of the volume.
7779
* `instance_type` - The type of instance details. Supported instanceType is compute
7880
* `launch_details` - Instance launch details for creating an instance from an instance configuration. Use the `sourceDetails` parameter to specify whether a boot volume or an image should be used to launch a new instance.
@@ -208,11 +210,11 @@ The following attributes are exported:
208210
If you provide the parameter, the instance is created with the platform configuration that you specify. For any values that you omit, the instance uses the default configuration values for the `shape` that you specify. If you don't provide the parameter, the default values for the `shape` are used.
209211

210212
Each shape only supports certain configurable values. If the values that you provide are not valid for the specified `shape`, an error is returned.
211-
* `is_measured_boot_enabled` - Whether the Measured Boot is to be enabled on the instance
212-
* `is_secure_boot_enabled` - Whether the Secure Boot is to be enabled on the instance
213-
* `is_trusted_platform_module_enabled` - Whether the Trusted Platform Module (TPM) is to be enabled on the instance
214-
* `numa_nodes_per_socket` - The number of NUMA nodes per socket.
215-
* `type` - The type of platform being configured. (Supported types=[INTEL_VM, AMD_MILAN_BM, AMD_ROME_BM, INTEL_SKYLAKE_BM])
213+
* `is_measured_boot_enabled` - Whether the Measured Boot feature is enabled on the instance.
214+
* `is_secure_boot_enabled` - Whether Secure Boot is enabled on the instance.
215+
* `is_trusted_platform_module_enabled` - Whether the Trusted Platform Module (TPM) is enabled on the instance.
216+
* `numa_nodes_per_socket` - The number of NUMA nodes per socket (NPS).
217+
* `type` - The type of platform being configured.
216218
* `preemptible_instance_config` - Configuration options for preemptible instances.
217219
* `preemption_action` - The action to run when the preemptible instance is interrupted for eviction.
218220
* `preserve_boot_volume` - Whether to preserve the boot volume that was used to launch the preemptible instance when the instance is terminated. Defaults to false if not specified.

website/docs/d/core_internet_gateways.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ The following attributes are exported:
5656
* `id` - The internet gateway's Oracle ID ([OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)).
5757
* `state` - The internet gateway's current state.
5858
* `time_created` - The date and time the internet gateway was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z`
59-
* `vcn_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VCN the internet gateway belongs to.
59+
* `vcn_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VCN the Internet Gateway belongs to.
6060

website/docs/d/core_shapes.html.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,15 @@ The following attributes are exported:
4747
The following attributes are exported:
4848

4949
* `baseline_ocpu_utilizations` - For a subcore burstable VM, the supported baseline OCPU utilization for instances that use this shape.
50+
* `billing_type` - How instances that use this shape are charged.
5051
* `gpu_description` - A short description of the graphics processing unit (GPU) available for this shape.
5152

5253
If the shape does not have any GPUs, this field is `null`.
5354
* `gpus` - The number of GPUs available for this shape.
55+
* `is_billed_for_stopped_instance` - Whether billing continues when the instances that use this shape are in the stopped state.
56+
* `is_flexible` - Whether the shape supports creating flexible instances. A [flexible shape](https://docs.cloud.oracle.com/iaas/Content/Compute/References/computeshapes.htm#flexible) is a shape that lets you customize the number of OCPUs and the amount of memory when launching or resizing your instance.
5457
* `is_live_migration_supported` - Whether Live Migration is currently supported for this shape.
58+
* `is_subcore` - Whether the shape supports creating subcore or burstable instances. A [burstable instance](https://docs.cloud.oracle.com/iaas/Content/Compute/References/burstable-instances.htm) is a virtual machine (VM) instance that provides a baseline level of CPU performance with the ability to burst to a higher level to support occasional spikes in usage.
5559
* `local_disk_description` - A short description of the local disks available for this shape.
5660

5761
If the shape does not have any local disks, this field is `null`.
@@ -105,4 +109,8 @@ The following attributes are exported:
105109
* `is_default_enabled` - Indicates whether Trusted Platform Module is to be enabled by default
106110
* `type` - The type of platform being configured. (Supported types=[INTEL_VM, AMD_MILAN_BM, AMD_ROME_BM, INTEL_SKYLAKE_BM])
107111
* `processor_description` - A short description of the shape's processor (CPU).
112+
* `quota_names` - The list of of compartment quotas for the shape.
113+
* `recommended_alternatives` - The list of shapes and shape details (if applicable) that Oracle recommends that you use as an alternative to the current shape.
114+
* `shape_name` - The name of the shape.
115+
* `resize_compatible_shapes` - The list of compatible shapes that this shape can be changed to. For more information, see [Changing the Shape of an Instance](https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/resizinginstances.htm).
108116

website/docs/r/core_boot_volume.html.markdown

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The following arguments are supported:
6262
* `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}`
6363
* `display_name` - (Optional) (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
6464
* `freeform_tags` - (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
65-
* `is_auto_tune_enabled` - (Optional) (Updatable) Specifies whether the auto-tune performance is enabled for this boot volume. This field is deprecated. Use the `DetachedVolumeAutotunePolicy` instead to enable the volume for detached autotune.
65+
* `is_auto_tune_enabled` - (Optional) (Updatable) Specifies whether the auto-tune performance is enabled for this boot volume.
6666
* `kms_key_id` - (Optional) (Updatable) The OCID of the Key Management key to assign as the master encryption key for the boot volume.
6767
* `size_in_gbs` - (Optional) (Updatable) The size of the volume in GBs.
6868
* `source_details` - (Required)
@@ -72,7 +72,9 @@ The following arguments are supported:
7272

7373
Allowed values:
7474
* `10`: Represents Balanced option.
75-
* `20`: Represents Higher Performance option.
75+
* `20`: Represents Higher Performance option.
76+
77+
For performance autotune enabled volumes, It would be the Default(Minimum) VPUs/GB.
7678
* `boot_volume_replicas_deletion` - (Optional) (updatable) The boolean value, if you have replicas and want to disable replicas set this argument to true and remove `boot_volume_replicas` in representation at the same time. If you want to enable a new replicas, remove this argument and use `boot_volume_replicas` again.
7779

7880

@@ -95,7 +97,7 @@ The following attributes are exported:
9597
* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
9698
* `id` - The boot volume's Oracle ID (OCID).
9799
* `image_id` - The image OCID used to create the boot volume.
98-
* `is_auto_tune_enabled` - Specifies whether the auto-tune performance is enabled for this boot volume. This field is deprecated. Use the `DetachedVolumeAutotunePolicy` instead to enable the volume for detached autotune.
100+
* `is_auto_tune_enabled` - Specifies whether the auto-tune performance is enabled for this boot volume.
99101
* `is_hydrated` - Specifies whether the boot volume's data has finished copying from the source boot volume or boot volume backup.
100102
* `kms_key_id` - The OCID of the Key Management master encryption key assigned to the boot volume.
101103
* `size_in_gbs` - The size of the boot volume in GBs.
@@ -111,7 +113,9 @@ The following attributes are exported:
111113

112114
Allowed values:
113115
* `10`: Represents Balanced option.
114-
* `20`: Represents Higher Performance option.
116+
* `20`: Represents Higher Performance option.
117+
118+
For performance autotune enabled volumes, It would be the Default(Minimum) VPUs/GB.
115119
* `boot_volume_replicas_deletion` - The boolean value, if you have replicas and want to disable replicas set this argument to true and remove `boot_volume_replicas` in representation at the same time. If you want to enable a new replicas, remove this argument and use `boot_volume_replicas` again.
116120

117121
## Timeouts

0 commit comments

Comments
 (0)