triglav_client 0.1.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +79 -0
- data/LICENSE +201 -0
- data/README.md +136 -0
- data/Rakefile +1 -0
- data/docs/AggregatedResourceEachResponse.md +11 -0
- data/docs/AuthApi.md +150 -0
- data/docs/BulkinsertResponse.md +8 -0
- data/docs/Credential.md +10 -0
- data/docs/ErrorModel.md +9 -0
- data/docs/JobEachResponse.md +12 -0
- data/docs/JobMessageEachResponse.md +11 -0
- data/docs/JobMessagesApi.md +117 -0
- data/docs/JobRequest.md +12 -0
- data/docs/JobResponse.md +14 -0
- data/docs/JobsApi.md +217 -0
- data/docs/LastJobMessageIdResponse.md +8 -0
- data/docs/LastMessageIdResponse.md +8 -0
- data/docs/MessageEachResponse.md +16 -0
- data/docs/MessageFetchRequest.md +10 -0
- data/docs/MessageRequest.md +13 -0
- data/docs/MessageResponse.md +16 -0
- data/docs/MessagesApi.md +170 -0
- data/docs/ResourceEachResponse.md +13 -0
- data/docs/ResourceRequest.md +15 -0
- data/docs/ResourceResponse.md +17 -0
- data/docs/ResourcesApi.md +335 -0
- data/docs/TokenResponse.md +9 -0
- data/docs/UserEachResponse.md +11 -0
- data/docs/UserRequest.md +13 -0
- data/docs/UserResponse.md +15 -0
- data/docs/UsersApi.md +274 -0
- data/example/example.rb +40 -0
- data/git_push.sh +67 -0
- data/lib/triglav_client.rb +77 -0
- data/lib/triglav_client/api/auth_api.rb +196 -0
- data/lib/triglav_client/api/job_messages_api.rb +153 -0
- data/lib/triglav_client/api/jobs_api.rb +257 -0
- data/lib/triglav_client/api/messages_api.rb +208 -0
- data/lib/triglav_client/api/resources_api.rb +379 -0
- data/lib/triglav_client/api/users_api.rb +318 -0
- data/lib/triglav_client/api_client.rb +379 -0
- data/lib/triglav_client/api_error.rb +47 -0
- data/lib/triglav_client/configuration.rb +214 -0
- data/lib/triglav_client/models/aggregated_resource_each_response.rb +230 -0
- data/lib/triglav_client/models/bulkinsert_response.rb +200 -0
- data/lib/triglav_client/models/credential.rb +252 -0
- data/lib/triglav_client/models/error_model.rb +212 -0
- data/lib/triglav_client/models/job_each_response.rb +235 -0
- data/lib/triglav_client/models/job_message_each_response.rb +229 -0
- data/lib/triglav_client/models/job_request.rb +241 -0
- data/lib/triglav_client/models/job_response.rb +259 -0
- data/lib/triglav_client/models/last_job_message_id_response.rb +200 -0
- data/lib/triglav_client/models/last_message_id_response.rb +200 -0
- data/lib/triglav_client/models/message_each_response.rb +281 -0
- data/lib/triglav_client/models/message_fetch_request.rb +223 -0
- data/lib/triglav_client/models/message_request.rb +254 -0
- data/lib/triglav_client/models/message_response.rb +281 -0
- data/lib/triglav_client/models/resource_each_response.rb +250 -0
- data/lib/triglav_client/models/resource_request.rb +269 -0
- data/lib/triglav_client/models/resource_response.rb +287 -0
- data/lib/triglav_client/models/token_response.rb +208 -0
- data/lib/triglav_client/models/user_each_response.rb +262 -0
- data/lib/triglav_client/models/user_request.rb +280 -0
- data/lib/triglav_client/models/user_response.rb +300 -0
- data/lib/triglav_client/version.rb +26 -0
- data/spec/api/auth_api_spec.rb +80 -0
- data/spec/api/job_messages_api_spec.rb +71 -0
- data/spec/api/jobs_api_spec.rb +93 -0
- data/spec/api/messages_api_spec.rb +74 -0
- data/spec/api/resources_api_spec.rb +109 -0
- data/spec/api/users_api_spec.rb +106 -0
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +53 -0
- data/spec/models/aggregated_resource_each_response_spec.rb +71 -0
- data/spec/models/bulkinsert_response_spec.rb +53 -0
- data/spec/models/credential_spec.rb +69 -0
- data/spec/models/error_model_spec.rb +59 -0
- data/spec/models/job_each_response_spec.rb +77 -0
- data/spec/models/job_message_each_response_spec.rb +65 -0
- data/spec/models/job_request_spec.rb +71 -0
- data/spec/models/job_response_spec.rb +89 -0
- data/spec/models/last_job_message_id_response_spec.rb +53 -0
- data/spec/models/last_message_id_response_spec.rb +53 -0
- data/spec/models/message_each_response_spec.rb +89 -0
- data/spec/models/message_fetch_request_spec.rb +65 -0
- data/spec/models/message_request_spec.rb +59 -0
- data/spec/models/message_response_spec.rb +89 -0
- data/spec/models/resource_each_response_spec.rb +71 -0
- data/spec/models/resource_request_spec.rb +83 -0
- data/spec/models/resource_response_spec.rb +101 -0
- data/spec/models/token_response_spec.rb +59 -0
- data/spec/models/user_each_response_spec.rb +75 -0
- data/spec/models/user_request_spec.rb +87 -0
- data/spec/models/user_response_spec.rb +99 -0
- data/spec/spec_helper.rb +122 -0
- data/triglav_client.gemspec +55 -0
- metadata +351 -0
@@ -0,0 +1,208 @@
|
|
1
|
+
=begin
|
2
|
+
#Triglav API
|
3
|
+
|
4
|
+
#Triglav API
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
Contact: triglav_admin_my@dena.jp
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require "uri"
|
25
|
+
|
26
|
+
module TriglavClient
|
27
|
+
class MessagesApi
|
28
|
+
attr_accessor :api_client
|
29
|
+
|
30
|
+
def initialize(api_client = ApiClient.default)
|
31
|
+
@api_client = api_client
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# Fetch messages
|
36
|
+
# @param offset Offset (Greater than or equal to) ID for Messages to list from
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [Integer] :limit Number of limits
|
39
|
+
# @option opts [String] :resource_uris URIs of Resource
|
40
|
+
# @return [Array<MessageEachResponse>]
|
41
|
+
def fetch_messages(offset, opts = {})
|
42
|
+
data, _status_code, _headers = fetch_messages_with_http_info(offset, opts)
|
43
|
+
return data
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Fetch messages
|
48
|
+
# @param offset Offset (Greater than or equal to) ID for Messages to list from
|
49
|
+
# @param [Hash] opts the optional parameters
|
50
|
+
# @option opts [Integer] :limit Number of limits
|
51
|
+
# @option opts [String] :resource_uris URIs of Resource
|
52
|
+
# @return [Array<(Array<MessageEachResponse>, Fixnum, Hash)>] Array<MessageEachResponse> data, response status code and response headers
|
53
|
+
def fetch_messages_with_http_info(offset, opts = {})
|
54
|
+
if @api_client.config.debugging
|
55
|
+
@api_client.config.logger.debug "Calling API: MessagesApi.fetch_messages ..."
|
56
|
+
end
|
57
|
+
# verify the required parameter 'offset' is set
|
58
|
+
fail ArgumentError, "Missing the required parameter 'offset' when calling MessagesApi.fetch_messages" if offset.nil?
|
59
|
+
# resource path
|
60
|
+
local_var_path = "/messages".sub('{format}','json')
|
61
|
+
|
62
|
+
# query parameters
|
63
|
+
query_params = {}
|
64
|
+
query_params[:'offset'] = offset
|
65
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
66
|
+
query_params[:'resource_uris'] = opts[:'resource_uris'] if !opts[:'resource_uris'].nil?
|
67
|
+
|
68
|
+
# header parameters
|
69
|
+
header_params = {}
|
70
|
+
|
71
|
+
# HTTP header 'Accept' (if needed)
|
72
|
+
local_header_accept = ['application/json']
|
73
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
74
|
+
|
75
|
+
# HTTP header 'Content-Type'
|
76
|
+
local_header_content_type = ['application/json']
|
77
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
78
|
+
|
79
|
+
# form parameters
|
80
|
+
form_params = {}
|
81
|
+
|
82
|
+
# http body (model)
|
83
|
+
post_body = nil
|
84
|
+
auth_names = ['api_key']
|
85
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
86
|
+
:header_params => header_params,
|
87
|
+
:query_params => query_params,
|
88
|
+
:form_params => form_params,
|
89
|
+
:body => post_body,
|
90
|
+
:auth_names => auth_names,
|
91
|
+
:return_type => 'Array<MessageEachResponse>')
|
92
|
+
if @api_client.config.debugging
|
93
|
+
@api_client.config.logger.debug "API called: MessagesApi#fetch_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
94
|
+
end
|
95
|
+
return data, status_code, headers
|
96
|
+
end
|
97
|
+
|
98
|
+
#
|
99
|
+
# Get the current last message id which would be used as a first offset to fetch messages
|
100
|
+
# @param [Hash] opts the optional parameters
|
101
|
+
# @return [LastMessageIdResponse]
|
102
|
+
def get_last_message_id(opts = {})
|
103
|
+
data, _status_code, _headers = get_last_message_id_with_http_info(opts)
|
104
|
+
return data
|
105
|
+
end
|
106
|
+
|
107
|
+
#
|
108
|
+
# Get the current last message id which would be used as a first offset to fetch messages
|
109
|
+
# @param [Hash] opts the optional parameters
|
110
|
+
# @return [Array<(LastMessageIdResponse, Fixnum, Hash)>] LastMessageIdResponse data, response status code and response headers
|
111
|
+
def get_last_message_id_with_http_info(opts = {})
|
112
|
+
if @api_client.config.debugging
|
113
|
+
@api_client.config.logger.debug "Calling API: MessagesApi.get_last_message_id ..."
|
114
|
+
end
|
115
|
+
# resource path
|
116
|
+
local_var_path = "/messages/last_id".sub('{format}','json')
|
117
|
+
|
118
|
+
# query parameters
|
119
|
+
query_params = {}
|
120
|
+
|
121
|
+
# header parameters
|
122
|
+
header_params = {}
|
123
|
+
|
124
|
+
# HTTP header 'Accept' (if needed)
|
125
|
+
local_header_accept = ['application/json']
|
126
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
127
|
+
|
128
|
+
# HTTP header 'Content-Type'
|
129
|
+
local_header_content_type = ['application/json']
|
130
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
131
|
+
|
132
|
+
# form parameters
|
133
|
+
form_params = {}
|
134
|
+
|
135
|
+
# http body (model)
|
136
|
+
post_body = nil
|
137
|
+
auth_names = ['api_key']
|
138
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
139
|
+
:header_params => header_params,
|
140
|
+
:query_params => query_params,
|
141
|
+
:form_params => form_params,
|
142
|
+
:body => post_body,
|
143
|
+
:auth_names => auth_names,
|
144
|
+
:return_type => 'LastMessageIdResponse')
|
145
|
+
if @api_client.config.debugging
|
146
|
+
@api_client.config.logger.debug "API called: MessagesApi#get_last_message_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
147
|
+
end
|
148
|
+
return data, status_code, headers
|
149
|
+
end
|
150
|
+
|
151
|
+
#
|
152
|
+
# Enqueues new messages
|
153
|
+
# @param messages Messages to enqueue
|
154
|
+
# @param [Hash] opts the optional parameters
|
155
|
+
# @return [BulkinsertResponse]
|
156
|
+
def send_messages(messages, opts = {})
|
157
|
+
data, _status_code, _headers = send_messages_with_http_info(messages, opts)
|
158
|
+
return data
|
159
|
+
end
|
160
|
+
|
161
|
+
#
|
162
|
+
# Enqueues new messages
|
163
|
+
# @param messages Messages to enqueue
|
164
|
+
# @param [Hash] opts the optional parameters
|
165
|
+
# @return [Array<(BulkinsertResponse, Fixnum, Hash)>] BulkinsertResponse data, response status code and response headers
|
166
|
+
def send_messages_with_http_info(messages, opts = {})
|
167
|
+
if @api_client.config.debugging
|
168
|
+
@api_client.config.logger.debug "Calling API: MessagesApi.send_messages ..."
|
169
|
+
end
|
170
|
+
# verify the required parameter 'messages' is set
|
171
|
+
fail ArgumentError, "Missing the required parameter 'messages' when calling MessagesApi.send_messages" if messages.nil?
|
172
|
+
# resource path
|
173
|
+
local_var_path = "/messages".sub('{format}','json')
|
174
|
+
|
175
|
+
# query parameters
|
176
|
+
query_params = {}
|
177
|
+
|
178
|
+
# header parameters
|
179
|
+
header_params = {}
|
180
|
+
|
181
|
+
# HTTP header 'Accept' (if needed)
|
182
|
+
local_header_accept = ['application/json']
|
183
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
184
|
+
|
185
|
+
# HTTP header 'Content-Type'
|
186
|
+
local_header_content_type = ['application/json']
|
187
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
188
|
+
|
189
|
+
# form parameters
|
190
|
+
form_params = {}
|
191
|
+
|
192
|
+
# http body (model)
|
193
|
+
post_body = @api_client.object_to_http_body(messages)
|
194
|
+
auth_names = ['api_key']
|
195
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
196
|
+
:header_params => header_params,
|
197
|
+
:query_params => query_params,
|
198
|
+
:form_params => form_params,
|
199
|
+
:body => post_body,
|
200
|
+
:auth_names => auth_names,
|
201
|
+
:return_type => 'BulkinsertResponse')
|
202
|
+
if @api_client.config.debugging
|
203
|
+
@api_client.config.logger.debug "API called: MessagesApi#send_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
204
|
+
end
|
205
|
+
return data, status_code, headers
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
@@ -0,0 +1,379 @@
|
|
1
|
+
=begin
|
2
|
+
#Triglav API
|
3
|
+
|
4
|
+
#Triglav API
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
Contact: triglav_admin_my@dena.jp
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require "uri"
|
25
|
+
|
26
|
+
module TriglavClient
|
27
|
+
class ResourcesApi
|
28
|
+
attr_accessor :api_client
|
29
|
+
|
30
|
+
def initialize(api_client = ApiClient.default)
|
31
|
+
@api_client = api_client
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# Creates a new resource
|
36
|
+
# @param resource Resource to add
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [ResourceResponse]
|
39
|
+
def create_resource(resource, opts = {})
|
40
|
+
data, _status_code, _headers = create_resource_with_http_info(resource, opts)
|
41
|
+
return data
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Creates a new resource
|
46
|
+
# @param resource Resource to add
|
47
|
+
# @param [Hash] opts the optional parameters
|
48
|
+
# @return [Array<(ResourceResponse, Fixnum, Hash)>] ResourceResponse data, response status code and response headers
|
49
|
+
def create_resource_with_http_info(resource, opts = {})
|
50
|
+
if @api_client.config.debugging
|
51
|
+
@api_client.config.logger.debug "Calling API: ResourcesApi.create_resource ..."
|
52
|
+
end
|
53
|
+
# verify the required parameter 'resource' is set
|
54
|
+
fail ArgumentError, "Missing the required parameter 'resource' when calling ResourcesApi.create_resource" if resource.nil?
|
55
|
+
# resource path
|
56
|
+
local_var_path = "/resources".sub('{format}','json')
|
57
|
+
|
58
|
+
# query parameters
|
59
|
+
query_params = {}
|
60
|
+
|
61
|
+
# header parameters
|
62
|
+
header_params = {}
|
63
|
+
|
64
|
+
# HTTP header 'Accept' (if needed)
|
65
|
+
local_header_accept = ['application/json']
|
66
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
67
|
+
|
68
|
+
# HTTP header 'Content-Type'
|
69
|
+
local_header_content_type = ['application/json']
|
70
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
71
|
+
|
72
|
+
# form parameters
|
73
|
+
form_params = {}
|
74
|
+
|
75
|
+
# http body (model)
|
76
|
+
post_body = @api_client.object_to_http_body(resource)
|
77
|
+
auth_names = ['api_key']
|
78
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
79
|
+
:header_params => header_params,
|
80
|
+
:query_params => query_params,
|
81
|
+
:form_params => form_params,
|
82
|
+
:body => post_body,
|
83
|
+
:auth_names => auth_names,
|
84
|
+
:return_type => 'ResourceResponse')
|
85
|
+
if @api_client.config.debugging
|
86
|
+
@api_client.config.logger.debug "API called: ResourcesApi#create_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
87
|
+
end
|
88
|
+
return data, status_code, headers
|
89
|
+
end
|
90
|
+
|
91
|
+
#
|
92
|
+
# Deletes single resource
|
93
|
+
# @param id_or_uri ID or URI of resource to fetch
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [nil]
|
96
|
+
def delete_resource(id_or_uri, opts = {})
|
97
|
+
delete_resource_with_http_info(id_or_uri, opts)
|
98
|
+
return nil
|
99
|
+
end
|
100
|
+
|
101
|
+
#
|
102
|
+
# Deletes single resource
|
103
|
+
# @param id_or_uri ID or URI of resource to fetch
|
104
|
+
# @param [Hash] opts the optional parameters
|
105
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
106
|
+
def delete_resource_with_http_info(id_or_uri, opts = {})
|
107
|
+
if @api_client.config.debugging
|
108
|
+
@api_client.config.logger.debug "Calling API: ResourcesApi.delete_resource ..."
|
109
|
+
end
|
110
|
+
# verify the required parameter 'id_or_uri' is set
|
111
|
+
fail ArgumentError, "Missing the required parameter 'id_or_uri' when calling ResourcesApi.delete_resource" if id_or_uri.nil?
|
112
|
+
# resource path
|
113
|
+
local_var_path = "/resources/{id_or_uri}".sub('{format}','json').sub('{' + 'id_or_uri' + '}', id_or_uri.to_s)
|
114
|
+
|
115
|
+
# query parameters
|
116
|
+
query_params = {}
|
117
|
+
|
118
|
+
# header parameters
|
119
|
+
header_params = {}
|
120
|
+
|
121
|
+
# HTTP header 'Accept' (if needed)
|
122
|
+
local_header_accept = ['application/json']
|
123
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
124
|
+
|
125
|
+
# HTTP header 'Content-Type'
|
126
|
+
local_header_content_type = ['application/json']
|
127
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
128
|
+
|
129
|
+
# form parameters
|
130
|
+
form_params = {}
|
131
|
+
|
132
|
+
# http body (model)
|
133
|
+
post_body = nil
|
134
|
+
auth_names = ['api_key']
|
135
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
136
|
+
:header_params => header_params,
|
137
|
+
:query_params => query_params,
|
138
|
+
:form_params => form_params,
|
139
|
+
:body => post_body,
|
140
|
+
:auth_names => auth_names)
|
141
|
+
if @api_client.config.debugging
|
142
|
+
@api_client.config.logger.debug "API called: ResourcesApi#delete_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
143
|
+
end
|
144
|
+
return data, status_code, headers
|
145
|
+
end
|
146
|
+
|
147
|
+
#
|
148
|
+
# Returns a single resource
|
149
|
+
# @param id_or_uri ID or URI of resource to fetch
|
150
|
+
# @param [Hash] opts the optional parameters
|
151
|
+
# @return [ResourceResponse]
|
152
|
+
def get_resource(id_or_uri, opts = {})
|
153
|
+
data, _status_code, _headers = get_resource_with_http_info(id_or_uri, opts)
|
154
|
+
return data
|
155
|
+
end
|
156
|
+
|
157
|
+
#
|
158
|
+
# Returns a single resource
|
159
|
+
# @param id_or_uri ID or URI of resource to fetch
|
160
|
+
# @param [Hash] opts the optional parameters
|
161
|
+
# @return [Array<(ResourceResponse, Fixnum, Hash)>] ResourceResponse data, response status code and response headers
|
162
|
+
def get_resource_with_http_info(id_or_uri, opts = {})
|
163
|
+
if @api_client.config.debugging
|
164
|
+
@api_client.config.logger.debug "Calling API: ResourcesApi.get_resource ..."
|
165
|
+
end
|
166
|
+
# verify the required parameter 'id_or_uri' is set
|
167
|
+
fail ArgumentError, "Missing the required parameter 'id_or_uri' when calling ResourcesApi.get_resource" if id_or_uri.nil?
|
168
|
+
# resource path
|
169
|
+
local_var_path = "/resources/{id_or_uri}".sub('{format}','json').sub('{' + 'id_or_uri' + '}', id_or_uri.to_s)
|
170
|
+
|
171
|
+
# query parameters
|
172
|
+
query_params = {}
|
173
|
+
|
174
|
+
# header parameters
|
175
|
+
header_params = {}
|
176
|
+
|
177
|
+
# HTTP header 'Accept' (if needed)
|
178
|
+
local_header_accept = ['application/json']
|
179
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
180
|
+
|
181
|
+
# HTTP header 'Content-Type'
|
182
|
+
local_header_content_type = ['application/json']
|
183
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
184
|
+
|
185
|
+
# form parameters
|
186
|
+
form_params = {}
|
187
|
+
|
188
|
+
# http body (model)
|
189
|
+
post_body = nil
|
190
|
+
auth_names = ['api_key']
|
191
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
192
|
+
:header_params => header_params,
|
193
|
+
:query_params => query_params,
|
194
|
+
:form_params => form_params,
|
195
|
+
:body => post_body,
|
196
|
+
:auth_names => auth_names,
|
197
|
+
:return_type => 'ResourceResponse')
|
198
|
+
if @api_client.config.debugging
|
199
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
200
|
+
end
|
201
|
+
return data, status_code, headers
|
202
|
+
end
|
203
|
+
|
204
|
+
#
|
205
|
+
# Returns aggregated resources to be monitored
|
206
|
+
# @param uri_prefix Prefix of Resource URI
|
207
|
+
# @param [Hash] opts the optional parameters
|
208
|
+
# @return [Array<AggregatedResourceEachResponse>]
|
209
|
+
def list_aggregated_resources(uri_prefix, opts = {})
|
210
|
+
data, _status_code, _headers = list_aggregated_resources_with_http_info(uri_prefix, opts)
|
211
|
+
return data
|
212
|
+
end
|
213
|
+
|
214
|
+
#
|
215
|
+
# Returns aggregated resources to be monitored
|
216
|
+
# @param uri_prefix Prefix of Resource URI
|
217
|
+
# @param [Hash] opts the optional parameters
|
218
|
+
# @return [Array<(Array<AggregatedResourceEachResponse>, Fixnum, Hash)>] Array<AggregatedResourceEachResponse> data, response status code and response headers
|
219
|
+
def list_aggregated_resources_with_http_info(uri_prefix, opts = {})
|
220
|
+
if @api_client.config.debugging
|
221
|
+
@api_client.config.logger.debug "Calling API: ResourcesApi.list_aggregated_resources ..."
|
222
|
+
end
|
223
|
+
# verify the required parameter 'uri_prefix' is set
|
224
|
+
fail ArgumentError, "Missing the required parameter 'uri_prefix' when calling ResourcesApi.list_aggregated_resources" if uri_prefix.nil?
|
225
|
+
# resource path
|
226
|
+
local_var_path = "/aggregated_resources".sub('{format}','json')
|
227
|
+
|
228
|
+
# query parameters
|
229
|
+
query_params = {}
|
230
|
+
query_params[:'uri_prefix'] = uri_prefix
|
231
|
+
|
232
|
+
# header parameters
|
233
|
+
header_params = {}
|
234
|
+
|
235
|
+
# HTTP header 'Accept' (if needed)
|
236
|
+
local_header_accept = ['application/json']
|
237
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
238
|
+
|
239
|
+
# HTTP header 'Content-Type'
|
240
|
+
local_header_content_type = ['application/json']
|
241
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
242
|
+
|
243
|
+
# form parameters
|
244
|
+
form_params = {}
|
245
|
+
|
246
|
+
# http body (model)
|
247
|
+
post_body = nil
|
248
|
+
auth_names = ['api_key']
|
249
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
250
|
+
:header_params => header_params,
|
251
|
+
:query_params => query_params,
|
252
|
+
:form_params => form_params,
|
253
|
+
:body => post_body,
|
254
|
+
:auth_names => auth_names,
|
255
|
+
:return_type => 'Array<AggregatedResourceEachResponse>')
|
256
|
+
if @api_client.config.debugging
|
257
|
+
@api_client.config.logger.debug "API called: ResourcesApi#list_aggregated_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
258
|
+
end
|
259
|
+
return data, status_code, headers
|
260
|
+
end
|
261
|
+
|
262
|
+
#
|
263
|
+
# Returns all resources
|
264
|
+
# @param [Hash] opts the optional parameters
|
265
|
+
# @option opts [String] :uri_prefix Prefix of Resource URI
|
266
|
+
# @return [Array<ResourceEachResponse>]
|
267
|
+
def list_resources(opts = {})
|
268
|
+
data, _status_code, _headers = list_resources_with_http_info(opts)
|
269
|
+
return data
|
270
|
+
end
|
271
|
+
|
272
|
+
#
|
273
|
+
# Returns all resources
|
274
|
+
# @param [Hash] opts the optional parameters
|
275
|
+
# @option opts [String] :uri_prefix Prefix of Resource URI
|
276
|
+
# @return [Array<(Array<ResourceEachResponse>, Fixnum, Hash)>] Array<ResourceEachResponse> data, response status code and response headers
|
277
|
+
def list_resources_with_http_info(opts = {})
|
278
|
+
if @api_client.config.debugging
|
279
|
+
@api_client.config.logger.debug "Calling API: ResourcesApi.list_resources ..."
|
280
|
+
end
|
281
|
+
# resource path
|
282
|
+
local_var_path = "/resources".sub('{format}','json')
|
283
|
+
|
284
|
+
# query parameters
|
285
|
+
query_params = {}
|
286
|
+
query_params[:'uri_prefix'] = opts[:'uri_prefix'] if !opts[:'uri_prefix'].nil?
|
287
|
+
|
288
|
+
# header parameters
|
289
|
+
header_params = {}
|
290
|
+
|
291
|
+
# HTTP header 'Accept' (if needed)
|
292
|
+
local_header_accept = ['application/json']
|
293
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
294
|
+
|
295
|
+
# HTTP header 'Content-Type'
|
296
|
+
local_header_content_type = ['application/json']
|
297
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
298
|
+
|
299
|
+
# form parameters
|
300
|
+
form_params = {}
|
301
|
+
|
302
|
+
# http body (model)
|
303
|
+
post_body = nil
|
304
|
+
auth_names = ['api_key']
|
305
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
306
|
+
:header_params => header_params,
|
307
|
+
:query_params => query_params,
|
308
|
+
:form_params => form_params,
|
309
|
+
:body => post_body,
|
310
|
+
:auth_names => auth_names,
|
311
|
+
:return_type => 'Array<ResourceEachResponse>')
|
312
|
+
if @api_client.config.debugging
|
313
|
+
@api_client.config.logger.debug "API called: ResourcesApi#list_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
314
|
+
end
|
315
|
+
return data, status_code, headers
|
316
|
+
end
|
317
|
+
|
318
|
+
#
|
319
|
+
# Updates a single resource
|
320
|
+
# @param id_or_uri ID or URI of resource to fetch
|
321
|
+
# @param resource Resource parameters to update
|
322
|
+
# @param [Hash] opts the optional parameters
|
323
|
+
# @return [ResourceResponse]
|
324
|
+
def update_resource(id_or_uri, resource, opts = {})
|
325
|
+
data, _status_code, _headers = update_resource_with_http_info(id_or_uri, resource, opts)
|
326
|
+
return data
|
327
|
+
end
|
328
|
+
|
329
|
+
#
|
330
|
+
# Updates a single resource
|
331
|
+
# @param id_or_uri ID or URI of resource to fetch
|
332
|
+
# @param resource Resource parameters to update
|
333
|
+
# @param [Hash] opts the optional parameters
|
334
|
+
# @return [Array<(ResourceResponse, Fixnum, Hash)>] ResourceResponse data, response status code and response headers
|
335
|
+
def update_resource_with_http_info(id_or_uri, resource, opts = {})
|
336
|
+
if @api_client.config.debugging
|
337
|
+
@api_client.config.logger.debug "Calling API: ResourcesApi.update_resource ..."
|
338
|
+
end
|
339
|
+
# verify the required parameter 'id_or_uri' is set
|
340
|
+
fail ArgumentError, "Missing the required parameter 'id_or_uri' when calling ResourcesApi.update_resource" if id_or_uri.nil?
|
341
|
+
# verify the required parameter 'resource' is set
|
342
|
+
fail ArgumentError, "Missing the required parameter 'resource' when calling ResourcesApi.update_resource" if resource.nil?
|
343
|
+
# resource path
|
344
|
+
local_var_path = "/resources/{id_or_uri}".sub('{format}','json').sub('{' + 'id_or_uri' + '}', id_or_uri.to_s)
|
345
|
+
|
346
|
+
# query parameters
|
347
|
+
query_params = {}
|
348
|
+
|
349
|
+
# header parameters
|
350
|
+
header_params = {}
|
351
|
+
|
352
|
+
# HTTP header 'Accept' (if needed)
|
353
|
+
local_header_accept = ['application/json']
|
354
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
355
|
+
|
356
|
+
# HTTP header 'Content-Type'
|
357
|
+
local_header_content_type = ['application/json']
|
358
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
359
|
+
|
360
|
+
# form parameters
|
361
|
+
form_params = {}
|
362
|
+
|
363
|
+
# http body (model)
|
364
|
+
post_body = @api_client.object_to_http_body(resource)
|
365
|
+
auth_names = ['api_key']
|
366
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
367
|
+
:header_params => header_params,
|
368
|
+
:query_params => query_params,
|
369
|
+
:form_params => form_params,
|
370
|
+
:body => post_body,
|
371
|
+
:auth_names => auth_names,
|
372
|
+
:return_type => 'ResourceResponse')
|
373
|
+
if @api_client.config.debugging
|
374
|
+
@api_client.config.logger.debug "API called: ResourcesApi#update_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
375
|
+
end
|
376
|
+
return data, status_code, headers
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|