Skip to content

Commit

Permalink
Merge pull request #350 from vmware/mshobha/fix-dp-doc
Browse files Browse the repository at this point in the history
Fix data protection schema and documentation
  • Loading branch information
shobha2626 authored Dec 1, 2023
2 parents 1f04cf2 + 17ce9eb commit 4ac75a1
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 86 deletions.
6 changes: 3 additions & 3 deletions docs/data-sources/backup_schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ data "tanzu-mission-control_backup_schedule" "demo" {

### Required

- `scope` (Block List, Min: 1, Max: 1) Search scope block (see [below for nested schema](#nestedblock--scope))
- `name` (String) The name of the backup schedule
- `scope` (Block List, Min: 1, Max: 1) Search scope block (see [below for nested schema](#nestedblock--scope))

### Optional

- `include_total_count` (Boolean) Whether to include total count of backups.
(Default: True)
(Default: True)
- `query` (String) Define a query for listing backups
- `sort_by` (String) Sort backups by field.

Expand Down Expand Up @@ -72,9 +72,9 @@ Required:

Read-Only:

- `name` (String)
- `backup_scope` (String)
- `meta` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--meta))
- `name` (String)
- `scope` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope))
- `spec` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec))

Expand Down
17 changes: 4 additions & 13 deletions docs/resources/backup_schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ resource "tanzu-mission-control_backup_schedule" "sample-full" {
}
template {
backup_ttl = "2592000s"
backup_ttl = "2592000s"
excluded_namespaces = [
"app-01",
"app-02",
Expand Down Expand Up @@ -169,9 +169,9 @@ resource "tanzu-mission-control_backup_schedule" "sample-full" {
template {
default_volumes_to_fs_backup = false
include_cluster_resources = true
backup_ttl = "604800s"
storage_location = "TARGET_LOCATION_NAME"
include_cluster_resources = true
backup_ttl = "604800s"
storage_location = "TARGET_LOCATION_NAME"
label_selector {
match_expression {
Expand Down Expand Up @@ -221,7 +221,6 @@ Valid values are (FULL_CLUSTER, SET_NAMESPACES, LABEL_SELECTOR)
Optional:

- `cluster` (Block List, Max: 1) Cluster scope block (see [below for nested schema](#nestedblock--scope--cluster))
- `cluster_group` (Block List, Max: 1) Cluster group scope block (see [below for nested schema](#nestedblock--scope--cluster_group))

<a id="nestedblock--scope--cluster"></a>
### Nested Schema for `scope.cluster`
Expand All @@ -233,14 +232,6 @@ Required:
- `provisioner_name` (String) Cluster provisioner name


<a id="nestedblock--scope--cluster_group"></a>
### Nested Schema for `scope.cluster_group`

Required:

- `cluster_group_name` (String) Cluster group name



<a id="nestedblock--spec"></a>
### Nested Schema for `spec`
Expand Down
9 changes: 0 additions & 9 deletions docs/resources/enable_data_protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ terraform import tanzu-mission-control_backup_schedule.demo_backup MANAGEMENT_CL
Optional:

- `cluster` (Block List, Max: 1) Cluster scope block (see [below for nested schema](#nestedblock--scope--cluster))
- `cluster_group` (Block List, Max: 1) Cluster group scope block (see [below for nested schema](#nestedblock--scope--cluster_group))

<a id="nestedblock--scope--cluster"></a>
### Nested Schema for `scope.cluster`
Expand All @@ -79,14 +78,6 @@ Required:
- `provisioner_name` (String) Cluster provisioner name


<a id="nestedblock--scope--cluster_group"></a>
### Nested Schema for `scope.cluster_group`

Required:

- `cluster_group_name` (String) Cluster group name



<a id="nestedblock--deletion_policy"></a>
### Nested Schema for `deletion_policy`
Expand Down
12 changes: 6 additions & 6 deletions docs/resources/target_location.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ For more information regarding target location, see [Target Location][target-loc

```terraform
resource "tanzu-mission-control_target_location" "demo_tmc_managed" {
name = "TARGET_LOCATION_NAME"
name = "TARGET_LOCATION_NAME"
spec {
target_provider = "TARGET_PROVIDER_NAME"
credential = {
credential = {
name = "CREDENTIAL_NAME"
}
Expand Down Expand Up @@ -58,11 +58,11 @@ resource "tanzu-mission-control_target_location" "demo_tmc_managed" {

```terraform
resource "tanzu-mission-control_target_location" "demo_aws_self_provisioned" {
name = "TARGET_LOCATION_NAME"
name = "TARGET_LOCATION_NAME"
spec {
target_provider = "AWS"
credential = {
credential = {
name = "AWS_CREDENTIAL_NAME"
}
Expand Down Expand Up @@ -102,11 +102,11 @@ resource "tanzu-mission-control_target_location" "demo_aws_self_provisioned" {

```terraform
resource "tanzu-mission-control_target_location" "demo_aws_self_provisioned" {
name = "TARGET_LOCATION_NAME"
name = "TARGET_LOCATION_NAME"
spec {
target_provider = "AWS"
credential = {
credential = {
name = "AWS_CREDENTIAL_NAME"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ var (
var tfModelResourceMap = &tfModelConverterHelper.BlockToStruct{
NameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "name"),
ScopeKey: &tfModelConverterHelper.BlockToStruct{
ClusterGroupScopeKey: &tfModelConverterHelper.BlockToStruct{
ClusterGroupNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "clusterGroupName"),
},
ClusterScopeKey: &tfModelConverterHelper.BlockToStruct{
ClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "clusterName"),
ManagementClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "managementClusterName"),
Expand Down
16 changes: 0 additions & 16 deletions internal/resources/cluster/backupschedule/datasource_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,6 @@ var searchScopeSchema = &schema.Schema{
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
ClusterGroupScopeKey: {
Type: schema.TypeList,
Optional: true,
Description: "Cluster group scope block",
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
ClusterGroupNameKey: {
Type: schema.TypeString,
Description: "Cluster group name",
Required: true,
ForceNew: true,
},
},
},
},
ClusterScopeKey: {
Type: schema.TypeList,
Optional: true,
Expand Down
16 changes: 0 additions & 16 deletions internal/resources/cluster/backupschedule/resource_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,6 @@ var scopeSchema = &schema.Schema{
Optional: false,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
ClusterGroupScopeKey: {
Type: schema.TypeList,
Optional: true,
Description: "Cluster group scope block",
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
ClusterGroupNameKey: {
Type: schema.TypeString,
Description: "Cluster group name",
Required: true,
ForceNew: true,
},
},
},
},
ClusterScopeKey: {
Type: schema.TypeList,
Optional: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ var tfModelMap = &tfModelConverterHelper.BlockToStruct{
ManagementClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "managementClusterName"),
ProvisionerNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "provisionerName"),
},
ClusterGroupScopeKey: &tfModelConverterHelper.BlockToStruct{
ClusterGroupNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "clusterGroupName"),
},
},
common.MetaKey: common.GetMetaConverterMap(tfModelConverterHelper.DefaultModelPathSeparator),
SpecKey: &tfModelConverterHelper.BlockToStruct{
Expand Down
16 changes: 0 additions & 16 deletions internal/resources/cluster/dataprotection/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,6 @@ var scopeSchema = &schema.Schema{
Optional: false,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
ClusterGroupScopeKey: {
Type: schema.TypeList,
Optional: true,
Description: "Cluster group scope block",
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
ClusterGroupNameKey: {
Type: schema.TypeString,
Description: "Cluster group name",
Required: true,
ForceNew: true,
},
},
},
},
ClusterScopeKey: {
Type: schema.TypeList,
Optional: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/resources/package/data_source_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var packageSchema = map[string]*schema.Schema{
},
namespaceKey: {
Type: schema.TypeString,
Description: "Namespae of package.",
Description: "Namespace of package.",
Computed: true,
},
metadataNameKey: {
Expand Down

0 comments on commit 4ac75a1

Please sign in to comment.