All URIs are relative to http://localhost/api/v1
Method | HTTP request | Description |
---|---|---|
create_resource | POST /resources | |
delete_resource | DELETE /resources/{id_or_uri} | |
get_resource | GET /resources/{id_or_uri} | |
list_aggregated_resources | GET /aggregated_resources | |
list_resources | GET /resources | |
update_resource | PATCH /resources/{id_or_uri} |
ResourceResponse create_resource(resource)
Creates a new resource
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::ResourcesApi.new
resource = TriglavClient::ResourceRequest.new # ResourceRequest | Resource to add
begin
result = api_instance.create_resource(resource)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling ResourcesApi->create_resource: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
resource | ResourceRequest | Resource to add |
- Content-Type: application/json
- Accept: application/json
delete_resource(id_or_uri)
Deletes single resource
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::ResourcesApi.new
id_or_uri = "id_or_uri_example" # String | ID or URI of resource to fetch
begin
api_instance.delete_resource(id_or_uri)
rescue TriglavClient::ApiError => e
puts "Exception when calling ResourcesApi->delete_resource: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id_or_uri | String | ID or URI of resource to fetch |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
ResourceResponse get_resource(id_or_uri)
Returns a single resource
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::ResourcesApi.new
id_or_uri = "id_or_uri_example" # String | ID or URI of resource to fetch
begin
result = api_instance.get_resource(id_or_uri)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling ResourcesApi->get_resource: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id_or_uri | String | ID or URI of resource to fetch |
- Content-Type: application/json
- Accept: application/json
Array<AggregatedResourceEachResponse> list_aggregated_resources(uri_prefix)
Returns aggregated resources to be monitored
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::ResourcesApi.new
uri_prefix = "uri_prefix_example" # String | Prefix of Resource URI
begin
result = api_instance.list_aggregated_resources(uri_prefix)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling ResourcesApi->list_aggregated_resources: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
uri_prefix | String | Prefix of Resource URI |
Array<AggregatedResourceEachResponse>
- Content-Type: application/json
- Accept: application/json
Array<ResourceEachResponse> list_resources(opts)
Returns all resources
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::ResourcesApi.new
opts = {
uri_prefix: "uri_prefix_example" # String | Prefix of Resource URI
}
begin
result = api_instance.list_resources(opts)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling ResourcesApi->list_resources: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
uri_prefix | String | Prefix of Resource URI | [optional] |
- Content-Type: application/json
- Accept: application/json
ResourceResponse update_resource(id_or_uri, resource)
Updates a single resource
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::ResourcesApi.new
id_or_uri = "id_or_uri_example" # String | ID or URI of resource to fetch
resource = TriglavClient::ResourceRequest.new # ResourceRequest | Resource parameters to update
begin
result = api_instance.update_resource(id_or_uri, resource)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling ResourcesApi->update_resource: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id_or_uri | String | ID or URI of resource to fetch | |
resource | ResourceRequest | Resource parameters to update |
- Content-Type: application/json
- Accept: application/json