Class: Rancher::ManagementApi::Project
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Rancher::ManagementApi::Project
- Defined in:
- lib/rancher/management_api/project.rb
Instance Attribute Summary collapse
-
#conn ⇒ Object
readonly
Returns the value of attribute conn.
Class Method Summary collapse
Instance Method Summary collapse
- #create_api_key(name) ⇒ Object
-
#initialize(conn, data) ⇒ Project
constructor
A new instance of Project.
Constructor Details
#initialize(conn, data) ⇒ Project
Returns a new instance of Project.
21 22 23 24 |
# File 'lib/rancher/management_api/project.rb', line 21 def initialize(conn, data) @conn = conn super(data) end |
Instance Attribute Details
#conn ⇒ Object (readonly)
Returns the value of attribute conn.
19 20 21 |
# File 'lib/rancher/management_api/project.rb', line 19 def conn @conn end |
Class Method Details
.create(conn, name) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rancher/management_api/project.rb', line 6 def self.create(conn, name) env_response = conn.post do |req| req.url "/v1/project" req.body = { name: name, }.to_json end data = JSON.parse(env_response.body) new(conn, data) end |