diff --git a/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go index c2a0eccc93..b73b4f3bdd 100644 --- a/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2021, 2022, 2023. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/ibm-is-ng/main.tf b/examples/ibm-is-ng/main.tf index b4ce696697..a3e74809b9 100644 --- a/examples/ibm-is-ng/main.tf +++ b/examples/ibm-is-ng/main.tf @@ -1143,6 +1143,20 @@ data "ibm_is_backup_policy_plan" "is_backup_policy_plan" { name = "my-backup-policy-plan" } +//backup policies for enterprise + +resource "ibm_is_backup_policy" "ent-baas-example" { + match_user_tags = ["tag1"] + name = "example-enterprise-backup-policy" + scope { + crn = "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63" + } +} + +data "ibm_is_backup_policy" "enterprise_backup" { + name = ibm_is_backup_policy.ent-baas-example.name +} + // Vpn Server resource "ibm_is_vpn_server" "is_vpn_server" { certificate_crn = var.is_certificate_crn diff --git a/ibm/acctest/acctest.go b/ibm/acctest/acctest.go index 00957a3a8d..54513583d9 100644 --- a/ibm/acctest/acctest.go +++ b/ibm/acctest/acctest.go @@ -68,6 +68,7 @@ var ( UpdatedCertCRN string SecretCRN string SecretCRN2 string + EnterpriseCRN string InstanceCRN string SecretGroupID string RegionName string @@ -1444,6 +1445,11 @@ func init() { fmt.Println("[WARN] Set the environment variable IES_API_KEY for testing Event streams targets, the tests will fail if this is not set") } + EnterpriseCRN = os.Getenv("ENTERPRISE_CRN") + if EnterpriseCRN == "" { + fmt.Println("[WARN] Set the environment variable ENTERPRISE_CRN for testing enterprise backup policy, the tests will fail if this is not set") + } + CeResourceGroupID = os.Getenv("IBM_CODE_ENGINE_RESOURCE_GROUP_ID") if CeResourceGroupID == "" { CeResourceGroupID = "" diff --git a/ibm/service/vpc/data_source_ibm_is_backup_policies.go b/ibm/service/vpc/data_source_ibm_is_backup_policies.go index 1ca4bde5be..d9f03c7f53 100644 --- a/ibm/service/vpc/data_source_ibm_is_backup_policies.go +++ b/ibm/service/vpc/data_source_ibm_is_backup_policies.go @@ -166,6 +166,59 @@ func DataSourceIBMIsBackupPolicies() *schema.Resource { Computed: true, Description: "The type of resource referenced.", }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current health_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource", + }, + "scope": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The scope for this backup policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this enterprise.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this enterprise or account.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, }, }, }, @@ -298,10 +351,58 @@ func dataSourceBackupPolicyCollectionBackupPoliciesToMap(backupPoliciesItem vpcv if backupPoliciesItem.ResourceType != nil { backupPoliciesMap["resource_type"] = backupPoliciesItem.ResourceType } + if backupPoliciesItem.HealthReasons != nil { + healthReasonsList := []map[string]interface{}{} + for _, healthReasonsItem := range backupPoliciesItem.HealthReasons { + healthReasonsList = append(healthReasonsList, dataSourceBackupPolicyCollectionPoliciesHealthReasonsToMap(healthReasonsItem)) + } + backupPoliciesMap["health_reasons"] = healthReasonsList + } + if backupPoliciesItem.HealthState != nil { + backupPoliciesMap["health_state"] = backupPoliciesItem.HealthState + } + if backupPoliciesItem.Scope != nil { + scopeList := []map[string]interface{}{} + scopeMap := dataSourceBackupPolicyCollectionBackupPoliciesScopeToMap(*backupPoliciesItem.Scope.(*vpcv1.BackupPolicyScope)) + scopeList = append(scopeList, scopeMap) + backupPoliciesMap["scope"] = scopeList + } return backupPoliciesMap } +func dataSourceBackupPolicyCollectionPoliciesHealthReasonsToMap(statusReasonsItem vpcv1.BackupPolicyHealthReason) (healthReasonsMap map[string]interface{}) { + healthReasonsMap = map[string]interface{}{} + + if statusReasonsItem.Code != nil { + healthReasonsMap["code"] = statusReasonsItem.Code + } + if statusReasonsItem.Message != nil { + healthReasonsMap["message"] = statusReasonsItem.Message + } + if statusReasonsItem.MoreInfo != nil { + healthReasonsMap["more_info"] = statusReasonsItem.MoreInfo + } + + return healthReasonsMap +} + +func dataSourceBackupPolicyCollectionBackupPoliciesScopeToMap(scopeItem vpcv1.BackupPolicyScope) (scopeMap map[string]interface{}) { + scopeMap = map[string]interface{}{} + + if scopeItem.CRN != nil { + scopeMap["crn"] = scopeItem.CRN + } + if scopeItem.ID != nil { + scopeMap["id"] = scopeItem.ID + } + if scopeItem.ResourceType != nil { + scopeMap["resource_type"] = scopeItem.ResourceType + } + + return scopeMap +} + func dataSourceBackupPolicyCollectionBackupPoliciesPlansToMap(plansItem vpcv1.BackupPolicyPlanReference) (plansMap map[string]interface{}) { plansMap = map[string]interface{}{} diff --git a/ibm/service/vpc/data_source_ibm_is_backup_policy.go b/ibm/service/vpc/data_source_ibm_is_backup_policy.go index 1aa3b6ca81..7baaafa6cb 100644 --- a/ibm/service/vpc/data_source_ibm_is_backup_policy.go +++ b/ibm/service/vpc/data_source_ibm_is_backup_policy.go @@ -149,6 +149,59 @@ func DataSourceIBMIsBackupPolicy() *schema.Resource { Computed: true, Description: "The type of resource referenced.", }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current health_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource", + }, + "scope": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The scope for this backup policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this enterprise.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this enterprise or account.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, }, } } @@ -237,6 +290,32 @@ func dataSourceIBMIsBackupPolicyRead(context context.Context, d *schema.Resource } } + if backupPolicy.HealthReasons != nil { + healthReasonsList := make([]map[string]interface{}, 0) + for _, sr := range backupPolicy.HealthReasons { + currentSR := map[string]interface{}{} + if sr.Code != nil && sr.Message != nil { + currentSR["code"] = *sr.Code + currentSR["message"] = *sr.Message + if sr.MoreInfo != nil { + currentSR["more_info"] = *sr.Message + } + healthReasonsList = append(healthReasonsList, currentSR) + } + } + d.Set("health_reasons", healthReasonsList) + } + if err = d.Set("health_state", backupPolicy.HealthState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) + } + + if backupPolicy.Scope != nil { + err = d.Set("scope", dataSourceBackupPolicyFlattenScope(*backupPolicy.Scope.(*vpcv1.BackupPolicyScope))) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting scope: %s", err)) + } + } + matchResourceType := make([]string, 0) if backupPolicy.MatchResourceTypes != nil { for _, matchResourceTyp := range backupPolicy.MatchResourceTypes { @@ -266,6 +345,29 @@ func dataSourceIBMIsBackupPolicyRead(context context.Context, d *schema.Resource return nil } +func dataSourceBackupPolicyFlattenScope(result vpcv1.BackupPolicyScope) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceBackupPolicyScopeToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} +func dataSourceBackupPolicyScopeToMap(scopeItem vpcv1.BackupPolicyScope) (scopeMap map[string]interface{}) { + scopeMap = map[string]interface{}{} + + if scopeItem.CRN != nil { + scopeMap["crn"] = scopeItem.CRN + } + if scopeItem.ID != nil { + scopeMap["id"] = scopeItem.ID + } + if scopeItem.ResourceType != nil { + scopeMap["resource_type"] = scopeItem.ResourceType + } + + return scopeMap +} + func dataSourceBackupPolicyFlattenPlans(result []vpcv1.BackupPolicyPlanReference) (plans []map[string]interface{}) { for _, plansItem := range result { plans = append(plans, dataSourceBackupPolicyPlansToMap(plansItem)) diff --git a/ibm/service/vpc/resource_ibm_is_backup_policy.go b/ibm/service/vpc/resource_ibm_is_backup_policy.go index fe4c50e45a..2f9f94e9a6 100644 --- a/ibm/service/vpc/resource_ibm_is_backup_policy.go +++ b/ibm/service/vpc/resource_ibm_is_backup_policy.go @@ -98,6 +98,61 @@ func ResourceIBMIsBackupPolicy() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current health_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource", + }, + "scope": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Optional: true, + MaxItems: 1, + Description: "The scope for this backup policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The CRN for this enterprise.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this enterprise or account.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, }, } } @@ -171,6 +226,17 @@ func resourceIBMIsBackupPolicyCreate(context context.Context, d *schema.Resource createBackupPolicyOptions.SetResourceGroup(&resourceGroup) } + if _, ok := d.GetOk("scope"); ok { + bkpPolicyScopePrototypeMap := d.Get("scope.0").(map[string]interface{}) + bkpPolicyScopePrototype := vpcv1.BackupPolicyScopePrototype{} + if bkpPolicyScopePrototypeMap["crn"] != nil { + if crnStr := bkpPolicyScopePrototypeMap["crn"].(string); crnStr != "" { + bkpPolicyScopePrototype.CRN = core.StringPtr(crnStr) + } + } + createBackupPolicyOptions.SetScope(&bkpPolicyScopePrototype) + } + backupPolicy, response, err := vpcClient.CreateBackupPolicyWithContext(context, createBackupPolicyOptions) if err != nil { log.Printf("[DEBUG] CreateBackupPolicyWithContext failed %s\n%s", err, response) @@ -266,6 +332,35 @@ func resourceIBMIsBackupPolicyRead(context context.Context, d *schema.ResourceDa } } + if backupPolicy.HealthReasons != nil { + healthReasonsList := make([]map[string]interface{}, 0) + for _, sr := range backupPolicy.HealthReasons { + currentSR := map[string]interface{}{} + if sr.Code != nil && sr.Message != nil { + currentSR["code"] = *sr.Code + currentSR["message"] = *sr.Message + if sr.MoreInfo != nil { + currentSR["more_info"] = *sr.Message + } + healthReasonsList = append(healthReasonsList, currentSR) + } + } + d.Set("health_reasons", healthReasonsList) + } + if err = d.Set("health_state", backupPolicy.HealthState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) + } + + if backupPolicy.Scope != nil { + scope := []map[string]interface{}{} + scopeMap := resourceIbmIsBackupPolicyScopeToMap(*backupPolicy.Scope.(*vpcv1.BackupPolicyScope)) + scope = append(scope, scopeMap) + + if err = d.Set("scope", scope); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting scope: %s", err)) + } + } + if err = d.Set("version", response.Headers.Get("Etag")); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting version: %s", err)) } @@ -273,6 +368,16 @@ func resourceIBMIsBackupPolicyRead(context context.Context, d *schema.ResourceDa return nil } +func resourceIbmIsBackupPolicyScopeToMap(scope vpcv1.BackupPolicyScope) map[string]interface{} { + scopeMap := map[string]interface{}{} + + scopeMap["crn"] = scope.CRN + scopeMap["id"] = scope.ID + scopeMap["resource_type"] = scope.ResourceType + + return scopeMap +} + func resourceIBMIsBackupPolicyUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { vpcClient, err := vpcClient(meta) if err != nil { diff --git a/ibm/service/vpc/resource_ibm_is_backup_policy_test.go b/ibm/service/vpc/resource_ibm_is_backup_policy_test.go index f791ec8718..d6a0426b4f 100644 --- a/ibm/service/vpc/resource_ibm_is_backup_policy_test.go +++ b/ibm/service/vpc/resource_ibm_is_backup_policy_test.go @@ -244,3 +244,48 @@ func testAccCheckIBMIsBackupPolicyDestroy(s *terraform.State) error { return nil } + +func TestAccIBMIsBackupPolicyBasicWithScope(t *testing.T) { + backupPolicyName := fmt.Sprintf("tfbakuppolicyname%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMIsBackupPolicyDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIBMIsBackupPolicyConfigBasicWithScope(backupPolicyName, acc.EnterpriseCRN), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_is_backup_policy.is_backup_policy", "name", backupPolicyName), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "match_resource_types.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "match_user_tags.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "resource_group"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "created_at"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "crn"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "href"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "scope.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "scope.0.id"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "lifecycle_state"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "resource_type"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "version"), + ), + }, + { + ResourceName: "ibm_is_backup_policy.is_backup_policy", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckIBMIsBackupPolicyConfigBasicWithScope(backupPolicyName, entCrn string) string { + return fmt.Sprintf(` + resource "ibm_is_backup_policy" "is_backup_policy" { + match_user_tags = ["dev:test"] + name = "%s" + scope { + crn = "%s" + } + }`, backupPolicyName, entCrn) +} diff --git a/website/docs/d/is_backup_policies.html.markdown b/website/docs/d/is_backup_policies.html.markdown index 3b21acabf4..3e36540ebe 100644 --- a/website/docs/d/is_backup_policies.html.markdown +++ b/website/docs/d/is_backup_policies.html.markdown @@ -45,6 +45,13 @@ In addition to all argument reference list, you can access the following attribu Nested `backup_policies` blocks have the following structure: - `created_at` - (String) The date and time that the backup policy was created. - `crn` - (String) The CRN for this backup policy. + - `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. + - `health_state` - (String) The health of this resource. - `href` - (String) The URL for this backup policy. - `id` - (String) The unique identifier for this backup policy. - `last_job_completed_at` - (String) he date and time that the most recent job for this backup policy completed. @@ -63,11 +70,17 @@ In addition to all argument reference list, you can access the following attribu - `id` - (String) The unique identifier for this backup policy plan. - `name` - (String) The unique user-defined name for this backup policy plan. - `resource_type` - (String) The type of resource referenced. - - `resource_group` - (List) The resource group object, for this backup policy. + - `resource_group` - (List) The resource group object, for this backup policy. Nested `resource_group` blocks have the following structure: - `href` - (String) The URL for this resource group. - `id` - (String) The unique identifier for this resource group. - `name` - (String) The user-defined name for this resource group. + - `scope` - (List) If present, the scope for this backup policy. + + Nested `scope` blocks have the following structure: + - `crn` - (String) The CRN for this enterprise. + - `id` - (String) The unique identifier for this enterprise or account. + - `resource_type` - (String) The resource type. diff --git a/website/docs/d/is_backup_policy.html.markdown b/website/docs/d/is_backup_policy.html.markdown index c6e2a1119b..6513f31bfa 100644 --- a/website/docs/d/is_backup_policy.html.markdown +++ b/website/docs/d/is_backup_policy.html.markdown @@ -42,6 +42,13 @@ In addition to all argument reference list, you can access the following attribu - `id` - The unique identifier of the BackupPolicy. - `created_at` - (String) The date and time that the backup policy was created. - `crn` - (String) The CRN for this backup policy. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. - `href` - (String) The URL for this backup policy. - `last_job_completed_at` - (String) he date and time that the most recent job for this backup policy completed. - `lifecycle_state` - (String) The lifecycle state of the backup policy. @@ -66,4 +73,11 @@ In addition to all argument reference list, you can access the following attribu - `id` - (String) The unique identifier for this resource group. - `name` - (String) The user-defined name for this resource group. - `resource_type` - (String) The type of resource referenced. +- `scope` - (List) If present, the scope for this backup policy. + + Nested `scope` blocks have the following structure: + - `crn` - (String) The CRN for this enterprise. + - `id` - (String) The unique identifier for this enterprise or account. + - `resource_type` - (String) The resource type. + diff --git a/website/docs/d/is_bare_metal_servers.markdown b/website/docs/d/is_bare_metal_servers.markdown index 58cf01fdaf..f94867efd5 100644 --- a/website/docs/d/is_bare_metal_servers.markdown +++ b/website/docs/d/is_bare_metal_servers.markdown @@ -36,9 +36,6 @@ Review the argument references that you can specify for your data source. - `vpc_name` (Optional, String) The name of the vpc this bare metal server is in - `vpc_crn` (Optional, String) The CRN of the vpc this bare metal server is in - `name` - (Optional, String) The name of the dedicated host group -- `network_interfaces_subnet` - (Optional, String) The ID of the subnet of the bare metal server network interfaces -- `network_interfaces_subnet_crn` - (Optional, String) The CRN of the subnet of the bare metal server network interfaces -- `network_interfaces_subnet_name` - (Optional, String) The name of the subnet of the bare metal server network interfaces ## Attribute Reference diff --git a/website/docs/r/is_backup_policy.html.markdown b/website/docs/r/is_backup_policy.html.markdown index 3028e66c72..2f079c364b 100644 --- a/website/docs/r/is_backup_policy.html.markdown +++ b/website/docs/r/is_backup_policy.html.markdown @@ -31,6 +31,18 @@ resource "ibm_is_backup_policy" "example" { } ``` +## Example Usage (enterprise baas) + +```terraform +resource "ibm_is_backup_policy" "ent-baas-example1" { + match_user_tags = ["tag1"] + name = "example-backup-policy" + scope { + crn = "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63" + } +} +``` + ## Argument Reference Review the argument reference that you can specify for your resource. @@ -46,6 +58,9 @@ Review the argument reference that you can specify for your resource. Nested scheme for `resource_group`: - `id` - (Optional, String) The unique identifier for this resource group. +- `scope` - (Optional, List) If present, the scope for this backup policy. + Nested `scope` blocks have the following structure: + - `crn` - (Required, String) The CRN for this enterprise. ## Attribute Reference @@ -54,10 +69,22 @@ In addition to all argument references listed, you can access the following attr - `id` - The unique identifier of the BackupPolicy. - `created_at` - (String) The date and time that the backup policy was created. - `crn` - (String) The CRN for this backup policy. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. - `href` - (String) The URL for this backup policy. - `last_job_completed_at` - (String) The date and time that the most recent job for this backup policy completed. - `lifecycle_state` - (String) The lifecycle state of the backup policy. - `resource_type` - (String) The resource type. +- `scope` - Scope of this backup policy + Nested `scope`: + - `crn` - (String) The CRN for this enterprise. + - `id` - (String) The unique identifier for this enterprise. + - `resource_type` - (String) The resource type. - `version` - Version of the BackupPolicy. ## Import