Class: Confy::Client
- Inherits:
-
Object
- Object
- Confy::Client
- Defined in:
- lib/confy/client.rb
Instance Method Summary collapse
-
#access(org, project) ⇒ Object
List of teams whic have access to the project.
-
#config(org, project, env) ⇒ Object
Any member of the team which has access to the project can retrieve any of it’s environment’s configuration document or edit it.
-
#envs(org, project) ⇒ Object
Every project has a default environment named Production.
-
#initialize(auth = {}, options = {}) ⇒ Client
constructor
A new instance of Client.
-
#members(org, team) ⇒ Object
Teams contain a list of users.
-
#orgs ⇒ Object
Organizations are owned by users and only (s)he can add/remove teams and projects for that organization.
-
#projects(org) ⇒ Object
An organization can contain any number of projects.
-
#teams(org) ⇒ Object
Every organization will have a default team named __Owners__.
-
#user ⇒ Object
User who is authenticated currently.
Constructor Details
#initialize(auth = {}, options = {}) ⇒ Client
Returns a new instance of Client.
17 18 19 |
# File 'lib/confy/client.rb', line 17 def initialize(auth = {}, = {}) @http_client = Confy::HttpClient::HttpClient.new(auth, ) end |
Instance Method Details
#access(org, project) ⇒ Object
List of teams whic have access to the project. Default team __Owners__ will have access to every project. Authenticated user should be the owner of the organization for the below endpoints.
org - Name of the organization project - Name of the project
57 58 59 |
# File 'lib/confy/client.rb', line 57 def access(org, project) Confy::Api::Access.new(org, project, @http_client) end |
#config(org, project, env) ⇒ Object
Any member of the team which has access to the project can retrieve any of it’s environment’s configuration document or edit it.
org - Name of the organization project - Name of the project env - Name of the environment
74 75 76 |
# File 'lib/confy/client.rb', line 74 def config(org, project, env) Confy::Api::Config.new(org, project, env, @http_client) end |
#envs(org, project) ⇒ Object
Every project has a default environment named Production. Each environment has __one__ configuration document which can have many keys and values.
org - Name of the organization project - Name of the project
65 66 67 |
# File 'lib/confy/client.rb', line 65 def envs(org, project) Confy::Api::Envs.new(org, project, @http_client) end |
#members(org, team) ⇒ Object
Teams contain a list of users. The Authenticated user should be the owner of the organization.
org - Name of the organization team - Name of the team
42 43 44 |
# File 'lib/confy/client.rb', line 42 def members(org, team) Confy::Api::Members.new(org, team, @http_client) end |
#orgs ⇒ Object
Organizations are owned by users and only (s)he can add/remove teams and projects for that organization. A default organization will be created for every user.
27 28 29 |
# File 'lib/confy/client.rb', line 27 def orgs() Confy::Api::Orgs.new(@http_client) end |
#projects(org) ⇒ Object
An organization can contain any number of projects.
org - Name of the organization
49 50 51 |
# File 'lib/confy/client.rb', line 49 def projects(org) Confy::Api::Projects.new(org, @http_client) end |
#teams(org) ⇒ Object
Every organization will have a default team named __Owners__. Owner of the organization will be a default member for every team.
org - Name of the organization
34 35 36 |
# File 'lib/confy/client.rb', line 34 def teams(org) Confy::Api::Teams.new(org, @http_client) end |
#user ⇒ Object
User who is authenticated currently.
22 23 24 |
# File 'lib/confy/client.rb', line 22 def user() Confy::Api::User.new(@http_client) end |