semaphore_client 2.8.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/semaphore_client/api/config_file.rb +8 -8
- data/lib/semaphore_client/api/env_var.rb +8 -8
- data/lib/semaphore_client/api/project.rb +4 -4
- data/lib/semaphore_client/api/{shared_config.rb → secret.rb} +30 -30
- data/lib/semaphore_client/api/team.rb +4 -4
- data/lib/semaphore_client/model/org.rb +2 -2
- data/lib/semaphore_client/model/{shared_config.rb → secret.rb} +1 -1
- data/lib/semaphore_client/version.rb +1 -1
- data/lib/semaphore_client.rb +4 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 939bd6eae22cf45bbfda67acc6f97450d44fe53c
|
4
|
+
data.tar.gz: 335b0171a3bb19ed52a447eab89a3c0546845372
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63324bd9d4efa49e1d17550095716303dfba0b008ffebf369a3429baaace9d364ef9b92279331143ffc3b891de37040710c59bf09cd61026553ddeda96c4e92c
|
7
|
+
data.tar.gz: 65c9b158248c80402465319f2d9e205e56225920e48ae0f36583ddd841d7da9f9c6c51d0490bf6080aab61d59589a454ed27101d0f7df74440d06de69dd1a46b
|
data/Gemfile.lock
CHANGED
@@ -45,26 +45,26 @@ class SemaphoreClient
|
|
45
45
|
|
46
46
|
|
47
47
|
|
48
|
-
def
|
49
|
-
|
48
|
+
def list_for_secret(secret_id, params = nil, options = {})
|
49
|
+
list_for_secret!(secret_id, params, options)
|
50
50
|
rescue SemaphoreClient::Exceptions::ResponseError
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
path = "/
|
53
|
+
def list_for_secret!(secret_id, params = nil, options = {})
|
54
|
+
path = "/secrets/#{secret_id}/config_files"
|
55
55
|
|
56
56
|
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::ConfigFile.load(e) }
|
57
57
|
end
|
58
58
|
|
59
59
|
|
60
60
|
|
61
|
-
def
|
62
|
-
|
61
|
+
def create_for_secret(secret_id, params = nil, options = {})
|
62
|
+
create_for_secret!(secret_id, params, options)
|
63
63
|
rescue SemaphoreClient::Exceptions::ResponseError
|
64
64
|
end
|
65
65
|
|
66
|
-
def
|
67
|
-
path = "/
|
66
|
+
def create_for_secret!(secret_id, params = nil, options = {})
|
67
|
+
path = "/secrets/#{secret_id}/config_files"
|
68
68
|
response = @http_client.post(path, params, options)
|
69
69
|
|
70
70
|
SemaphoreClient::Model::ConfigFile.load(response.body)
|
@@ -45,26 +45,26 @@ class SemaphoreClient
|
|
45
45
|
|
46
46
|
|
47
47
|
|
48
|
-
def
|
49
|
-
|
48
|
+
def list_for_secret(secret_id, params = nil, options = {})
|
49
|
+
list_for_secret!(secret_id, params, options)
|
50
50
|
rescue SemaphoreClient::Exceptions::ResponseError
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
path = "/
|
53
|
+
def list_for_secret!(secret_id, params = nil, options = {})
|
54
|
+
path = "/secrets/#{secret_id}/env_vars"
|
55
55
|
|
56
56
|
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::EnvVar.load(e) }
|
57
57
|
end
|
58
58
|
|
59
59
|
|
60
60
|
|
61
|
-
def
|
62
|
-
|
61
|
+
def create_for_secret(secret_id, params = nil, options = {})
|
62
|
+
create_for_secret!(secret_id, params, options)
|
63
63
|
rescue SemaphoreClient::Exceptions::ResponseError
|
64
64
|
end
|
65
65
|
|
66
|
-
def
|
67
|
-
path = "/
|
66
|
+
def create_for_secret!(secret_id, params = nil, options = {})
|
67
|
+
path = "/secrets/#{secret_id}/env_vars"
|
68
68
|
response = @http_client.post(path, params, options)
|
69
69
|
|
70
70
|
SemaphoreClient::Model::EnvVar.load(response.body)
|
@@ -72,13 +72,13 @@ class SemaphoreClient
|
|
72
72
|
|
73
73
|
|
74
74
|
|
75
|
-
def
|
76
|
-
|
75
|
+
def list_for_secret(secret_id, params = nil, options = {})
|
76
|
+
list_for_secret!(secret_id, params, options)
|
77
77
|
rescue SemaphoreClient::Exceptions::ResponseError
|
78
78
|
end
|
79
79
|
|
80
|
-
def
|
81
|
-
path = "/
|
80
|
+
def list_for_secret!(secret_id, params = nil, options = {})
|
81
|
+
path = "/secrets/#{secret_id}/projects"
|
82
82
|
|
83
83
|
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::Project.load(e) }
|
84
84
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class SemaphoreClient
|
2
2
|
module Api
|
3
|
-
class
|
3
|
+
class Secret
|
4
4
|
def initialize(http_client)
|
5
5
|
@http_client = http_client
|
6
6
|
end
|
@@ -12,9 +12,9 @@ class SemaphoreClient
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def list_for_org!(org_id, params = nil, options = {})
|
15
|
-
path = "/orgs/#{org_id}/
|
15
|
+
path = "/orgs/#{org_id}/secrets"
|
16
16
|
|
17
|
-
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::
|
17
|
+
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::Secret.load(e) }
|
18
18
|
end
|
19
19
|
|
20
20
|
|
@@ -25,10 +25,10 @@ class SemaphoreClient
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def create_for_org!(org_id, params = nil, options = {})
|
28
|
-
path = "/orgs/#{org_id}/
|
28
|
+
path = "/orgs/#{org_id}/secrets"
|
29
29
|
response = @http_client.post(path, params, options)
|
30
30
|
|
31
|
-
SemaphoreClient::Model::
|
31
|
+
SemaphoreClient::Model::Secret.load(response.body)
|
32
32
|
end
|
33
33
|
|
34
34
|
|
@@ -39,33 +39,33 @@ class SemaphoreClient
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def list_for_team!(team_id, params = nil, options = {})
|
42
|
-
path = "/teams/#{team_id}/
|
42
|
+
path = "/teams/#{team_id}/secrets"
|
43
43
|
|
44
|
-
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::
|
44
|
+
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::Secret.load(e) }
|
45
45
|
end
|
46
46
|
|
47
47
|
|
48
48
|
|
49
|
-
def attach_to_team(
|
50
|
-
attach_to_team!(
|
49
|
+
def attach_to_team(secret_id, team_id, params = nil, options = {})
|
50
|
+
attach_to_team!(secret_id, team_id, params, options)
|
51
51
|
rescue SemaphoreClient::Exceptions::ResponseError
|
52
52
|
end
|
53
53
|
|
54
|
-
def attach_to_team!(
|
55
|
-
path = "/teams/#{team_id}/
|
54
|
+
def attach_to_team!(secret_id, team_id, params = nil, options = {})
|
55
|
+
path = "/teams/#{team_id}/secrets/#{secret_id}"
|
56
56
|
|
57
57
|
@http_client.post(path, params, options)
|
58
58
|
end
|
59
59
|
|
60
60
|
|
61
61
|
|
62
|
-
def detach_from_team(
|
63
|
-
detach_from_team!(
|
62
|
+
def detach_from_team(secret_id, team_id, params = nil, options = {})
|
63
|
+
detach_from_team!(secret_id, team_id, params, options)
|
64
64
|
rescue SemaphoreClient::Exceptions::ResponseError
|
65
65
|
end
|
66
66
|
|
67
|
-
def detach_from_team!(
|
68
|
-
path = "/teams/#{team_id}/
|
67
|
+
def detach_from_team!(secret_id, team_id, params = nil, options = {})
|
68
|
+
path = "/teams/#{team_id}/secrets/#{secret_id}"
|
69
69
|
|
70
70
|
@http_client.delete(path, params, options)
|
71
71
|
end
|
@@ -78,33 +78,33 @@ class SemaphoreClient
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def list_for_project!(project_id, params = nil, options = {})
|
81
|
-
path = "/projects/#{project_id}/
|
81
|
+
path = "/projects/#{project_id}/secrets"
|
82
82
|
|
83
|
-
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::
|
83
|
+
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::Secret.load(e) }
|
84
84
|
end
|
85
85
|
|
86
86
|
|
87
87
|
|
88
|
-
def attach_to_project(
|
89
|
-
attach_to_project!(
|
88
|
+
def attach_to_project(secret_id, project_id, params = nil, options = {})
|
89
|
+
attach_to_project!(secret_id, project_id, params, options)
|
90
90
|
rescue SemaphoreClient::Exceptions::ResponseError
|
91
91
|
end
|
92
92
|
|
93
|
-
def attach_to_project!(
|
94
|
-
path = "/projects/#{project_id}/
|
93
|
+
def attach_to_project!(secret_id, project_id, params = nil, options = {})
|
94
|
+
path = "/projects/#{project_id}/secrets/#{secret_id}"
|
95
95
|
|
96
96
|
@http_client.post(path, params, options)
|
97
97
|
end
|
98
98
|
|
99
99
|
|
100
100
|
|
101
|
-
def detach_from_project(
|
102
|
-
detach_from_project!(
|
101
|
+
def detach_from_project(secret_id, project_id, params = nil, options = {})
|
102
|
+
detach_from_project!(secret_id, project_id, params, options)
|
103
103
|
rescue SemaphoreClient::Exceptions::ResponseError
|
104
104
|
end
|
105
105
|
|
106
|
-
def detach_from_project!(
|
107
|
-
path = "/projects/#{project_id}/
|
106
|
+
def detach_from_project!(secret_id, project_id, params = nil, options = {})
|
107
|
+
path = "/projects/#{project_id}/secrets/#{secret_id}"
|
108
108
|
|
109
109
|
@http_client.delete(path, params, options)
|
110
110
|
end
|
@@ -117,10 +117,10 @@ class SemaphoreClient
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def get!(id, params = nil, options = {})
|
120
|
-
path = "/
|
120
|
+
path = "/secrets/#{id}"
|
121
121
|
response = @http_client.get(path, params = {})
|
122
122
|
|
123
|
-
SemaphoreClient::Model::
|
123
|
+
SemaphoreClient::Model::Secret.load(response.body)
|
124
124
|
end
|
125
125
|
|
126
126
|
|
@@ -131,7 +131,7 @@ class SemaphoreClient
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def delete!(id, params = nil, options = {})
|
134
|
-
path = "/
|
134
|
+
path = "/secrets/#{id}"
|
135
135
|
|
136
136
|
@http_client.delete(path, params)
|
137
137
|
end
|
@@ -144,10 +144,10 @@ class SemaphoreClient
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def update!(id, params = nil, options = {})
|
147
|
-
path = "/
|
147
|
+
path = "/secrets/#{id}"
|
148
148
|
response = @http_client.patch(path, params)
|
149
149
|
|
150
|
-
SemaphoreClient::Model::
|
150
|
+
SemaphoreClient::Model::Secret.load(response.body)
|
151
151
|
end
|
152
152
|
|
153
153
|
|
@@ -87,13 +87,13 @@ class SemaphoreClient
|
|
87
87
|
|
88
88
|
|
89
89
|
|
90
|
-
def
|
91
|
-
|
90
|
+
def list_for_secret(secret_id, params = nil, options = {})
|
91
|
+
list_for_secret!(secret_id, params, options)
|
92
92
|
rescue SemaphoreClient::Exceptions::ResponseError
|
93
93
|
end
|
94
94
|
|
95
|
-
def
|
96
|
-
path = "/
|
95
|
+
def list_for_secret!(secret_id, params = nil, options = {})
|
96
|
+
path = "/secrets/#{secret_id}/teams"
|
97
97
|
|
98
98
|
@http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::Team.load(e) }
|
99
99
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class SemaphoreClient
|
2
2
|
module Model
|
3
3
|
class Org
|
4
|
-
attr_reader :projects_url, :teams_url, :name, :username, :updated_at, :id, :url, :
|
4
|
+
attr_reader :projects_url, :teams_url, :name, :secrets_url, :username, :updated_at, :id, :url, :users_url, :created_at
|
5
5
|
|
6
6
|
def self.load(attributes)
|
7
7
|
new.load(attributes)
|
@@ -17,11 +17,11 @@ class SemaphoreClient
|
|
17
17
|
@projects_url = attributes[:projects_url] if attributes.key?(:projects_url)
|
18
18
|
@teams_url = attributes[:teams_url] if attributes.key?(:teams_url)
|
19
19
|
@name = attributes[:name] if attributes.key?(:name)
|
20
|
+
@secrets_url = attributes[:secrets_url] if attributes.key?(:secrets_url)
|
20
21
|
@username = attributes[:username] if attributes.key?(:username)
|
21
22
|
@updated_at = attributes[:updated_at] if attributes.key?(:updated_at)
|
22
23
|
@id = attributes[:id] if attributes.key?(:id)
|
23
24
|
@url = attributes[:url] if attributes.key?(:url)
|
24
|
-
@shared_configs_url = attributes[:shared_configs_url] if attributes.key?(:shared_configs_url)
|
25
25
|
@users_url = attributes[:users_url] if attributes.key?(:users_url)
|
26
26
|
@created_at = attributes[:created_at] if attributes.key?(:created_at)
|
27
27
|
|
data/lib/semaphore_client.rb
CHANGED
@@ -11,14 +11,14 @@ require "semaphore_client/model/user"
|
|
11
11
|
require "semaphore_client/model/org"
|
12
12
|
require "semaphore_client/model/team"
|
13
13
|
require "semaphore_client/model/project"
|
14
|
-
require "semaphore_client/model/
|
14
|
+
require "semaphore_client/model/secret"
|
15
15
|
require "semaphore_client/model/env_var"
|
16
16
|
require "semaphore_client/model/config_file"
|
17
17
|
require "semaphore_client/api/user"
|
18
18
|
require "semaphore_client/api/org"
|
19
19
|
require "semaphore_client/api/team"
|
20
20
|
require "semaphore_client/api/project"
|
21
|
-
require "semaphore_client/api/
|
21
|
+
require "semaphore_client/api/secret"
|
22
22
|
require "semaphore_client/api/env_var"
|
23
23
|
require "semaphore_client/api/config_file"
|
24
24
|
|
@@ -51,8 +51,8 @@ class SemaphoreClient
|
|
51
51
|
@project_api ||= SemaphoreClient::Api::Project.new(http_client)
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
55
|
-
@
|
54
|
+
def secrets
|
55
|
+
@secret_api ||= SemaphoreClient::Api::Secret.new(http_client)
|
56
56
|
end
|
57
57
|
|
58
58
|
def env_vars
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semaphore_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jovan Ivanović
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -116,7 +116,7 @@ files:
|
|
116
116
|
- lib/semaphore_client/api/env_var.rb
|
117
117
|
- lib/semaphore_client/api/org.rb
|
118
118
|
- lib/semaphore_client/api/project.rb
|
119
|
-
- lib/semaphore_client/api/
|
119
|
+
- lib/semaphore_client/api/secret.rb
|
120
120
|
- lib/semaphore_client/api/team.rb
|
121
121
|
- lib/semaphore_client/api/user.rb
|
122
122
|
- lib/semaphore_client/exceptions.rb
|
@@ -125,7 +125,7 @@ files:
|
|
125
125
|
- lib/semaphore_client/model/env_var.rb
|
126
126
|
- lib/semaphore_client/model/org.rb
|
127
127
|
- lib/semaphore_client/model/project.rb
|
128
|
-
- lib/semaphore_client/model/
|
128
|
+
- lib/semaphore_client/model/secret.rb
|
129
129
|
- lib/semaphore_client/model/team.rb
|
130
130
|
- lib/semaphore_client/model/user.rb
|
131
131
|
- lib/semaphore_client/version.rb
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.6.
|
154
|
+
rubygems_version: 2.6.14
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Client for Semaphore's API.
|