Repository is archived
No commit activity in last 3 years
No release in over 3 years
Client for creating environments and apikeys for Rancher.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 0.10
~> 10.0
~> 3.5
~> 2.1

Runtime

~> 0.9.2
 Project Readme

Rancher::ManagementApi Gem

Usage

  1. Create a manager:

    a. If your Rancher has access control:

    manager = Rancher::ManagementApi::Token.build_manager(
      host: "http://localhost:8080",
      username: "youruser",
      password: "yourpassword"
    )

    b. Or just create a manager:

    manager = Rancher::ManagementApi::Manager.new(
      host: "http://localhost:8080",
    )
  2. Create a project (known in the UI as an Environment):

    project = manager.create_project("my environment name")
  3. Create a new API key:

    api_key = project.create_api_key("my api key name")
  4. Save your api_key's secret:

    puts "Your new RANCHER_ACCESS_KEY=#{api_key.publicValue}"
    puts "Your new RANCHER_SECRET_KEY=#{api_key.secretValue}"