Skip to content

Commit

Permalink
Added acceptance test and maturity
Browse files Browse the repository at this point in the history
  • Loading branch information
SunithaGudisagarIBM1 committed Dec 2, 2024
1 parent 2a6e883 commit 0a960a0
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 65 deletions.
42 changes: 21 additions & 21 deletions common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -4243,7 +4243,7 @@ func (vpc *VpcV1) CreateImageWithContext(ctx context.Context, createImageOptions
}
builder.AddHeader("Accept", "application/json")
builder.AddHeader("Content-Type", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -4416,7 +4416,7 @@ func (vpc *VpcV1) DeleteImageWithContext(ctx context.Context, deleteImageOptions
for headerName, headerValue := range sdkHeaders {
builder.AddHeader(headerName, headerValue)
}

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -4617,7 +4617,7 @@ func (vpc *VpcV1) GetImageWithContext(ctx context.Context, getImageOptions *GetI
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -4836,7 +4836,7 @@ func (vpc *VpcV1) ListImageBareMetalServerProfilesWithContext(ctx context.Contex
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))
if listImageBareMetalServerProfilesOptions.Start != nil {
Expand Down Expand Up @@ -4996,7 +4996,7 @@ func (vpc *VpcV1) ListImageInstanceProfilesWithContext(ctx context.Context, list
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))
if listImageInstanceProfilesOptions.Start != nil {
Expand Down Expand Up @@ -5066,7 +5066,7 @@ func (vpc *VpcV1) ListImagesWithContext(ctx context.Context, listImagesOptions *
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))
if listImagesOptions.Start != nil {
Expand Down Expand Up @@ -5302,7 +5302,7 @@ func (vpc *VpcV1) UpdateImageWithContext(ctx context.Context, updateImageOptions
}
builder.AddHeader("Accept", "application/json")
builder.AddHeader("Content-Type", "application/merge-patch+json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -6011,7 +6011,7 @@ func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceO
}
builder.AddHeader("Accept", "application/json")
builder.AddHeader("Content-Type", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -7033,7 +7033,7 @@ func (vpc *VpcV1) GetInstanceWithContext(ctx context.Context, getInstanceOptions
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -8499,7 +8499,7 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))
if listInstancesOptions.Start != nil {
Expand Down Expand Up @@ -8700,7 +8700,7 @@ func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceO
if updateInstanceOptions.IfMatch != nil {
builder.AddHeader("If-Match", fmt.Sprint(*updateInstanceOptions.IfMatch))
}

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -15688,7 +15688,7 @@ func (vpc *VpcV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptio
}
builder.AddHeader("Accept", "application/json")
builder.AddHeader("Content-Type", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -15832,7 +15832,7 @@ func (vpc *VpcV1) GetVolumeWithContext(ctx context.Context, getVolumeOptions *Ge
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -15978,7 +15978,7 @@ func (vpc *VpcV1) ListVolumeInstanceProfilesWithContext(ctx context.Context, lis
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))
if listVolumeInstanceProfilesOptions.Start != nil {
Expand Down Expand Up @@ -16118,7 +16118,7 @@ func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))
if listVolumesOptions.Start != nil {
Expand Down Expand Up @@ -16222,7 +16222,7 @@ func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptio
if updateVolumeOptions.IfMatch != nil {
builder.AddHeader("If-Match", fmt.Sprint(*updateVolumeOptions.IfMatch))
}

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -16298,7 +16298,7 @@ func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotO
}
builder.AddHeader("Accept", "application/json")
builder.AddHeader("Content-Type", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -16529,7 +16529,7 @@ func (vpc *VpcV1) DeleteSnapshotWithContext(ctx context.Context, deleteSnapshotO
if deleteSnapshotOptions.IfMatch != nil {
builder.AddHeader("If-Match", fmt.Sprint(*deleteSnapshotOptions.IfMatch))
}

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -16788,7 +16788,7 @@ func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))

Expand Down Expand Up @@ -17161,7 +17161,7 @@ func (vpc *VpcV1) ListSnapshotInstanceProfilesWithContext(ctx context.Context, l
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))
if listSnapshotInstanceProfilesOptions.Start != nil {
Expand Down Expand Up @@ -17231,7 +17231,7 @@ func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOpt
builder.AddHeader(headerName, headerValue)
}
builder.AddHeader("Accept", "application/json")

builder.AddQuery("maturity", fmt.Sprint("development"))
builder.AddQuery("version", fmt.Sprint(*vpc.Version))
builder.AddQuery("generation", fmt.Sprint(*vpc.Generation))
if listSnapshotsOptions.Start != nil {
Expand Down
92 changes: 48 additions & 44 deletions ibm/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,50 +442,52 @@ func Provider() *schema.Provider {
"ibm_is_instance_cluster_network_attachment": vpc.DataSourceIBMIsInstanceClusterNetworkAttachment(),
"ibm_is_instance_cluster_network_attachments": vpc.DataSourceIBMIsInstanceClusterNetworkAttachments(),

"ibm_is_dedicated_host": vpc.DataSourceIbmIsDedicatedHost(),
"ibm_is_dedicated_hosts": vpc.DataSourceIbmIsDedicatedHosts(),
"ibm_is_dedicated_host_profile": vpc.DataSourceIbmIsDedicatedHostProfile(),
"ibm_is_dedicated_host_profiles": vpc.DataSourceIbmIsDedicatedHostProfiles(),
"ibm_is_dedicated_host_group": vpc.DataSourceIbmIsDedicatedHostGroup(),
"ibm_is_dedicated_host_groups": vpc.DataSourceIbmIsDedicatedHostGroups(),
"ibm_is_dedicated_host_disk": vpc.DataSourceIbmIsDedicatedHostDisk(),
"ibm_is_dedicated_host_disks": vpc.DataSourceIbmIsDedicatedHostDisks(),
"ibm_is_placement_group": vpc.DataSourceIbmIsPlacementGroup(),
"ibm_is_placement_groups": vpc.DataSourceIbmIsPlacementGroups(),
"ibm_is_floating_ip": vpc.DataSourceIBMISFloatingIP(),
"ibm_is_floating_ips": vpc.DataSourceIBMIsFloatingIps(),
"ibm_is_flow_log": vpc.DataSourceIBMIsFlowLog(),
"ibm_is_flow_logs": vpc.DataSourceIBMISFlowLogs(),
"ibm_is_image": vpc.DataSourceIBMISImage(),
"ibm_is_images": vpc.DataSourceIBMISImages(),
"ibm_is_image_export_job": vpc.DataSourceIBMIsImageExport(),
"ibm_is_image_export_jobs": vpc.DataSourceIBMIsImageExports(),
"ibm_is_endpoint_gateway_targets": vpc.DataSourceIBMISEndpointGatewayTargets(),
"ibm_is_instance_group": vpc.DataSourceIBMISInstanceGroup(),
"ibm_is_instance_groups": vpc.DataSourceIBMISInstanceGroups(),
"ibm_is_instance_group_memberships": vpc.DataSourceIBMISInstanceGroupMemberships(),
"ibm_is_instance_group_membership": vpc.DataSourceIBMISInstanceGroupMembership(),
"ibm_is_instance_group_manager": vpc.DataSourceIBMISInstanceGroupManager(),
"ibm_is_instance_group_managers": vpc.DataSourceIBMISInstanceGroupManagers(),
"ibm_is_instance_group_manager_policies": vpc.DataSourceIBMISInstanceGroupManagerPolicies(),
"ibm_is_instance_group_manager_policy": vpc.DataSourceIBMISInstanceGroupManagerPolicy(),
"ibm_is_instance_group_manager_action": vpc.DataSourceIBMISInstanceGroupManagerAction(),
"ibm_is_instance_group_manager_actions": vpc.DataSourceIBMISInstanceGroupManagerActions(),
"ibm_is_virtual_endpoint_gateways": vpc.DataSourceIBMISEndpointGateways(),
"ibm_is_virtual_endpoint_gateway_ips": vpc.DataSourceIBMISEndpointGatewayIPs(),
"ibm_is_virtual_endpoint_gateway": vpc.DataSourceIBMISEndpointGateway(),
"ibm_is_instance_template": vpc.DataSourceIBMISInstanceTemplate(),
"ibm_is_instance_templates": vpc.DataSourceIBMISInstanceTemplates(),
"ibm_is_instance_profile": vpc.DataSourceIBMISInstanceProfile(),
"ibm_is_instance_profiles": vpc.DataSourceIBMISInstanceProfiles(),
"ibm_is_instance": vpc.DataSourceIBMISInstance(),
"ibm_is_instances": vpc.DataSourceIBMISInstances(),
"ibm_is_instance_network_attachment": vpc.DataSourceIBMIsInstanceNetworkAttachment(),
"ibm_is_instance_network_attachments": vpc.DataSourceIBMIsInstanceNetworkAttachments(),
"ibm_is_instance_network_interface": vpc.DataSourceIBMIsInstanceNetworkInterface(),
"ibm_is_instance_network_interfaces": vpc.DataSourceIBMIsInstanceNetworkInterfaces(),
"ibm_is_instance_disk": vpc.DataSourceIbmIsInstanceDisk(),
"ibm_is_instance_disks": vpc.DataSourceIbmIsInstanceDisks(),
"ibm_is_dedicated_host": vpc.DataSourceIbmIsDedicatedHost(),
"ibm_is_dedicated_hosts": vpc.DataSourceIbmIsDedicatedHosts(),
"ibm_is_dedicated_host_profile": vpc.DataSourceIbmIsDedicatedHostProfile(),
"ibm_is_dedicated_host_profiles": vpc.DataSourceIbmIsDedicatedHostProfiles(),
"ibm_is_dedicated_host_group": vpc.DataSourceIbmIsDedicatedHostGroup(),
"ibm_is_dedicated_host_groups": vpc.DataSourceIbmIsDedicatedHostGroups(),
"ibm_is_dedicated_host_disk": vpc.DataSourceIbmIsDedicatedHostDisk(),
"ibm_is_dedicated_host_disks": vpc.DataSourceIbmIsDedicatedHostDisks(),
"ibm_is_placement_group": vpc.DataSourceIbmIsPlacementGroup(),
"ibm_is_placement_groups": vpc.DataSourceIbmIsPlacementGroups(),
"ibm_is_floating_ip": vpc.DataSourceIBMISFloatingIP(),
"ibm_is_floating_ips": vpc.DataSourceIBMIsFloatingIps(),
"ibm_is_flow_log": vpc.DataSourceIBMIsFlowLog(),
"ibm_is_flow_logs": vpc.DataSourceIBMISFlowLogs(),
"ibm_is_image": vpc.DataSourceIBMISImage(),
"ibm_is_images": vpc.DataSourceIBMISImages(),
"ibm_is_image_bare_metal_server_profiles": vpc.DataSourceIBMIsImageBareMetalServerProfiles(),
"ibm_is_image_instance_profiles": vpc.DataSourceIBMIsImageInstanceProfiles(),
"ibm_is_image_export_job": vpc.DataSourceIBMIsImageExport(),
"ibm_is_image_export_jobs": vpc.DataSourceIBMIsImageExports(),
"ibm_is_endpoint_gateway_targets": vpc.DataSourceIBMISEndpointGatewayTargets(),
"ibm_is_instance_group": vpc.DataSourceIBMISInstanceGroup(),
"ibm_is_instance_groups": vpc.DataSourceIBMISInstanceGroups(),
"ibm_is_instance_group_memberships": vpc.DataSourceIBMISInstanceGroupMemberships(),
"ibm_is_instance_group_membership": vpc.DataSourceIBMISInstanceGroupMembership(),
"ibm_is_instance_group_manager": vpc.DataSourceIBMISInstanceGroupManager(),
"ibm_is_instance_group_managers": vpc.DataSourceIBMISInstanceGroupManagers(),
"ibm_is_instance_group_manager_policies": vpc.DataSourceIBMISInstanceGroupManagerPolicies(),
"ibm_is_instance_group_manager_policy": vpc.DataSourceIBMISInstanceGroupManagerPolicy(),
"ibm_is_instance_group_manager_action": vpc.DataSourceIBMISInstanceGroupManagerAction(),
"ibm_is_instance_group_manager_actions": vpc.DataSourceIBMISInstanceGroupManagerActions(),
"ibm_is_virtual_endpoint_gateways": vpc.DataSourceIBMISEndpointGateways(),
"ibm_is_virtual_endpoint_gateway_ips": vpc.DataSourceIBMISEndpointGatewayIPs(),
"ibm_is_virtual_endpoint_gateway": vpc.DataSourceIBMISEndpointGateway(),
"ibm_is_instance_template": vpc.DataSourceIBMISInstanceTemplate(),
"ibm_is_instance_templates": vpc.DataSourceIBMISInstanceTemplates(),
"ibm_is_instance_profile": vpc.DataSourceIBMISInstanceProfile(),
"ibm_is_instance_profiles": vpc.DataSourceIBMISInstanceProfiles(),
"ibm_is_instance": vpc.DataSourceIBMISInstance(),
"ibm_is_instances": vpc.DataSourceIBMISInstances(),
"ibm_is_instance_network_attachment": vpc.DataSourceIBMIsInstanceNetworkAttachment(),
"ibm_is_instance_network_attachments": vpc.DataSourceIBMIsInstanceNetworkAttachments(),
"ibm_is_instance_network_interface": vpc.DataSourceIBMIsInstanceNetworkInterface(),
"ibm_is_instance_network_interfaces": vpc.DataSourceIBMIsInstanceNetworkInterfaces(),
"ibm_is_instance_disk": vpc.DataSourceIbmIsInstanceDisk(),
"ibm_is_instance_disks": vpc.DataSourceIbmIsInstanceDisks(),

// reserved ips
"ibm_is_instance_network_interface_reserved_ip": vpc.DataSourceIBMISInstanceNICReservedIP(),
Expand Down Expand Up @@ -541,6 +543,7 @@ func Provider() *schema.Provider {
"ibm_is_snapshot_consistency_group": vpc.DataSourceIBMIsSnapshotConsistencyGroup(),
"ibm_is_snapshot_consistency_groups": vpc.DataSourceIBMIsSnapshotConsistencyGroups(),
"ibm_is_snapshots": vpc.DataSourceSnapshots(),
"ibm_is_snapshot_instance_profiles": vpc.DataSourceIBMIsSnapshotInstanceProfiles(),
"ibm_is_share": vpc.DataSourceIbmIsShare(),
"ibm_is_source_share": vpc.DataSourceIbmIsSourceShare(),
"ibm_is_shares": vpc.DataSourceIbmIsShares(),
Expand All @@ -564,6 +567,7 @@ func Provider() *schema.Provider {
"ibm_is_volumes": vpc.DataSourceIBMIsVolumes(),
"ibm_is_volume_profile": vpc.DataSourceIBMISVolumeProfile(),
"ibm_is_volume_profiles": vpc.DataSourceIBMISVolumeProfiles(),
"ibm_is_volume_instance_profiles": vpc.DataSourceIBMIsVolumeInstanceProfiles(),
"ibm_is_vpc": vpc.DataSourceIBMISVPC(),
"ibm_is_vpc_dns_resolution_binding": vpc.DataSourceIBMIsVPCDnsResolutionBinding(),
"ibm_is_vpc_dns_resolution_bindings": vpc.DataSourceIBMIsVPCDnsResolutionBindings(),
Expand Down
4 changes: 4 additions & 0 deletions ibm/service/vpc/data_source_ibm_is_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func TestAccIBMISImageDataSource_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(resName, "architecture"),
resource.TestCheckResourceAttrSet(resName, "visibility"),
resource.TestCheckResourceAttrSet(resName, "status"),
resource.TestCheckResourceAttrSet(resName, "allowed_use.#"),
resource.TestCheckResourceAttrSet(resName, "allowed_use.0.api_version"),
resource.TestCheckResourceAttrSet(resName, "allowed_use.0.bare_metal_server"),
resource.TestCheckResourceAttrSet(resName, "allowed_use.0.instance"),
),
},
},
Expand Down
4 changes: 4 additions & 0 deletions ibm/service/vpc/data_source_ibm_is_images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func TestAccIBMISImagesDataSource_All(t *testing.T) {
resource.TestCheckResourceAttrSet(resName, "images.0.status"),
resource.TestCheckResourceAttrSet(resName, "images.0.resource_group.0.id"),
resource.TestCheckResourceAttrSet(resName, "images.0.resource_group.0.name"),
resource.TestCheckResourceAttrSet(resName, "images.0.allowed_use.#"),
resource.TestCheckResourceAttrSet(resName, "images.0.allowed_use.0.api_version"),
resource.TestCheckResourceAttrSet(resName, "images.0.allowed_use.0.bare_metal_server"),
resource.TestCheckResourceAttrSet(resName, "images.0.allowed_use.0.instance"),
),
},
},
Expand Down
4 changes: 4 additions & 0 deletions ibm/service/vpc/data_source_ibm_is_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
resource.TestCheckResourceAttrSet(snpName, "catalog_offering.#"),
resource.TestCheckResourceAttrSet(snpName, "catalog_offering.0.version_crn"),
resource.TestCheckResourceAttrSet(snpName, "catalog_offering.0.plan_crn"),
resource.TestCheckResourceAttrSet(snpName, "allowed_use.#"),
resource.TestCheckResourceAttrSet(snpName, "allowed_use.0.bare_metal_server"),
resource.TestCheckResourceAttrSet(snpName, "allowed_use.0.instance"),
resource.TestCheckResourceAttrSet(snpName, "allowed_use.0.api_version"),
),
},
},
Expand Down
Loading

0 comments on commit 0a960a0

Please sign in to comment.