powerflex_os_repository (Data Source)
This datasource is used to query the existing OS Repository from the PowerFlex array. The information fetched from this datasource can be used for getting the details / for further processing in resource block.
Example Usage
/*
Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://mozilla.org/MPL/2.0/
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
# commands to run this tf file : terraform init && terraform apply --auto-approve
# Get all OS Repositories
data "powerflex_os_repository" "example1" {
}
# # Get OS Repository details by ID
# data "powerflex_os_repository" "example2" {
# # this datasource supports filters like os repository id, name, source path, etc.
# # Note: If both filters are used simultaneously, the results will include any records that match either of the filters.
# filter {
# id = ["1234","5678"]
# }
# }
# # Get OS Repository details by all fields
# data "powerflex_os_repository" "example3" {
# # this datasource supports filters like os repository id, name, source path, etc.
# # Note: If both filters are used simultaneously, the results will include any records that match either of the filters.
# filter {
# base_url = ["http://195.0.0.0:8080"]
# created_by = ["system"]
# created_date = ["20XX-XX-XXT13:58:13.978+00:00"]
# from_web = false
# id = ["1234","5678"]
# image_type = ["vmwar_esxi"]
# in_use = false
# name = ["Dell EMC PowerFlex Embedded OS"]
# razor_name = ["DellEMCPowerFlexEmbeddedOS"]
# rcm_path = ["c:\\..."]
# repo_type = ["ISO"]
# source_path = ["z:\\ESXi\\ESXi-x.x.x-xxxxxx-x_Dell.zip"]
# state = ["available"]
# username = ["User"]
# }
# }
output "os_repository_result" {
value = data.powerflex_os_repository.example1
}
After the successful execution of above said block, we can see the output by executing terraform output
command. Also, we can fetch information via the variable: data.powerflex_os_repository.datasource_block_name.attribute_name
where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch.
Schema
Optional
filter
(Block, Optional) (see below for nested schema)
Read-Only
id
(String) ID of the OS Repository Datasourceos_repositories
(Attributes List) List of OS Repository Models (see below for nested schema)
Nested Schema for filter
Optional:
base_url
(Set of String) List of base_urlcreated_by
(Set of String) List of created_bycreated_date
(Set of String) List of created_datefrom_web
(Boolean) Value for from_webid
(Set of String) List of idimage_type
(Set of String) List of image_typein_use
(Boolean) Value for in_usename
(Set of String) List of namerazor_name
(Set of String) List of razor_namercm_path
(Set of String) List of rcm_pathrepo_type
(Set of String) List of repo_typesource_path
(Set of String) List of source_pathstate
(Set of String) List of stateusername
(Set of String) List of username
Nested Schema for os_repositories
Read-Only:
base_url
(String) Base URL of the OS repositorycreated_by
(String) User who created the OS repositorycreated_date
(String) Date of creation of the OS Repositoryfrom_web
(Boolean) Whether the OS repository is from the web or notid
(String) ID of the OS Repositoryimage_type
(String) Type of the OS image. Supported types are redhat7, vmware_esxi, sles, windows2016, windows2019in_use
(Boolean) Whether the OS repository is in use or notmetadata
(Attributes) Metadata of the OS Repository (see below for nested schema)name
(String) Name of the OS repositorypassword
(String) Password of the OS repositoryrazor_name
(String) Name of the Razorrcm_path
(String) Path of the RCMrepo_type
(String) Type of the OS repository. Default is ISOsource_path
(String) Source path of the OS imagestate
(String) State of the OS repositoryusername
(String) Username of the OS repository
Nested Schema for os_repositories.metadata
Read-Only:
repos
(Attributes List) List of OS Repository Metadata Repos (see below for nested schema)
Nested Schema for os_repositories.metadata.repos
Read-Only:
base_path
(String) Base path of the OS Repository Metadata Repodescription
(String) Description of the OS Repository Metadata Repogpg_key
(String) GPG key of the OS Repository Metadata Reponame
(String) Name of the OS Repository Metadata Repoos_packages
(Boolean) Whether the OS Repository Metadata Repo has OS packages or not