triglav_client 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,16 @@
|
|
1
|
+
# TriglavClient::MessageEachResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**uuid** | **String** | Universally Unique ID to be used to avoid duplicated messages | [optional]
|
7
|
+
**resource_uri** | **String** | URI of Resource |
|
8
|
+
**resource_unit** | **String** | Time unit of resource to monitor such as singular, daily, or hourly |
|
9
|
+
**resource_time** | **Integer** | Time of Resource in unix timestamp such as 1476025200 (2016-10-10 in +09:00) |
|
10
|
+
**resource_timezone** | **String** | Timezone of resource time, that is, timezone of %Y-%m-%d for hdfs://path/to/%Y-%m-%d such as +09:00 |
|
11
|
+
**payload** | **String** | Any json string | [optional]
|
12
|
+
**id** | **Integer** | | [optional]
|
13
|
+
**created_at** | **DateTime** | | [optional]
|
14
|
+
**updated_at** | **DateTime** | | [optional]
|
15
|
+
|
16
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# TriglavClient::MessageFetchRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**offset** | **Integer** | Offset (Greater than or equal to) ID for Messages to fetch from |
|
7
|
+
**limit** | **Integer** | Number of limits | [optional]
|
8
|
+
**resource_uris** | **Array<String>** | URIs of Resource | [optional]
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# TriglavClient::MessageRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**uuid** | **String** | Universally Unique ID to be used to avoid duplicated messages | [optional]
|
7
|
+
**resource_uri** | **String** | URI of Resource |
|
8
|
+
**resource_unit** | **String** | Time unit of resource to monitor such as singular, daily, or hourly |
|
9
|
+
**resource_time** | **Integer** | Time of Resource in unix timestamp such as 1476025200 (2016-10-10 in +09:00) |
|
10
|
+
**resource_timezone** | **String** | Timezone of resource time, that is, timezone of %Y-%m-%d for hdfs://path/to/%Y-%m-%d such as +09:00 |
|
11
|
+
**payload** | **String** | Any json string | [optional]
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# TriglavClient::MessageResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**uuid** | **String** | Universally Unique ID to be used to avoid duplicated messages | [optional]
|
7
|
+
**resource_uri** | **String** | URI of Resource |
|
8
|
+
**resource_unit** | **String** | Time unit of resource to monitor such as singular, daily, or hourly |
|
9
|
+
**resource_time** | **Integer** | Time of Resource in unix timestamp such as 1476025200 (2016-10-10 in +09:00) |
|
10
|
+
**resource_timezone** | **String** | Timezone of resource time, that is, timezone of %Y-%m-%d for hdfs://path/to/%Y-%m-%d such as +09:00 |
|
11
|
+
**payload** | **String** | Any json string | [optional]
|
12
|
+
**id** | **Integer** | | [optional]
|
13
|
+
**created_at** | **DateTime** | | [optional]
|
14
|
+
**updated_at** | **DateTime** | | [optional]
|
15
|
+
|
16
|
+
|
data/docs/MessagesApi.md
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
# TriglavClient::MessagesApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost/api/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**fetch_messages**](MessagesApi.md#fetch_messages) | **GET** /messages |
|
8
|
+
[**get_last_message_id**](MessagesApi.md#get_last_message_id) | **GET** /messages/last_id |
|
9
|
+
[**send_messages**](MessagesApi.md#send_messages) | **POST** /messages |
|
10
|
+
|
11
|
+
|
12
|
+
# **fetch_messages**
|
13
|
+
> Array<MessageEachResponse> fetch_messages(offset, opts)
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
Fetch messages
|
18
|
+
|
19
|
+
### Example
|
20
|
+
```ruby
|
21
|
+
# load the gem
|
22
|
+
require 'triglav_client'
|
23
|
+
# setup authorization
|
24
|
+
TriglavClient.configure do |config|
|
25
|
+
# Configure API key authorization: api_key
|
26
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
27
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
28
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
29
|
+
end
|
30
|
+
|
31
|
+
api_instance = TriglavClient::MessagesApi.new
|
32
|
+
|
33
|
+
offset = 789 # Integer | Offset (Greater than or equal to) ID for Messages to list from
|
34
|
+
|
35
|
+
opts = {
|
36
|
+
limit: 789, # Integer | Number of limits
|
37
|
+
resource_uris: "resource_uris_example" # String | URIs of Resource
|
38
|
+
}
|
39
|
+
|
40
|
+
begin
|
41
|
+
result = api_instance.fetch_messages(offset, opts)
|
42
|
+
p result
|
43
|
+
rescue TriglavClient::ApiError => e
|
44
|
+
puts "Exception when calling MessagesApi->fetch_messages: #{e}"
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
### Parameters
|
49
|
+
|
50
|
+
Name | Type | Description | Notes
|
51
|
+
------------- | ------------- | ------------- | -------------
|
52
|
+
**offset** | **Integer**| Offset (Greater than or equal to) ID for Messages to list from |
|
53
|
+
**limit** | **Integer**| Number of limits | [optional]
|
54
|
+
**resource_uris** | **String**| URIs of Resource | [optional]
|
55
|
+
|
56
|
+
### Return type
|
57
|
+
|
58
|
+
[**Array<MessageEachResponse>**](MessageEachResponse.md)
|
59
|
+
|
60
|
+
### Authorization
|
61
|
+
|
62
|
+
[api_key](../README.md#api_key)
|
63
|
+
|
64
|
+
### HTTP request headers
|
65
|
+
|
66
|
+
- **Content-Type**: application/json
|
67
|
+
- **Accept**: application/json
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
# **get_last_message_id**
|
72
|
+
> LastMessageIdResponse get_last_message_id
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
Get the current last message id which would be used as a first offset to fetch messages
|
77
|
+
|
78
|
+
### Example
|
79
|
+
```ruby
|
80
|
+
# load the gem
|
81
|
+
require 'triglav_client'
|
82
|
+
# setup authorization
|
83
|
+
TriglavClient.configure do |config|
|
84
|
+
# Configure API key authorization: api_key
|
85
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
86
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
87
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
88
|
+
end
|
89
|
+
|
90
|
+
api_instance = TriglavClient::MessagesApi.new
|
91
|
+
|
92
|
+
begin
|
93
|
+
result = api_instance.get_last_message_id
|
94
|
+
p result
|
95
|
+
rescue TriglavClient::ApiError => e
|
96
|
+
puts "Exception when calling MessagesApi->get_last_message_id: #{e}"
|
97
|
+
end
|
98
|
+
```
|
99
|
+
|
100
|
+
### Parameters
|
101
|
+
This endpoint does not need any parameter.
|
102
|
+
|
103
|
+
### Return type
|
104
|
+
|
105
|
+
[**LastMessageIdResponse**](LastMessageIdResponse.md)
|
106
|
+
|
107
|
+
### Authorization
|
108
|
+
|
109
|
+
[api_key](../README.md#api_key)
|
110
|
+
|
111
|
+
### HTTP request headers
|
112
|
+
|
113
|
+
- **Content-Type**: application/json
|
114
|
+
- **Accept**: application/json
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
# **send_messages**
|
119
|
+
> BulkinsertResponse send_messages(messages)
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
Enqueues new messages
|
124
|
+
|
125
|
+
### Example
|
126
|
+
```ruby
|
127
|
+
# load the gem
|
128
|
+
require 'triglav_client'
|
129
|
+
# setup authorization
|
130
|
+
TriglavClient.configure do |config|
|
131
|
+
# Configure API key authorization: api_key
|
132
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
133
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
134
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
135
|
+
end
|
136
|
+
|
137
|
+
api_instance = TriglavClient::MessagesApi.new
|
138
|
+
|
139
|
+
messages = [TriglavClient::MessageRequest.new] # Array<MessageRequest> | Messages to enqueue
|
140
|
+
|
141
|
+
|
142
|
+
begin
|
143
|
+
result = api_instance.send_messages(messages)
|
144
|
+
p result
|
145
|
+
rescue TriglavClient::ApiError => e
|
146
|
+
puts "Exception when calling MessagesApi->send_messages: #{e}"
|
147
|
+
end
|
148
|
+
```
|
149
|
+
|
150
|
+
### Parameters
|
151
|
+
|
152
|
+
Name | Type | Description | Notes
|
153
|
+
------------- | ------------- | ------------- | -------------
|
154
|
+
**messages** | [**Array<MessageRequest>**](MessageRequest.md)| Messages to enqueue |
|
155
|
+
|
156
|
+
### Return type
|
157
|
+
|
158
|
+
[**BulkinsertResponse**](BulkinsertResponse.md)
|
159
|
+
|
160
|
+
### Authorization
|
161
|
+
|
162
|
+
[api_key](../README.md#api_key)
|
163
|
+
|
164
|
+
### HTTP request headers
|
165
|
+
|
166
|
+
- **Content-Type**: application/json
|
167
|
+
- **Accept**: application/json
|
168
|
+
|
169
|
+
|
170
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# TriglavClient::ResourceEachResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**uri** | **String** | resource uri | [optional]
|
7
|
+
**unit** | **String** | 'singualr' or 'daily' or 'hourly' | [optional]
|
8
|
+
**timezone** | **String** | timezone of the format [+-]HH:MM | [optional]
|
9
|
+
**span_in_days** | **Integer** | span in days | [optional]
|
10
|
+
**consumable** | **BOOLEAN** | True if this resource should be consumed | [optional]
|
11
|
+
**notifiable** | **BOOLEAN** | True if a job notifies its end of task to triglav for this resource, that is, monitoring in agent is not necessary | [optional]
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# TriglavClient::ResourceRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | | [optional]
|
7
|
+
**description** | **String** | | [optional]
|
8
|
+
**uri** | **String** | URI of Resource |
|
9
|
+
**unit** | **String** | Time unit of resource to monitor such as singular, daily, or hourly | [optional]
|
10
|
+
**timezone** | **String** | Timezone of resource time, that is, timezone of %Y-%m-%d for hdfs://path/to/%Y-%m-%d such as +09:00 | [optional]
|
11
|
+
**span_in_days** | **Integer** | Time span of resource to monitor, default is 32 | [optional]
|
12
|
+
**consumable** | **BOOLEAN** | True if this resource should be consumed. Input resources are automatically set to true, and output resources are set to false | [optional]
|
13
|
+
**notifiable** | **BOOLEAN** | True if a job notifies its end of task to triglav for this resource, that is, monitoring in agent is not necessary | [optional]
|
14
|
+
|
15
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# TriglavClient::ResourceResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | | [optional]
|
7
|
+
**description** | **String** | | [optional]
|
8
|
+
**uri** | **String** | URI of Resource |
|
9
|
+
**unit** | **String** | Time unit of resource to monitor such as singular, daily, or hourly | [optional]
|
10
|
+
**timezone** | **String** | Timezone of resource time, that is, timezone of %Y-%m-%d for hdfs://path/to/%Y-%m-%d such as +09:00 | [optional]
|
11
|
+
**span_in_days** | **Integer** | Time span of resource to monitor, default is 32 | [optional]
|
12
|
+
**consumable** | **BOOLEAN** | True if this resource should be consumed. Input resources are automatically set to true, and output resources are set to false | [optional]
|
13
|
+
**notifiable** | **BOOLEAN** | True if a job notifies its end of task to triglav for this resource, that is, monitoring in agent is not necessary | [optional]
|
14
|
+
**created_at** | **DateTime** | | [optional]
|
15
|
+
**updated_at** | **DateTime** | | [optional]
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,335 @@
|
|
1
|
+
# TriglavClient::ResourcesApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost/api/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**create_resource**](ResourcesApi.md#create_resource) | **POST** /resources |
|
8
|
+
[**delete_resource**](ResourcesApi.md#delete_resource) | **DELETE** /resources/{id_or_uri} |
|
9
|
+
[**get_resource**](ResourcesApi.md#get_resource) | **GET** /resources/{id_or_uri} |
|
10
|
+
[**list_aggregated_resources**](ResourcesApi.md#list_aggregated_resources) | **GET** /aggregated_resources |
|
11
|
+
[**list_resources**](ResourcesApi.md#list_resources) | **GET** /resources |
|
12
|
+
[**update_resource**](ResourcesApi.md#update_resource) | **PATCH** /resources/{id_or_uri} |
|
13
|
+
|
14
|
+
|
15
|
+
# **create_resource**
|
16
|
+
> ResourceResponse create_resource(resource)
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
Creates a new resource
|
21
|
+
|
22
|
+
### Example
|
23
|
+
```ruby
|
24
|
+
# load the gem
|
25
|
+
require 'triglav_client'
|
26
|
+
# setup authorization
|
27
|
+
TriglavClient.configure do |config|
|
28
|
+
# Configure API key authorization: api_key
|
29
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
30
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
31
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
32
|
+
end
|
33
|
+
|
34
|
+
api_instance = TriglavClient::ResourcesApi.new
|
35
|
+
|
36
|
+
resource = TriglavClient::ResourceRequest.new # ResourceRequest | Resource to add
|
37
|
+
|
38
|
+
|
39
|
+
begin
|
40
|
+
result = api_instance.create_resource(resource)
|
41
|
+
p result
|
42
|
+
rescue TriglavClient::ApiError => e
|
43
|
+
puts "Exception when calling ResourcesApi->create_resource: #{e}"
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
### Parameters
|
48
|
+
|
49
|
+
Name | Type | Description | Notes
|
50
|
+
------------- | ------------- | ------------- | -------------
|
51
|
+
**resource** | [**ResourceRequest**](ResourceRequest.md)| Resource to add |
|
52
|
+
|
53
|
+
### Return type
|
54
|
+
|
55
|
+
[**ResourceResponse**](ResourceResponse.md)
|
56
|
+
|
57
|
+
### Authorization
|
58
|
+
|
59
|
+
[api_key](../README.md#api_key)
|
60
|
+
|
61
|
+
### HTTP request headers
|
62
|
+
|
63
|
+
- **Content-Type**: application/json
|
64
|
+
- **Accept**: application/json
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
# **delete_resource**
|
69
|
+
> delete_resource(id_or_uri)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
Deletes single resource
|
74
|
+
|
75
|
+
### Example
|
76
|
+
```ruby
|
77
|
+
# load the gem
|
78
|
+
require 'triglav_client'
|
79
|
+
# setup authorization
|
80
|
+
TriglavClient.configure do |config|
|
81
|
+
# Configure API key authorization: api_key
|
82
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
83
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
84
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
85
|
+
end
|
86
|
+
|
87
|
+
api_instance = TriglavClient::ResourcesApi.new
|
88
|
+
|
89
|
+
id_or_uri = "id_or_uri_example" # String | ID or URI of resource to fetch
|
90
|
+
|
91
|
+
|
92
|
+
begin
|
93
|
+
api_instance.delete_resource(id_or_uri)
|
94
|
+
rescue TriglavClient::ApiError => e
|
95
|
+
puts "Exception when calling ResourcesApi->delete_resource: #{e}"
|
96
|
+
end
|
97
|
+
```
|
98
|
+
|
99
|
+
### Parameters
|
100
|
+
|
101
|
+
Name | Type | Description | Notes
|
102
|
+
------------- | ------------- | ------------- | -------------
|
103
|
+
**id_or_uri** | **String**| ID or URI of resource to fetch |
|
104
|
+
|
105
|
+
### Return type
|
106
|
+
|
107
|
+
nil (empty response body)
|
108
|
+
|
109
|
+
### Authorization
|
110
|
+
|
111
|
+
[api_key](../README.md#api_key)
|
112
|
+
|
113
|
+
### HTTP request headers
|
114
|
+
|
115
|
+
- **Content-Type**: application/json
|
116
|
+
- **Accept**: application/json
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
# **get_resource**
|
121
|
+
> ResourceResponse get_resource(id_or_uri)
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
Returns a single resource
|
126
|
+
|
127
|
+
### Example
|
128
|
+
```ruby
|
129
|
+
# load the gem
|
130
|
+
require 'triglav_client'
|
131
|
+
# setup authorization
|
132
|
+
TriglavClient.configure do |config|
|
133
|
+
# Configure API key authorization: api_key
|
134
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
135
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
136
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
137
|
+
end
|
138
|
+
|
139
|
+
api_instance = TriglavClient::ResourcesApi.new
|
140
|
+
|
141
|
+
id_or_uri = "id_or_uri_example" # String | ID or URI of resource to fetch
|
142
|
+
|
143
|
+
|
144
|
+
begin
|
145
|
+
result = api_instance.get_resource(id_or_uri)
|
146
|
+
p result
|
147
|
+
rescue TriglavClient::ApiError => e
|
148
|
+
puts "Exception when calling ResourcesApi->get_resource: #{e}"
|
149
|
+
end
|
150
|
+
```
|
151
|
+
|
152
|
+
### Parameters
|
153
|
+
|
154
|
+
Name | Type | Description | Notes
|
155
|
+
------------- | ------------- | ------------- | -------------
|
156
|
+
**id_or_uri** | **String**| ID or URI of resource to fetch |
|
157
|
+
|
158
|
+
### Return type
|
159
|
+
|
160
|
+
[**ResourceResponse**](ResourceResponse.md)
|
161
|
+
|
162
|
+
### Authorization
|
163
|
+
|
164
|
+
[api_key](../README.md#api_key)
|
165
|
+
|
166
|
+
### HTTP request headers
|
167
|
+
|
168
|
+
- **Content-Type**: application/json
|
169
|
+
- **Accept**: application/json
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
# **list_aggregated_resources**
|
174
|
+
> Array<AggregatedResourceEachResponse> list_aggregated_resources(uri_prefix)
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
Returns aggregated resources to be monitored
|
179
|
+
|
180
|
+
### Example
|
181
|
+
```ruby
|
182
|
+
# load the gem
|
183
|
+
require 'triglav_client'
|
184
|
+
# setup authorization
|
185
|
+
TriglavClient.configure do |config|
|
186
|
+
# Configure API key authorization: api_key
|
187
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
188
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
189
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
190
|
+
end
|
191
|
+
|
192
|
+
api_instance = TriglavClient::ResourcesApi.new
|
193
|
+
|
194
|
+
uri_prefix = "uri_prefix_example" # String | Prefix of Resource URI
|
195
|
+
|
196
|
+
|
197
|
+
begin
|
198
|
+
result = api_instance.list_aggregated_resources(uri_prefix)
|
199
|
+
p result
|
200
|
+
rescue TriglavClient::ApiError => e
|
201
|
+
puts "Exception when calling ResourcesApi->list_aggregated_resources: #{e}"
|
202
|
+
end
|
203
|
+
```
|
204
|
+
|
205
|
+
### Parameters
|
206
|
+
|
207
|
+
Name | Type | Description | Notes
|
208
|
+
------------- | ------------- | ------------- | -------------
|
209
|
+
**uri_prefix** | **String**| Prefix of Resource URI |
|
210
|
+
|
211
|
+
### Return type
|
212
|
+
|
213
|
+
[**Array<AggregatedResourceEachResponse>**](AggregatedResourceEachResponse.md)
|
214
|
+
|
215
|
+
### Authorization
|
216
|
+
|
217
|
+
[api_key](../README.md#api_key)
|
218
|
+
|
219
|
+
### HTTP request headers
|
220
|
+
|
221
|
+
- **Content-Type**: application/json
|
222
|
+
- **Accept**: application/json
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
# **list_resources**
|
227
|
+
> Array<ResourceEachResponse> list_resources(opts)
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
Returns all resources
|
232
|
+
|
233
|
+
### Example
|
234
|
+
```ruby
|
235
|
+
# load the gem
|
236
|
+
require 'triglav_client'
|
237
|
+
# setup authorization
|
238
|
+
TriglavClient.configure do |config|
|
239
|
+
# Configure API key authorization: api_key
|
240
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
241
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
242
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
243
|
+
end
|
244
|
+
|
245
|
+
api_instance = TriglavClient::ResourcesApi.new
|
246
|
+
|
247
|
+
opts = {
|
248
|
+
uri_prefix: "uri_prefix_example" # String | Prefix of Resource URI
|
249
|
+
}
|
250
|
+
|
251
|
+
begin
|
252
|
+
result = api_instance.list_resources(opts)
|
253
|
+
p result
|
254
|
+
rescue TriglavClient::ApiError => e
|
255
|
+
puts "Exception when calling ResourcesApi->list_resources: #{e}"
|
256
|
+
end
|
257
|
+
```
|
258
|
+
|
259
|
+
### Parameters
|
260
|
+
|
261
|
+
Name | Type | Description | Notes
|
262
|
+
------------- | ------------- | ------------- | -------------
|
263
|
+
**uri_prefix** | **String**| Prefix of Resource URI | [optional]
|
264
|
+
|
265
|
+
### Return type
|
266
|
+
|
267
|
+
[**Array<ResourceEachResponse>**](ResourceEachResponse.md)
|
268
|
+
|
269
|
+
### Authorization
|
270
|
+
|
271
|
+
[api_key](../README.md#api_key)
|
272
|
+
|
273
|
+
### HTTP request headers
|
274
|
+
|
275
|
+
- **Content-Type**: application/json
|
276
|
+
- **Accept**: application/json
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
# **update_resource**
|
281
|
+
> ResourceResponse update_resource(id_or_uri, resource)
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
Updates a single resource
|
286
|
+
|
287
|
+
### Example
|
288
|
+
```ruby
|
289
|
+
# load the gem
|
290
|
+
require 'triglav_client'
|
291
|
+
# setup authorization
|
292
|
+
TriglavClient.configure do |config|
|
293
|
+
# Configure API key authorization: api_key
|
294
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
295
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
296
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
297
|
+
end
|
298
|
+
|
299
|
+
api_instance = TriglavClient::ResourcesApi.new
|
300
|
+
|
301
|
+
id_or_uri = "id_or_uri_example" # String | ID or URI of resource to fetch
|
302
|
+
|
303
|
+
resource = TriglavClient::ResourceRequest.new # ResourceRequest | Resource parameters to update
|
304
|
+
|
305
|
+
|
306
|
+
begin
|
307
|
+
result = api_instance.update_resource(id_or_uri, resource)
|
308
|
+
p result
|
309
|
+
rescue TriglavClient::ApiError => e
|
310
|
+
puts "Exception when calling ResourcesApi->update_resource: #{e}"
|
311
|
+
end
|
312
|
+
```
|
313
|
+
|
314
|
+
### Parameters
|
315
|
+
|
316
|
+
Name | Type | Description | Notes
|
317
|
+
------------- | ------------- | ------------- | -------------
|
318
|
+
**id_or_uri** | **String**| ID or URI of resource to fetch |
|
319
|
+
**resource** | [**ResourceRequest**](ResourceRequest.md)| Resource parameters to update |
|
320
|
+
|
321
|
+
### Return type
|
322
|
+
|
323
|
+
[**ResourceResponse**](ResourceResponse.md)
|
324
|
+
|
325
|
+
### Authorization
|
326
|
+
|
327
|
+
[api_key](../README.md#api_key)
|
328
|
+
|
329
|
+
### HTTP request headers
|
330
|
+
|
331
|
+
- **Content-Type**: application/json
|
332
|
+
- **Accept**: application/json
|
333
|
+
|
334
|
+
|
335
|
+
|