项目作者: marcy-terui

项目描述 :
Cloud Automation as Code with Cloud Automator
高级语言: Ruby
项目地址: git://github.com/marcy-terui/catlass.git
创建时间: 2017-12-12T07:58:28Z
项目社区:https://github.com/marcy-terui/catlass

开源协议:MIT License

下载


Catlass

Cloud Automation as Code with Cloud Automator

Installation

Add this line to your application’s Gemfile:

  1. gem 'catlass'

And then execute:

  1. $ bundle

Or install it yourself as:

  1. $ gem install catlass

Configuration

Set your Cloud Automator API key to CA_API_KEY environment variable.

  1. export CA_API_KEY=$YOUR_API_KEY

Usage

Comands

  1. $ catlass
  2. Commands:
  3. catlass apply # Apply the job definication
  4. catlass export # Export the job definication
  5. catlass help [COMMAND] # Describe available commands or one specific command
  6. Options:
  7. -f, [--file=FILE] # Job definication file
  8. # Default: CAfile
  9. [--color], [--no-color] # Disable colorize
  10. # Default: true

apply

Apply the job definication

  1. $ catlass help apply
  2. Usage:
  3. catlass apply
  4. Options:
  5. [--dry-run], [--no-dry-run] # Dry run (Only output the difference)
  6. -f, [--file=FILE] # Job definication file
  7. # Default: CAfile
  8. [--color], [--no-color] # Disable colorize
  9. # Default: true

export

Export the job definication

  1. $ catlass help export
  2. Usage:
  3. catlass export
  4. Options:
  5. [--write], [--no-write] # Write the job definication to the file
  6. [--split], [--no-split] # Split file by the jobs
  7. -f, [--file=FILE] # Job definication file
  8. # Default: CAfile
  9. [--color], [--no-color] # Disable colorize
  10. # Default: true

Job definication file

  1. Job "Auto Stop" do
  2. type "trigger_jobs"
  3. attributes do
  4. aws_account_id 999
  5. rule_type "cron"
  6. rule_value do
  7. hour "19"
  8. minutes "0"
  9. time_zone "Tokyo"
  10. schedule_type "weekly"
  11. weekly_schedule "", "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"
  12. national_holiday_schedule "false"
  13. end
  14. action_type "stop_instances"
  15. action_value do
  16. region "ap-northeast-1"
  17. tag_key "auto-stop"
  18. tag_value "on"
  19. trace_status "false"
  20. specify_instance "tag"
  21. end
  22. active false
  23. end
  24. end

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/marcy-terui/catlass. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Catlass project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.