Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
- Puppet >= 4.10.0 < 7.0.0
- , ,
Start using this module
Add this module to your Puppetfile:
mod 'rharrison-holland', '1.1.0'
Learn more about managing modules with a PuppetfileDocumentation
holland
Puppet module to manage Holland Backup Manager
Table of Contents
- Description
- Setup - The basics of getting started with holland
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
This module will setup the Holland Backup Manager and manage its providers and backup sets. Currently only the mongodump and mysqldump providers are supported by this module.
Setup
Setup Requirements
This module requires puppetlabs/stdlib and if you are using Puppet 6 or above it also requires puppetlabs/augeas_core
mongodump Requirements
If you are going to use the holland-mongodump
provider you will need to make
sure the mongodump
command is installed and in the path outside of the module
as the package does not pull it in as a dependency. I'm not working around this
in the module because of the many different ways to install the utility. It will need to match the version and deployment method of your MongoDB deployment.
Beginning with holland
At a minimum you will need to simply include the main holland
class and one
of the providers.
include ::holland
include ::holland::mysqldump
Usage
Please see the REFFERENCE.md for the reference documentation and examples of usage.
Limitations
The version of holland-mongodump
that is included in the EPEL pulls in the
python-pymongo
package from EPEL as a dependency. This package matches with
the version of MongoDB also included in EPEL but will have authentication errors
if you're trying to backup more recent versions of MongoDB. To work around
this issue I've used the following hack to upgrade pymongo
via pip
as a
workaround.
package { 'pymongo':
ensure => '3.7.2',
install_options => '--upgrade',
provider => 'pip',
require => Package['holland-mongodump', 'python2-pip'],
}
Development
Pull requests are welcome especially for unit tests, and additional providers.
TODO
- Support more backup providers
- Add logging format config to main Holland configuration
- Support historic backup set size calculation for MySQL providers
- Support "hook" commands to be run before, after, or on failure of a backup.
- Better unit tests
Reference
Table of Contents
Classes
Public Classes
holland
: Common setup and resources for the Holland Backup Managerholland::mongodump
: Manage the mongodump provider for the Holland Backup Managerholland::mysqldump
: Manage the Holland mysqldump provider
Private Classes
holland::config
: Manage the overall Holland Backup Manager configuration.holland::config::remove_default
: An exec to remove the default backupset if it doesn't exist.holland::install
: Basic install of Holland resourcesholland::mongodump::config
: Configuration for the Holland mongodump providerholland::mongodump::install
: Install the Holland mongodump providerholland::mysqldump::config
: Manage the Holland mysqldump provider configuration.holland::mysqldump::install
: Manage theholland-mysqldump
package
Defined types
holland::mongodump::backupset
: Configures a mongodump backup set for Hollandholland::mysqldump::backupset
: Configures a mysqldump backup set for Holland
Classes
holland
Common setup and resources for the Holland Backup Manager.
There isn't an Augeas lens for holland.conf
in the
upstream project yet so we'll need to provide one ourselves to manage the
main configuration from more than one class. Since Puppet requires
augeas-libs
we don't need to manage the parrent directories since they'll
already be in place.
Examples
Basic
include holland
Parameters
The following parameters are available in the holland
class.
ensure
Data type: Enum['absent', 'present']
Should Holland be installed or not.
Default value: present
backup_directory
Data type: String
Top-level directory where backups are held.
Default value: '/var/spool/holland'
logfile
Data type: String
The file Holland logs to
Default value: '/var/log/holland/holland.log'
log_level
Data type: Enum[ 'debug', 'info', 'warning', 'error', 'critical' ]
Sets the verbosity of Holland’s logging process.
Default value: 'info'
path
Data type: String
Defines a path for holland and its spawned processes
Default value: '/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin'
plugin_dirs
Data type: String
Defines where the plugins can be found. This can be a comma-separated list but usually does not need to be modified.
Default value: '/usr/share/holland/plugins'
umask
Data type: String
Sets the umask of the resulting backup files.
Default value: '0007'
holland::mongodump
Manage the mongodump provider for the Holland Backup Manager
Note: This does not install the actual mongodump
command since there
are several different options for doing so. Especially with software
collections.
Examples
Basic
include holland::mongodump
Parameters
The following parameters are available in the holland::mongodump
class.
ensure
Data type: Enum['absent', 'present']
Should the plugin be installed or not.
Default value: present
additional_options
Data type: Optional[String]
Any additional options to the mongodump
command-line utility these should
show up exactly as they are on the command line. e.g.: '--gzip'
Default value: undef
after_backup_command
Data type: Optional[String]
Command to run after successful backup.
Default value: undef
authentication_database
Data type: String
The database the mongo user needs to authenticate against.
Default value: ''
before_backup_command
Data type: Optional[String]
Run a shell command before a backup starts.
Default value: undef
compression_level
Data type: Integer[0]
What compression level to use. Lower numbers mean faster compression, though also generally a worse compression ratio. Generally, levels 1-3 are considered fairly fast and still offer good compression for textual data. Levels above 7 can often cause a larger impact on the system due to needing much more CPU resources. Setting the level to 0 effectively disables compresion.
Default value: 1
compression_method
Data type: Enum[ 'gzip', 'gzip-rsyncable', 'bzip2', 'pbzip2', 'lzop' ]
Which compression method to use. Note that lzop is not often installed by default on many Linux distributions and may need to be installed separately.
Default value: 'gzip'
failed_backup_command
Data type: Optional[String]
Command to run after failed backup.
Default value: undef
host
Data type: String
Hostname for mongodump to connect with.
Default value: 'localhost'
password
Data type: String
Password for mongodump to authenticate with.
Default value: ''
username
Data type: String
Username for mongodump to authenticate with.
Default value: ''
holland::mysqldump
This class manages the Holland Backup Manager
mysqldump
provider.
Examples
Basic
include holland::mysqldump
Parameters
The following parameters are available in the holland::mysqldump
class.
ensure
Data type: Enum['absent', 'present']
Should the mysqldump provider be installed or not.
Default value: present
additional_options
Data type: String
Specify additional options directly to the mysqldump
command if there is
no native Holland option for it. These should show up exactly as they would
on the command line. e.g.: '--flush-privileges --reset-master'
Default value: ''
after_backup_command
Data type: Optional[String]
Command to run after successful backup.
Default value: undef
before_backup_command
Data type: Optional[String]
Run a shell command before a backup starts.
Default value: undef
bin_log_position
Data type: Enum['no', 'yes']
Record the binary log name and position at the time of the backup. Note
that if both 'stop-slave'
and 'bin-log-position'
are enabled, Holland
will grab the master binary log name and position at the time of the backup
which can be useful in using the backup to create slaves or for point in
time recovery using the master’s binary log. This information is found
within the 'backup.conf'
file located in the backup-set destination
directory (/var/spool/holland/<backup-set>/<backup>
by default).
For example:
[mysql:replication]
slave_master_log_pos = 4512
slave_master_log_file = 260792-mmm-agent1-bin-log.000001
Default value: 'no'
compress_bin_path
Data type: Optional[String]
This only needs to be defined if the compression utility is in a non-standard location, or not in the system path.
Default value: undef
compress_inline
Data type: Enum['no', 'yes']
Whether or not to pipe the output of mysqldump
into the compression
utility. Enabling this is recommended since it usually only marginally
impacts performance, particularly when using a lower compression level.
Default value: 'yes'
compress_level
Data type: Integer[0, 9]
Specify the compression ratio from 0
to 9
. The lower the number, the
lower the compression ratio, but the faster the backup will take. Generally,
setting the lever to 1
or 2
results in favorable compression of textual
data and is noticeably faster than the higher levels. Setting the level to
0
effectively disables compression.
Default value: 1
compress_method
Data type: Enum['gzip', 'pigz', 'bzip', 'lzop', 'lzma']
Define which compression method to use. Note that lzop
and lzma
may
not be available on every system and may need to be compiled / installed.
Default value: 'gzip'
databases
Data type: Optional[String]
Comma-delimited glob patterns for matching databases. Only databases
matching these patterns will be backed up. The default is'*'
which
includes everything.
Default value: undef
defaults_extra_file
Data type: String
Comma seperated list of locations to look for the MySQL conection
information using the standard .my.cnf
conventions.
Default value: '/root/.my.cnf,~/.my.cnf,'
dump_events
Data type: Enum['no', 'yes']
Whether or not to dump events explicitly. Like routines, events are stored in the 'mysql' database. Nonetheless, it can sometimes be convenient to include them in the backup-set directly. Note: This feature requires MySQL 5.1 or later.
Default value: 'no'
dump_routines
Data type: Enum['no', 'yes']
Whether or not to backup routines in the backup set directly. Routines are stored in the 'mysql' database, but it can sometimes be convenient to include them in a backup-set directly.
Default value: 'no'
exclude_databases
Data type: Optional[String]
Comma-delimited glob patterns to exclude particular databases.
Default value: undef
exclude_tables
Data type: Optional[String]
Comma-delimited glob patterns to exclude particular tables.
Default value: undef
failed_backup_command
Data type: Optional[String]
Command to run after failed backup.
Default value: undef
file_per_database
Data type: Enum['no', 'yes']
Whether or not to split up each database into its own file. Note that it can be more consistent and efficient to backup all databases into one file, however this means that restore a single database can be difficult if multiple databases are defined in the backup set.
Default value: 'no'
flush_logs
Data type: Enum['no', 'yes']
Whether or not to run FLUSH LOGS
in MySQL with the backup. When
FLUSH LOGS
is actually executed depends on which if database filtering is
being used and whether or not file-per-database
is enabled. Generally
speaking, it does not make sense to use flush-logs
with
file-per-database
since the binary logs will not be consistent with the
backup.
Default value: 'no'
lock_method
Data type: Enum[ 'flush-lock', 'lock-tables', 'single-transaction', 'auto-detect', 'none' ]
flush-lock
will place a global lock on all tables involved in the backup
regardless of whether or not they are in the backup-set. If
file-per-database
is enabled, then flush-lock
will lock all tables for
every database being backed up. In other words, this option may not make
much sense when using file-per-database
.
lock-tables
will lock all tables involved in the backup. If
file-per-database
is enabled, then lock-tables
will only lock all the
tables associated with that database.
single-transaction
will force running a backup within a transaction. This
allows backing up of transactional tables without imposing a lock however
will NOT properly backup non-transacitonal tables.
auto-detect
will choose single-transaction unless Holland finds
non-transactional tables in the backup-set.
none
will completely disable locking. This is generally only viable on a
MySQL slave and only after traffic has been diverted, or slave services
suspended.
Default value: 'auto-detect'
mysql_binpath
Data type: Optional[String]
Defines the location of the MySQL binary utilities. If not provided, Holland will use whatever is in the path.
Default value: undef
mysql_host
Data type: Optional[String]
The FQDN of the remote host to connect to MySQL on.
Default value: undef
mysql_password
Data type: Optional[String]
The password for the MySQL user.
Default value: undef
mysql_port
Data type: Optional[Integer]
Used if MySQL is running on a port other than 3306
.
Default value: undef
mysql_socket
Data type: Optional[String]
The socket file to connect to MySQL with. eg. '/tmp/mysqld.sock'
.
Default value: undef
mysql_user
Data type: Optional[String]
The user to connect to MySQL as.
Default value: undef
stop_slave
Data type: Enum['no', 'yes']
This is useful only when running Holland on a MySQL slave. Instructs Holland to suspend slave services on the server prior to running the backup. Suspending the slave does not change the backups, but does prevent the slave from spooling up relay logs. The default is not to suspend the slave (if applicable).
Default value: 'no'
tables
Data type: Optional[String]
Only include the specified tables. Comma seperated glob patterns.
Default value: undef
Defined types
holland::mongodump::backupset
Configures a mongodump backup set for Holland
Examples
Inherits from provider
include ::holland::mongodump
holland::mongodump::backupset { "localhost":
ensure => present,
authentication_database => 'admin',
host => 'localhost',
password => 'SomeThingToChange',
username => 'admin',
}
Parameters
The following parameters are available in the holland::mongodump::backupset
defined type.
ensure
Data type: Enum['absent', 'present']
Should the backup set be installed or not.
Default value: present
additional_options
Data type: Optional[String]
Any additional options to the mongodump
command-line utility these should
show up exactly as they are on the command line. e.g.: '--gzip'
Default value: undef
after_backup_command
Data type: Optional[String]
Command to run after successful backup.
Default value: undef
authentication_database
Data type: Optional[String]
The database the mongo user needs to authenticate against.
Default value: undef
auto_purge_failures
Data type: Enum['no', 'yes']
Specifies whether to keep a failed backup or to automatically remove the
backup directory. By default this is on with the intention that whatever
process is calling holland will retry when a backup fails. This behavior
can be disabled by setting auto-purge-failures = no
when partial backups
might be useful or when troubleshooting a backup failure.
Default value: 'yes'
backups_to_keep
Data type: Integer[1]
Specifies the number of backups to keep for a backup-set.
Default value: 1
before_backup_command
Data type: Optional[String]
Run a shell command before a backup starts.
Default value: undef
compress_inline
Data type: Enum['no', 'yes']
Whether or not to pipe the output of mongodump
into the compression
utility. Enabling this is recommended since it usually only marginally
impacts performance, particularly when using a lower compression level.
Default value: 'yes'
compression_level
Data type: Integer[0]
What compression level to use. Lower numbers mean faster compression, though also generally a worse compression ratio. Generally, levels 1-3 are considered fairly fast and still offer good compression for textual data. Levels above 7 can often cause a larger impact on the system due to needing much more CPU resources. Setting the level to 0 effectively disables compresion.
Default value: 1
compression_method
Data type: Enum[ 'gzip', 'gzip-rsyncable', 'bzip2', 'pbzip2', 'lzop' ]
Which compression method to use. Note that lzop is not often installed by default on many Linux distributions and may need to be installed separately.
Default value: 'gzip'
estimated_size_factor
Data type: Float
Specifies the scale factor when Holland decides if there is enough free space to perform a backup. This number is multiplied against what each individual plugin reports its estimated backup size when Holland is verifying sufficient free space for the backupset.
Default value: 1.0
failed_backup_command
Data type: Optional[String]
Command to run after failed backup.
Default value: undef
host
Data type: Optional[String]
Hostname for mongodump to connect with.
Default value: undef
password
Data type: Optional[String]
Password for mongodump to authenticate with.
Default value: undef
purge_policy
Data type: Enum[ 'manual', 'before-backup', 'after-backup' ]
Specifies when to run the purge routine on a backupset. By default this is
run after a new successful backup completes. Up to backups_to_keep
backups
will be retained including the most recent.
before-backup
will run the purge routine just before a new backup starts.
This will retain up to backups_to_keep
backups before the new backup is
even started allowing purging all previous backups if backups_to_keep
is
set to 0
. This behavior is useful if some other process is retaining
backups off-server and disk space is at a premium.
manual
will never run the purge routine automatically. Either
holland purge
must be run externally or an explicit removal of desired
backup directories can be done at some later time.
Default value: 'after-backup'
username
Data type: Optional[String]
Username for mongodump to authenticate with.
Default value: undef
holland::mysqldump::backupset
Configures a mysqldump backup set for Holland
Examples
Basic
holland::mysqldump::backupset { 'namevar': }
Parameters
The following parameters are available in the holland::mysqldump::backupset
defined type.
ensure
Data type: Enum['absent', 'file']
Wheither to ensure the configuration is installed or not.
Default value: file
additional_options
Data type: Optional[String]
Specify additional options directly to the mysqldump
command if there is
no native Holland option for it. These should show up exactly as they would
on the command line. e.g.: '--flush-privileges --reset-master'
Default value: undef
after_backup_command
Data type: Optional[String]
Command to run after successful backup.
Default value: undef
auto_purge_failures
Data type: Enum['no', 'yes']
Specifies whether to keep a failed backup or to automatically remove the
backup directory. By default this is on with the intention that whatever
process is calling holland will retry when a backup fails. This behavior
can be disabled by setting auto-purge-failures = no
when partial backups
might be useful or when troubleshooting a backup failure.
Default value: 'yes'
backups_to_keep
Data type: Integer
Specifies the number of backups to keep for a backup-set.
Default value: 1
before_backup_command
Data type: Optional[String]
Run a shell command before a backup starts.
Default value: undef
compress_bin_path
Data type: Optional[String]
This only needs to be defined if the compression utility is in a non-standard location, or not in the system path.
Default value: undef
compress_inline
Data type: Enum['no', 'yes']
Whether or not to pipe the output of mysqldump
into the compression
utility. Enabling this is recommended since it usually only marginally
impacts performance, particularly when using a lower compression level.
Default value: 'yes'
compress_level
Data type: Integer[0, 9]
Specify the compression ratio from 0
to 9
. The lower the number, the
lower the compression ratio, but the faster the backup will take. Generally,
setting the lever to 1
or 2
results in favorable compression of textual
data and is noticeably faster than the higher levels. Setting the level to
0
effectively disables compression.
Default value: 1
compress_method
Data type: Enum['gzip', 'pigz', 'bzip', 'lzop', 'lzma']
Define which compression method to use. Note that lzop
and lzma
may
not be available on every system and may need to be compiled / installed.
Default value: 'gzip'
databases
Data type: Optional[String]
Comma-delimited glob patterns for matching databases. Only databases
matching these patterns will be backed up. The default is'*'
which
includes everything.
Default value: undef
defaults_extra_file
Data type: Optional[String]
Comma seperated list of locations to look for the MySQL conection
information using the standard .my.cnf
conventions.
Default value: undef
dump_events
Data type: Optional[Enum['no', 'yes']]
Whether or not to dump events explicitly. Like routines, events are stored in the 'mysql' database. Nonetheless, it can sometimes be convenient to include them in the backup-set directly. Note: This feature requires MySQL 5.1 or later.
Default value: undef
dump_routines
Data type: Optional[Enum['no', 'yes']]
Whether or not to backup routines in the backup set directly. Routines are stored in the 'mysql' database, but it can sometimes be convenient to include them in a backup-set directly.
Default value: undef
estimated_size_factor
Data type: Float
Specifies the scale factor when Holland decides if there is enough free space to perform a backup. This number is multiplied against what each individual plugin reports its estimated backup size when Holland is verifying sufficient free space for the backupset.
Default value: 1.0
exclude_databases
Data type: Optional[String]
Comma-delimited glob patterns to exclude particular databases.
Default value: undef
exclude_tables
Data type: Optional[String]
Comma-delimited glob patterns to exclude particular tables.
Default value: undef
failed_backup_command
Data type: Optional[String]
Command to run after failed backup.
Default value: undef
file_per_database
Data type: Optional[Enum['no', 'yes']]
Whether or not to split up each database into its own file. Note that it can be more consistent and efficient to backup all databases into one file, however this means that restore a single database can be difficult if multiple databases are defined in the backup set.
Default value: undef
flush_logs
Data type: Optional[Enum['no', 'yes']]
Whether or not to run FLUSH LOGS
in MySQL with the backup. When
FLUSH LOGS
is actually executed depends on which if database filtering is
being used and whether or not file-per-database
is enabled. Generally
speaking, it does not make sense to use flush-logs
with
file-per-database
since the binary logs will not be consistent with the
backup.
Default value: undef
lock_method
Data type: Enum[ 'flush-lock', 'lock-tables', 'single-transaction', 'auto-detect', 'none' ]
flush-lock
will place a global lock on all tables involved in the backup
regardless of whether or not they are in the backup-set. If
file-per-database
is enabled, then flush-lock
will lock all tables for
every database being backed up. In other words, this option may not make
much sense when using file-per-database
.
lock-tables
will lock all tables involved in the backup. If
file-per-database
is enabled, then lock-tables
will only lock all the
tables associated with that database.
single-transaction
will force running a backup within a transaction. This
allows backing up of transactional tables without imposing a lock however
will NOT properly backup non-transacitonal tables.
auto-detect
will choose single-transaction unless Holland finds
non-transactional tables in the backup-set.
none
will completely disable locking. This is generally only viable on a
MySQL slave and only after traffic has been diverted, or slave services
suspended.
Default value: 'auto-detect'
mysql_binpath
Data type: Optional[String]
Defines the location of the MySQL binary utilities. If not provided, Holland will use whatever is in the path.
Default value: undef
mysql_host
Data type: Optional[String]
The FQDN of the remote host to connect to MySQL on.
Default value: undef
mysql_password
Data type: Optional[String]
The password for the MySQL user.
Default value: undef
mysql_port
Data type: Optional[Integer]
Used if MySQL is running on a port other than 3306
.
Default value: undef
mysql_socket
Data type: Optional[String]
The socket file to connect to MySQL with. eg. '/tmp/mysqld.sock'
.
Default value: undef
mysql_user
Data type: Optional[String]
The user to connect to MySQL as.
Default value: undef
purge_policy
Data type: Enum['manual', 'before-backup', 'after-backup']
Specifies when to run the purge routine on a backupset. By default this is
run after a new successful backup completes. Up to backups_to_keep
backups
will be retained including the most recent.
before-backup
will run the purge routine just before a new backup starts.
This will retain up to backups_to_keep
backups before the new backup is
even started allowing purging all previous backups if backups_to_keep
is
set to 0
. This behavior is useful if some other process is retaining
backups off-server and disk space is at a premium.
manual
will never run the purge routine automatically. Either
holland purge
must be run externally or an explicit removal of desired
backup directories can be done at some later time.
Default value: 'after-backup'
stop_slave
Data type: Optional[Enum['no', 'yes']]
This is useful only when running Holland on a MySQL slave. Instructs Holland to suspend slave services on the server prior to running the backup. Suspending the slave does not change the backups, but does prevent the slave from spooling up relay logs. The default is not to suspend the slave (if applicable).
Default value: undef
tables
Data type: Optional[String]
Only include the specified tables. Comma seperated glob patterns.
Default value: undef
2019-09-04 Russell Harrison rharrison@fedoraproject.org - 1.1.0
- Update to the latest Puppet PDK
- Enable resource coverage reports
- Start unit testing resources
- Cleanup metadata
2019-08-09 Brian Wolford bw@patientpay.com - 1.1.0
- Add support for after-backup-command, before-backup-command and failed-backup-command
2019-01-25 Russell Harrison rharrison@fedoraproject.org - 1.0.0
- Updates to bring the module in line with Puppet 5+ standards
- Configure mongodump provider and backup sets
- Update Augeas lens to work with Puppetlabs omnibus package and Holland log format setting
2014-08-19 Russell Harrison rharrison@fedoraproject.org - 0.0.6
- Play nice with the puppetlabs-mysql module
2014-06-09 Russell Harrison rharrison@fedoraproject.org - 0.0.5
- As of version 1.0.0-5 of the Red Hat rpm test lenses are no longer included in augeas-libs so I'm going to comment out including it for now.
2013-05-30 Russell Harrison rharrison@fedoraproject.org - 0.0.4
- Specify which files to load and lenes to use for augeas types for major performance improvements
2013-05-14 Russell Harrison rharrison@fedoraproject.org - 0.0.3
- Move to absolute qualification of variables and classes to avoid https://projects.puppetlabs.com/issues/17335
2013-01-24 Russell Harrison rharrison@fedoraproject.org - 0.0.2
- Fix incorrect variable in the mysqldump backupset template
- Include licence documentation
Dependencies
- puppetlabs/augeas_core (>= 1.0.0 < 2.0.0)
- puppetlabs/stdlib (>= 5.0.0 < 6.0.0)
- puppetlabs/mysql (>= 6.0.0 < 11.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache 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://www.apache.org/licenses/LICENSE-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.