Skip to content

Commit

Permalink
Merge pull request #54 from cloudsmith-io/NO-TICKET/update_docs
Browse files Browse the repository at this point in the history
Update package documentation
  • Loading branch information
BartoszBlizniak authored Jun 14, 2023
2 parents 35d4817 + 84eef89 commit 7849c86
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions docs/data-sources/package.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,40 @@ data "cloudsmith_package_list" "test" {
repository = cloudsmith_repository.test.name
namespace = cloudsmith_repository.test.namespace
filters = [
"name:dummy-package",
"version:1.0.48",
]
"name:dummy-package",
"version:1.0.48",
]
}
data "cloudsmith_package" "test" {
repository = cloudsmith_repository.test.name
namespace = cloudsmith_repository.test.namespace
identifier = data.cloudsmith_package_list.test.packages[0].slug_perm
download = true
output_path = "/path/to/save/package"
download_dir = "/path/to/your/directory"
}
```

## Argument Reference

* `namespace` (Required): The namespace of the package.
* `repository` (Required): The repository of the package.
* `identifier` (Required): The identifier for the package.
* `download` (Optional): If set to true, the package will be downloaded. Defaults to false. If set to false, the CDN url will be available in the `output_path`.
* `output_path` (Optional): The local file system path where the downloaded package will be stored. Defaults to OS's temp direcotry if no `output_path` is provided and `download` set to true.

- `namespace` (Required): The namespace of the package.
- `repository` (Required): The repository of the package.
- `identifier` (Required): The identifier for the package.
- `download` (Optional): If set to true, the package will be downloaded. Defaults to false. If set to false, the CDN URL will be available in the `output_path`.
- `download_dir` (Optional): The directory where the file will be downloaded to. If not set and `download` is set to `true`, it will default to the operating system's default temporary directory and save the file there.

## Attribute Reference

- `cdn_url`: The URL of the package to download. This attribute is computed and available only when the `download` argument is set to `false`.
- `format`: The format of the package.
- `is_sync_awaiting`: Indicates whether the package is awaiting synchronization.
- `is_sync_completed`: Indicates whether the package synchronization has completed.
- `is_sync_failed`: Indicates whether the package synchronization has failed.
- `is_sync_in_flight`: Indicates whether the package synchronization is currently in-flight.
- `is_sync_in_progress`: Indicates whether the package synchronization is currently in-progress.
- `name`: The name of the package.
- `output_path`: The location of the package. If the `download` argument is set to `true`, this will provide the path where the package is downloaded.
- `output_directory`: The directory where the package is downloaded.
- `slug`: The public unique identifier for the package.
- `slug_perm`: The slug_perm that immutably identifies the package.
- `version`: The version of the package.

0 comments on commit 7849c86

Please sign in to comment.