Resource Defintions (resources.yaml)¶
Resources are described in a resources.yaml file, which can contain
the following sections:
resourcesoptional_resourcesoptions
resources Section¶
The file must contain a resources section containing a mapping of
resource names to definitions. Definitions should be mappings with one of
the following sets of keys:
URL Resources
urlURL for the resourcehashCryptographic hash for the resource (can also be a URL to a hash)hash_typeAlgorithm used to generate the hash; e.g., md5, sha512, etc.
PyPI Resources
pypiA Python package requirement spec, such asjujuresources>=0.2(can also be a URL directly to a package)hashCryptographic hash for the resource (for use with package URLs)hash_typeAlgorithm used to generate the hash; e.g., md5, sha512, etc. (for use with package URLs)
Local or Bundled File Resources
filePath to local file (can be relative to$CHARM_DIR)hashCryptographic hash for the resourcehash_typeAlgorithm used to generate the hash; e.g., md5, sha512, etc.
optional_resources Section¶
The file may contain an optional_resources section containing a mapping
of resource names to defintions. These take the same form as the required
resource definitions.
Optional resources will not be fetched or verified by default, and must
either be explicitly named, or the all option given.
options Section¶
The file may contain an options section, which supports the
following options:
output_dirLocation for the fetched resources (default:./resources)
Example¶
An example resources.yaml might be:
resources:
charmhelpers:
pypi: charmhelpers>=0.2.2
pyaml:
pypi: pyaml>=3.11
optional_resources:
java-x86_64:
url: http://jr-packages.s3-website-us-east-1.amazonaws.com/ibm/x86_64/java.bin
hash: b377b7cccdd281bc5e4c4071f80e84a3
hash_type: md5
java-amd:
url: http://jr-packages.s3-website-us-east-1.amazonaws.com/ibm/amd.bin
hash: e0c54b25e2199c3bb325520d9f9d047a
hash_type: md5
options:
ouptut_dir: /var/share/resources