# moonlogs-ruby MoonlogsRuby - the Ruby gem for the Moonlogs Moonlogs API This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.13.12 - Package version: 1.13.12 - Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen ## Installation ### Build a gem To build the Ruby code into a gem: ```shell gem build moonlogs-ruby.gemspec ``` Then either install the gem locally: ```shell gem install ./moonlogs-ruby-1.13.12.gem ``` (for development, run `gem install --dev ./moonlogs-ruby-1.13.12.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: gem 'moonlogs-ruby', '~> 1.13.12' ### Install from Git If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: gem 'moonlogs-ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ### Include the Ruby code directly Include the Ruby code directly using `-I` as follows: ```shell ruby -Ilib script.rb ``` ## Getting Started Please follow the [installation](#installation) procedure and then run the following code: ```ruby # Load the gem require 'moonlogs-ruby' # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.cover_record_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->cover_record_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::ActionRequest.new # ActionRequest | } begin result = api_instance.create_action(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->create_action: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::RecordRequest.new # RecordRequest | } begin result = api_instance.create_log(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->create_log: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::RecordRequest.new # RecordRequest | } begin result = api_instance.create_log_async(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->create_log_async: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::SchemaRequest.new # SchemaRequest | } begin result = api_instance.create_schema(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->create_schema: #{e}" end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::Credentials.new # Credentials | } begin result = api_instance.create_session(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->create_session: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::TagRequest.new # TagRequest | } begin result = api_instance.create_tag(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->create_tag: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::ApiTokenRequest.new # ApiTokenRequest | } begin result = api_instance.create_token(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->create_token: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::UserRequest.new # UserRequest | } begin result = api_instance.create_user(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->create_user: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new begin result = api_instance.delete_action_by_id p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->delete_action_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.delete_schema_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->delete_schema_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.delete_tag_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->delete_tag_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.delete_token_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->delete_token_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.delete_user_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->delete_user_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.expose_record_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->expose_record_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new begin result = api_instance.get_action_by_id p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_action_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new begin result = api_instance.get_actions p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_actions: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { page: 56, # Integer | limit: 56 # Integer | } begin result = api_instance.get_log(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_log: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.get_log_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_log_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.get_log_request_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_log_request_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.get_log_response_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_log_response_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new schema_name = 'schema_name_example' # String | hash = 'hash_example' # String | begin result = api_instance.get_logs_by_schema_and_hash(schema_name, hash) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_logs_by_schema_and_hash: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.get_schema_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_schema_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new begin result = api_instance.get_schemas p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_schemas: #{e}" end api_instance = MoonlogsRuby::DefaultApi.new begin result = api_instance.get_session p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_session: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.get_tag_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_tag_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new begin result = api_instance.get_tags p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_tags: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.get_token_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_token_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new begin result = api_instance.get_tokens p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_tokens: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | begin result = api_instance.get_user_by_id(id) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_user_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new begin result = api_instance.get_users p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->get_users: #{e}" end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::UserRequest.new # UserRequest | } begin result = api_instance.register_admin(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->register_admin: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::RecordRequest.new, # RecordRequest | page: 56, # Integer | limit: 56, # Integer | from: 'from_example', # String | Time in format \"YYYY-DD-MMTHH:SS\" to: 'to_example' # String | Time in format \"YYYY-DD-MMTHH:SS\" } begin result = api_instance.search_logs(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->search_logs: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new opts = { body: MoonlogsRuby::ActionRequest.new # ActionRequest | } begin result = api_instance.update_action_by_id(opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->update_action_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | opts = { body: MoonlogsRuby::SchemaRequest.new # SchemaRequest | } begin result = api_instance.update_schema_by_id(id, opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->update_schema_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | opts = { body: MoonlogsRuby::TagRequest.new # TagRequest | } begin result = api_instance.update_tag_by_id(id, opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->update_tag_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | opts = { body: MoonlogsRuby::ApiTokenRequest.new # ApiTokenRequest | } begin result = api_instance.update_token_by_id(id, opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->update_token_by_id: #{e}" end # Setup authorization MoonlogsRuby.configure do |config| end api_instance = MoonlogsRuby::DefaultApi.new id = 56 # Integer | opts = { body: MoonlogsRuby::UserRequest.new # UserRequest | } begin result = api_instance.update_user_by_id(id, opts) p result rescue MoonlogsRuby::ApiError => e puts "Exception when calling DefaultApi->update_user_by_id: #{e}" end ``` ## Documentation for API Endpoints All URIs are relative to */* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *MoonlogsRuby::DefaultApi* | [**cover_record_by_id**](docs/DefaultApi.md#cover_record_by_id) | **PUT** /api/logs/{id}/cover | *MoonlogsRuby::DefaultApi* | [**create_action**](docs/DefaultApi.md#create_action) | **POST** /api/actions | *MoonlogsRuby::DefaultApi* | [**create_log**](docs/DefaultApi.md#create_log) | **POST** /api/logs | *MoonlogsRuby::DefaultApi* | [**create_log_async**](docs/DefaultApi.md#create_log_async) | **POST** /api/logs/async | *MoonlogsRuby::DefaultApi* | [**create_schema**](docs/DefaultApi.md#create_schema) | **POST** /api/schemas | *MoonlogsRuby::DefaultApi* | [**create_session**](docs/DefaultApi.md#create_session) | **POST** /api/session | *MoonlogsRuby::DefaultApi* | [**create_tag**](docs/DefaultApi.md#create_tag) | **POST** /api/tags | *MoonlogsRuby::DefaultApi* | [**create_token**](docs/DefaultApi.md#create_token) | **POST** /api/api_tokens | *MoonlogsRuby::DefaultApi* | [**create_user**](docs/DefaultApi.md#create_user) | **POST** /api/users | *MoonlogsRuby::DefaultApi* | [**delete_action_by_id**](docs/DefaultApi.md#delete_action_by_id) | **DELETE** /api/actions/{id} | *MoonlogsRuby::DefaultApi* | [**delete_schema_by_id**](docs/DefaultApi.md#delete_schema_by_id) | **DELETE** /api/schemas/{id} | *MoonlogsRuby::DefaultApi* | [**delete_tag_by_id**](docs/DefaultApi.md#delete_tag_by_id) | **DELETE** /api/tags/{id} | *MoonlogsRuby::DefaultApi* | [**delete_token_by_id**](docs/DefaultApi.md#delete_token_by_id) | **DELETE** /api/api_tokens/{id} | *MoonlogsRuby::DefaultApi* | [**delete_user_by_id**](docs/DefaultApi.md#delete_user_by_id) | **DELETE** /api/users/{id} | *MoonlogsRuby::DefaultApi* | [**expose_record_by_id**](docs/DefaultApi.md#expose_record_by_id) | **PUT** /api/logs/{id}/expose | *MoonlogsRuby::DefaultApi* | [**get_action_by_id**](docs/DefaultApi.md#get_action_by_id) | **GET** /api/actions/{id} | *MoonlogsRuby::DefaultApi* | [**get_actions**](docs/DefaultApi.md#get_actions) | **GET** /api/actions | *MoonlogsRuby::DefaultApi* | [**get_log**](docs/DefaultApi.md#get_log) | **GET** /api/logs | *MoonlogsRuby::DefaultApi* | [**get_log_by_id**](docs/DefaultApi.md#get_log_by_id) | **GET** /api/logs/{id} | *MoonlogsRuby::DefaultApi* | [**get_log_request_by_id**](docs/DefaultApi.md#get_log_request_by_id) | **GET** /api/logs/{id}/request | *MoonlogsRuby::DefaultApi* | [**get_log_response_by_id**](docs/DefaultApi.md#get_log_response_by_id) | **GET** /api/logs/{id}/response | *MoonlogsRuby::DefaultApi* | [**get_logs_by_schema_and_hash**](docs/DefaultApi.md#get_logs_by_schema_and_hash) | **GET** /api/logs/group/{schema_name}/{hash} | *MoonlogsRuby::DefaultApi* | [**get_schema_by_id**](docs/DefaultApi.md#get_schema_by_id) | **GET** /api/schemas/{id} | *MoonlogsRuby::DefaultApi* | [**get_schemas**](docs/DefaultApi.md#get_schemas) | **GET** /api/schemas | *MoonlogsRuby::DefaultApi* | [**get_session**](docs/DefaultApi.md#get_session) | **GET** /api/session | *MoonlogsRuby::DefaultApi* | [**get_tag_by_id**](docs/DefaultApi.md#get_tag_by_id) | **GET** /api/tags/{id} | *MoonlogsRuby::DefaultApi* | [**get_tags**](docs/DefaultApi.md#get_tags) | **GET** /api/tags | *MoonlogsRuby::DefaultApi* | [**get_token_by_id**](docs/DefaultApi.md#get_token_by_id) | **GET** /api/api_tokens/{id} | *MoonlogsRuby::DefaultApi* | [**get_tokens**](docs/DefaultApi.md#get_tokens) | **GET** /api/api_tokens | *MoonlogsRuby::DefaultApi* | [**get_user_by_id**](docs/DefaultApi.md#get_user_by_id) | **GET** /api/users/{id} | *MoonlogsRuby::DefaultApi* | [**get_users**](docs/DefaultApi.md#get_users) | **GET** /api/users | *MoonlogsRuby::DefaultApi* | [**register_admin**](docs/DefaultApi.md#register_admin) | **POST** /api/setup/register_admin | *MoonlogsRuby::DefaultApi* | [**search_logs**](docs/DefaultApi.md#search_logs) | **POST** /api/logs/search | *MoonlogsRuby::DefaultApi* | [**update_action_by_id**](docs/DefaultApi.md#update_action_by_id) | **PUT** /api/actions/{id} | *MoonlogsRuby::DefaultApi* | [**update_schema_by_id**](docs/DefaultApi.md#update_schema_by_id) | **PUT** /api/schemas/{id} | *MoonlogsRuby::DefaultApi* | [**update_tag_by_id**](docs/DefaultApi.md#update_tag_by_id) | **PUT** /api/tags/{id} | *MoonlogsRuby::DefaultApi* | [**update_token_by_id**](docs/DefaultApi.md#update_token_by_id) | **PUT** /api/api_tokens/{id} | *MoonlogsRuby::DefaultApi* | [**update_user_by_id**](docs/DefaultApi.md#update_user_by_id) | **PUT** /api/users/{id} | ## Documentation for Models - [MoonlogsRuby::ActionRequest](docs/ActionRequest.md) - [MoonlogsRuby::ActionResponse](docs/ActionResponse.md) - [MoonlogsRuby::ApiTokenRequest](docs/ApiTokenRequest.md) - [MoonlogsRuby::ApiTokenResponse](docs/ApiTokenResponse.md) - [MoonlogsRuby::Condition](docs/Condition.md) - [MoonlogsRuby::Credentials](docs/Credentials.md) - [MoonlogsRuby::InlineResponse200](docs/InlineResponse200.md) - [MoonlogsRuby::InlineResponse2001](docs/InlineResponse2001.md) - [MoonlogsRuby::InlineResponse20010](docs/InlineResponse20010.md) - [MoonlogsRuby::InlineResponse20011](docs/InlineResponse20011.md) - [MoonlogsRuby::InlineResponse20012](docs/InlineResponse20012.md) - [MoonlogsRuby::InlineResponse20013](docs/InlineResponse20013.md) - [MoonlogsRuby::InlineResponse20014](docs/InlineResponse20014.md) - [MoonlogsRuby::InlineResponse20015](docs/InlineResponse20015.md) - [MoonlogsRuby::InlineResponse20016](docs/InlineResponse20016.md) - [MoonlogsRuby::InlineResponse20017](docs/InlineResponse20017.md) - [MoonlogsRuby::InlineResponse20018](docs/InlineResponse20018.md) - [MoonlogsRuby::InlineResponse20019](docs/InlineResponse20019.md) - [MoonlogsRuby::InlineResponse2002](docs/InlineResponse2002.md) - [MoonlogsRuby::InlineResponse2003](docs/InlineResponse2003.md) - [MoonlogsRuby::InlineResponse2004](docs/InlineResponse2004.md) - [MoonlogsRuby::InlineResponse2005](docs/InlineResponse2005.md) - [MoonlogsRuby::InlineResponse2006](docs/InlineResponse2006.md) - [MoonlogsRuby::InlineResponse2007](docs/InlineResponse2007.md) - [MoonlogsRuby::InlineResponse2008](docs/InlineResponse2008.md) - [MoonlogsRuby::InlineResponse2009](docs/InlineResponse2009.md) - [MoonlogsRuby::Level](docs/Level.md) - [MoonlogsRuby::Meta](docs/Meta.md) - [MoonlogsRuby::OneOfRecordRequestLevel](docs/OneOfRecordRequestLevel.md) - [MoonlogsRuby::OneOfRecordResponseLevel](docs/OneOfRecordResponseLevel.md) - [MoonlogsRuby::OneOfUserRequestRole](docs/OneOfUserRequestRole.md) - [MoonlogsRuby::OneOfUserResponseRole](docs/OneOfUserResponseRole.md) - [MoonlogsRuby::RecordRequest](docs/RecordRequest.md) - [MoonlogsRuby::RecordResponse](docs/RecordResponse.md) - [MoonlogsRuby::Role](docs/Role.md) - [MoonlogsRuby::SchemaField](docs/SchemaField.md) - [MoonlogsRuby::SchemaKind](docs/SchemaKind.md) - [MoonlogsRuby::SchemaRequest](docs/SchemaRequest.md) - [MoonlogsRuby::SchemaResponse](docs/SchemaResponse.md) - [MoonlogsRuby::Session](docs/Session.md) - [MoonlogsRuby::TagRequest](docs/TagRequest.md) - [MoonlogsRuby::TagResponse](docs/TagResponse.md) - [MoonlogsRuby::UserRequest](docs/UserRequest.md) - [MoonlogsRuby::UserResponse](docs/UserResponse.md) ## Documentation for Authorization ### http1