Skip to content

Commit 1ffd00a

Browse files
IBM-DeekshaDeeksha Sharma
andauthored
Iks roks support (IBM-Cloud#6386)
* update code: k8s support for registration, group and recovery * add iks/roks support * update datamover_upgradability type * update * update protection sources schema and fix source registration * update * update BRS sdk * add test cases for IKS/ROKS support * remove extra changes * update documentation * remove acctest cjhanges * udate code * update * update BRS sdk * update code * resolve extra diffs * add missing func * update registrtion info with instance id * add test cases for groups * fix datasource --------- Co-authored-by: Deeksha Sharma <[email protected]>
1 parent d0f2f7f commit 1ffd00a

28 files changed

+24386
-1761
lines changed

ibm/provider/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ func Provider() *schema.Provider {
265265
"ibm_config_aggregator_settings": configurationaggregator.AddConfigurationAggregatorInstanceFields(configurationaggregator.DataSourceIbmConfigAggregatorSettings()),
266266
"ibm_config_aggregator_resource_collection_status": configurationaggregator.AddConfigurationAggregatorInstanceFields(configurationaggregator.DataSourceIbmConfigAggregatorResourceCollectionStatus()),
267267

268-
// // BackupAndRecovery
269268
// // BackupAndRecovery
270269
"ibm_backup_recovery_agent_upgrade_tasks": backuprecovery.AddInstanceFields(backuprecovery.DataSourceIbmBackupRecoveryAgentUpgradeTasks()),
271270
"ibm_backup_recovery_download_agent": backuprecovery.AddInstanceFields(backuprecovery.DataSourceIbmBackupRecoveryDownloadAgent()),
@@ -291,6 +290,7 @@ func Provider() *schema.Provider {
291290
"ibm_backup_recovery_download_indexed_files": backuprecovery.AddInstanceFields(backuprecovery.DataSourceIbmBackupRecoveryDownloadIndexedFiles()),
292291
"ibm_backup_recovery_protection_sources": backuprecovery.AddInstanceFields(backuprecovery.DataSourceIbmBackupRecoveryProtectionSources()),
293292
"ibm_backup_recovery_connector_get_users": backuprecovery.AddInstanceFields(backuprecovery.DataSourceIbmBackupRecoveryConnectorGetUsers()),
293+
"ibm_backup_recovery_registration_info": backuprecovery.AddInstanceFields(backuprecovery.DataSourceIbmBackupRecoveryRegistrationInfo()),
294294
// // AppID
295295
"ibm_appid_action_url": appid.DataSourceIBMAppIDActionURL(),
296296
"ibm_appid_apm": appid.DataSourceIBMAppIDAPM(),

ibm/service/backuprecovery/data_source_ibm_backup_recoveries.go

Lines changed: 2324 additions & 305 deletions
Large diffs are not rendered by default.

ibm/service/backuprecovery/data_source_ibm_backup_recovery.go

Lines changed: 2329 additions & 305 deletions
Large diffs are not rendered by default.

ibm/service/backuprecovery/data_source_ibm_backup_recovery_protection_group.go

Lines changed: 601 additions & 0 deletions
Large diffs are not rendered by default.

ibm/service/backuprecovery/data_source_ibm_backup_recovery_protection_groups.go

Lines changed: 597 additions & 0 deletions
Large diffs are not rendered by default.

ibm/service/backuprecovery/data_source_ibm_backup_recovery_protection_groups_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ func TestAccIbmBackupRecoveryProtectionGroupsDataSourceBasic(t *testing.T) {
4848
})
4949
}
5050

51+
func TestAccIbmBackupRecoveryProtectionGroupsDataSourceKubernetesBasic(t *testing.T) {
52+
resource.Test(t, resource.TestCase{
53+
PreCheck: func() { acc.TestAccPreCheck(t) },
54+
Providers: acc.TestAccProviders,
55+
Steps: []resource.TestStep{
56+
resource.TestStep{
57+
Config: testAccCheckIbmBackupRecoveryProtectionGroupsDataSourceKubernetesConfigBasic(),
58+
Check: resource.ComposeTestCheckFunc(
59+
resource.TestCheckResourceAttrSet("data.ibm_backup_recovery_protection_groups.baas_protection_groups_instance", "id"),
60+
resource.TestCheckResourceAttrSet("data.ibm_backup_recovery_protection_groups.baas_protection_groups_instance", "x_ibm_tenant_id"),
61+
),
62+
},
63+
},
64+
})
65+
}
66+
5167
func testAccCheckIbmBackupRecoveryProtectionGroupsDataSourceConfigBasic(name, environment, includedPath, protectionType, policyName string, objectId int) string {
5268
return fmt.Sprintf(`
5369
resource "ibm_backup_recovery_protection_policy" "baas_protection_policy_instance" {
@@ -105,3 +121,11 @@ func testAccCheckIbmBackupRecoveryProtectionGroupsDataSourceConfigBasic(name, en
105121
}
106122
`, tenantId, policyName, tenantId, name, environment, protectionType, objectId, includedPath)
107123
}
124+
125+
func testAccCheckIbmBackupRecoveryProtectionGroupsDataSourceKubernetesConfigBasic() string {
126+
return `
127+
data "ibm_backup_recovery_protection_groups" "baas_protection_groups_instance" {
128+
x_ibm_tenant_id = "wkk1yqrdce/"
129+
}
130+
`
131+
}

ibm/service/backuprecovery/data_source_ibm_backup_recovery_protection_sources.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22217,7 +22217,6 @@ func dataSourceIbmBackupRecoveryProtectionSourcesRead(context context.Context, d
2221722217
}
2221822218
protectionSources = append(protectionSources, protectionSourcesItemMap)
2221922219
}
22220-
2222122220
if err = d.Set("protection_sources", protectionSources); err != nil {
2222222221
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting protection_sources: %s", err), "(Data) ibm_backup_recovery_protection_sources", "read", "set-protection_sources").GetDiag()
2222322222
}
@@ -22493,6 +22492,7 @@ func DataSourceIbmBackupRecoveryProtectionSourcesProtectionSourceNodeToMap(model
2249322492
modelMap["environment"] = *model.Environment
2249422493
}
2249522494
if model.ID != nil {
22495+
2249622496
modelMap["id"] = flex.IntValue(model.ID)
2249722497
}
2249822498
if model.Name != nil {

ibm/service/backuprecovery/data_source_ibm_backup_recovery_registration_info.go

Lines changed: 8860 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright IBM Corp. 2025 All Rights Reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
/*
5+
* IBM OpenAPI Terraform Generator Version: 3.105.1-067d600b-20250616-154447
6+
*/
7+
8+
package backuprecovery_test
9+
10+
import (
11+
"fmt"
12+
"testing"
13+
14+
acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest"
15+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
16+
)
17+
18+
func TestAccIbmBackupRecoveryRegistrationInfoDataSourceBasic(t *testing.T) {
19+
resource.Test(t, resource.TestCase{
20+
PreCheck: func() { acc.TestAccPreCheck(t) },
21+
Providers: acc.TestAccProviders,
22+
Steps: []resource.TestStep{
23+
resource.TestStep{
24+
Config: testAccCheckIbmBackupRecoveryRegistrationInfoDataSourceConfigBasic(),
25+
Check: resource.ComposeTestCheckFunc(
26+
resource.TestCheckResourceAttrSet("data.ibm_backup_recovery_registration_info.baas_recovery_registration_info", "x_ibm_tenant_id"),
27+
),
28+
},
29+
},
30+
})
31+
}
32+
33+
func testAccCheckIbmBackupRecoveryRegistrationInfoDataSourceConfigBasic() string {
34+
return fmt.Sprintf(`
35+
data "ibm_backup_recovery_registration_info" "baas_recovery_registration_info" {
36+
x_ibm_tenant_id = "wkk1yqrdce/"
37+
}
38+
39+
`)
40+
}

0 commit comments

Comments
 (0)