You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# generated by https://github.com/hashicorp/terraform-plugin-docs
3
2
page_title: "spectrocloud_pack Data Source - terraform-provider-spectrocloud"
4
3
subcategory: ""
5
4
description: |-
6
-
5
+
This data resource provides the ability to search for a pack in the Palette registries. It supports more advanced search criteria than the pack_simple data source.
7
6
---
8
7
9
8
# spectrocloud_pack (Data Source)
10
9
10
+
This data resource provides the ability to search for a pack in the Palette registries. It supports more advanced search criteria than the pack_simple data source.
11
11
12
12
13
+
14
+
~> Starting with version 0.21.0 the attribute `registry_uid` is required.
15
+
13
16
## Example Usage
14
17
15
-
```terraform
16
-
data "spectrocloud_pack" "cni-calico" {
17
-
name = "cni-calico"
18
-
version = "3.16.0"
19
18
20
-
# (alternatively)
21
-
# id = "5fd0ca727c411c71b55a359c"
22
-
# name = "cni-calico-azure"
23
-
# cloud = ["azure"]
19
+
An example of how to use this data source to retrieve a specific pack from the community registry.
20
+
21
+
```hcl
22
+
data "spectrocloud_registry" "community_registry" {
In this example, a filter is applied to retrieve a Calico CNI pack from the Palette OCI registry that is compatible with Edge clusters and has a version greater than 3.26.9.
36
+
37
+
-> The filter attribute is a string that can contain multiple filters separated by the `AND`, `OR` operator. You can filter for a pack by using the attributes retured in the `spec` object of the payload provided by the `v1/packs/search` endpoint.
38
+
Refer to the Palette Pack Search API endpoint [documentation](https://docs.spectrocloud.com/api/v1/v-1-packs-search/) for more information on the available filters.
39
+
40
+
41
+
42
+
```hcl
43
+
data "spectrocloud_registry" "palette_registry_oci" {
-`cloud` (Set of String) Filter results by cloud type. If not provided, all cloud types are returned.
59
+
-`filters` (String) Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API [pack search API endpoint documentation](https://docs.spectrocloud.com/api/v1/v-1-packs-search/) for filter examples..
60
+
-`id` (String) The UID of the pack returned.
61
+
-`name` (String) The name of the pack to search for.
62
+
-`registry_uid` (String) The UID of the registry to search for the pack in. This is a required parameter starting from version 0.21.0.
63
+
-`type` (String) The type of pack to search for. Supported values are `helm`, `manifest`, `container`, `operator-instance`.
64
+
-`version` (String) The version of the pack to search for.
42
65
43
66
### Read-Only
44
67
45
-
-`id` (String) The ID of this resource.
46
-
-`values` (String)
68
+
-`values` (String) The YAML values of the pack returned as string.
Copy file name to clipboardExpand all lines: docs/data-sources/pack_simple.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,17 @@
2
2
page_title: "spectrocloud_pack_simple Data Source - terraform-provider-spectrocloud"
3
3
subcategory: ""
4
4
description: |-
5
-
5
+
This data resource provides a simpler user experience for searching for a pack in Palette registries.
6
6
---
7
7
8
8
# spectrocloud_pack_simple (Data Source)
9
9
10
-
10
+
This data resource provides a simpler user experience for searching for a pack in Palette registries.
11
11
12
12
## Example Usage
13
13
14
+
~> Starting with version 0.21.0 the attribute `registry_uid` is required.
15
+
14
16
```hcl
15
17
data "spectrocloud_registry" "registry" {
16
18
name = "Public Repo"
@@ -36,7 +38,7 @@ data "spectrocloud_pack_simple" "pack" {
36
38
### Optional
37
39
38
40
-`context` (String) Indicates in which context registry should be searched for the pack values. Allowed values are `system`, `project` or `tenant`. Defaults to `project`.If the `project` context is specified, the project name will sourced from the provider configuration parameter [`project_name`](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs#schema).
39
-
-`registry_uid` (String) The unique identifier of the registry the pack belongs to.
41
+
-`registry_uid` (String) The unique identifier of the registry the pack belongs to. This is a required parameter starting from version 0.21.0
Copy file name to clipboardExpand all lines: spectrocloud/data_source_pack.go
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,50 +14,59 @@ import (
14
14
funcdataSourcePack() *schema.Resource {
15
15
return&schema.Resource{
16
16
ReadContext: dataSourcePackRead,
17
+
Description: "This data resource provides the ability to search for a pack in the Palette registries. It supports more advanced search criteria than the `pack_simple` data source.",
17
18
18
19
Schema: map[string]*schema.Schema{
19
20
"filters": {
20
21
Type: schema.TypeString,
21
22
Optional: true,
23
+
Description: "Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API [pack search API endpoint documentation](https://docs.spectrocloud.com/api/v1/v-1-packs-search/) for filter examples..",
In this example, a filter is applied to retrieve a Calico CNI pack from the Palette OCI registry that is compatible with Edge clusters and has a version greater than 3.26.9.
36
+
37
+
-> The filter attribute is a string that can contain multiple filters separated by the `AND`, `OR` operator. You can filter for a pack by using the attributes retured in the `spec` object of the payload provided by the `v1/packs/search` endpoint.
38
+
Refer to the Palette Pack Search API endpoint [documentation](https://docs.spectrocloud.com/api/v1/v-1-packs-search/) for more information on the available filters.
39
+
40
+
41
+
42
+
```hcl
43
+
data "spectrocloud_registry" "palette_registry_oci" {
0 commit comments