Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/dataprotection -- Tests & Docs #280

Merged
merged 5 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test and coverage
on: [pull_request, push]

env:
BUILD_TAGS: 'akscluster cluster clustergroup credential ekscluster gitrepository iampolicy kustomization namespace custompolicy imagepolicy networkpolicy quotapolicy securitypolicy sourcesecret workspace tanzupackage tanzupackages packagerepository packageinstall clustersecret integration'
BUILD_TAGS: 'akscluster cluster clustergroup credential ekscluster gitrepository iampolicy kustomization namespace custompolicy imagepolicy networkpolicy quotapolicy securitypolicy sourcesecret workspace tanzupackage tanzupackages packagerepository packageinstall clustersecret integration backupschedule targetlocation dataprotection'

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ifeq ($(TEST_FLAGS),)
endif

ifeq ($(BUILD_TAGS),)
BUILD_TAGS := 'akscluster cluster clustergroup credential ekscluster gitrepository iampolicy kustomization namespace custompolicy imagepolicy networkpolicy quotapolicy securitypolicy sourcesecret workspace tanzupackage tanzupackages packagerepository packageinstall clustersecret integration'
BUILD_TAGS := 'akscluster cluster clustergroup credential ekscluster gitrepository iampolicy kustomization namespace custompolicy imagepolicy networkpolicy quotapolicy securitypolicy sourcesecret workspace tanzupackage tanzupackages packagerepository packageinstall clustersecret integration backupschedule targetlocation dataprotection'
endif

.PHONY: build clean-up test gofmt vet lint acc-test website-lint website-lint-fix
Expand Down
240 changes: 240 additions & 0 deletions docs/data-sources/backup_schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
---
Title: "Backup Schedule Data Source"
Description: |-
Listing backup schedules by cluster scope
---

# Backup Schedule Data Source

This data source enables users to list existing backup schedules by cluster scope.
Listing target locations by cluster scope is supported only for clusters enabled with data protection.

## Example Usage

```terraform
data "tanzu-mission-control_backup_schedule" "demo" {
scope {
management_cluster_name = "MGMT_CLS_NAME"
provisioner_name = "PROVISIONER_NAME"
cluster_name = "CLS_NAME"
name = "TARGET_LOCATION_NAME"
}

query = "QUERY"
sort_by = "SORT_BY"
include_total = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `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)
- `query` (String) Define a query for listing backups
- `sort_by` (String) Sort backups by field.

### Read-Only

- `id` (String) The ID of this resource.
- `schedules` (List of Object) A list of schedules returned (see [below for nested schema](#nestedatt--schedules))
- `total_count` (String) Total count of schedules returned

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

Required:

- `cluster_name` (String) Cluster name

Optional:

- `management_cluster_name` (String) Management cluster name
- `name` (String) The name of the backup schedule
- `provisioner_name` (String) Cluster provisioner name


<a id="nestedatt--schedules"></a>
### Nested Schema for `schedules`

Read-Only:

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

<a id="nestedobjatt--schedules--meta"></a>
### Nested Schema for `schedules.meta`

Read-Only:

- `annotations` (Map of String)
- `description` (String)
- `labels` (Map of String)
- `resource_version` (String)
- `uid` (String)


<a id="nestedobjatt--schedules--spec"></a>
### Nested Schema for `schedules.spec`

Read-Only:

- `paused` (Boolean)
- `schedule` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--schedule))
- `template` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template))

<a id="nestedobjatt--schedules--spec--schedule"></a>
### Nested Schema for `schedules.spec.schedule`

Read-Only:

- `rate` (String)


<a id="nestedobjatt--schedules--spec--template"></a>
### Nested Schema for `schedules.spec.template`

Read-Only:

- `backup_ttl` (String)
- `csi_snapshot_timeout` (String)
- `default_volumes_to_fs_backup` (Boolean)
- `default_volumes_to_restic` (Boolean)
- `excluded_namespaces` (List of String)
- `excluded_resources` (List of String)
- `hooks` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--hooks))
- `include_cluster_resources` (Boolean)
- `included_namespaces` (List of String)
- `included_resources` (List of String)
- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--label_selector))
- `or_label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--or_label_selector))
- `ordered_resources` (Map of String)
- `snapshot_volumes` (Boolean)
- `storage_location` (String)
- `sys_excluded_namespaces` (List of String)
- `volume_snapshot_locations` (List of String)

<a id="nestedobjatt--schedules--spec--template--hooks"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations`

Read-Only:

- `resource` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource))

<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.resource`

Read-Only:

- `excluded_namespaces` (List of String)
- `included_namespaces` (List of String)
- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--label_selector))
- `name` (String)
- `post_hook` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--post_hook))
- `pre_hook` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--pre_hook))

<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--label_selector"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.resource.pre_hook`

Read-Only:

- `match_expression` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--pre_hook--match_expression))
- `match_labels` (Map of String)

<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--pre_hook--match_expression"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.resource.pre_hook.match_labels`

Read-Only:

- `key` (String)
- `operator` (String)
- `values` (List of String)



<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--post_hook"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.resource.pre_hook`

Read-Only:

- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--pre_hook--exec))

<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--pre_hook--exec"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.resource.pre_hook.exec`

Read-Only:

- `command` (List of String)
- `container` (String)
- `on_error` (String)
- `timeout` (String)



<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--pre_hook"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.resource.pre_hook`

Read-Only:

- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--pre_hook--exec))

<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--resource--pre_hook--exec"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.resource.pre_hook.exec`

Read-Only:

- `command` (List of String)
- `container` (String)
- `on_error` (String)
- `timeout` (String)





<a id="nestedobjatt--schedules--spec--template--label_selector"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations`

Read-Only:

- `match_expression` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--match_expression))
- `match_labels` (Map of String)

<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--match_expression"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.match_expression`

Read-Only:

- `key` (String)
- `operator` (String)
- `values` (List of String)



<a id="nestedobjatt--schedules--spec--template--or_label_selector"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations`

Read-Only:

- `match_expression` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--volume_snapshot_locations--match_expression))
- `match_labels` (Map of String)

<a id="nestedobjatt--schedules--spec--template--volume_snapshot_locations--match_expression"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations.match_expression`

Read-Only:

- `key` (String)
- `operator` (String)
- `values` (List of String)
Loading