netilion 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ruby.yml +22 -0
  3. data/.gitignore +9 -0
  4. data/.rubocop.yml +74 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +7 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +155 -0
  9. data/Rakefile +12 -0
  10. data/bin/console +15 -0
  11. data/bin/setup +8 -0
  12. data/lib/netilion.rb +53 -0
  13. data/lib/netilion/api_key.rb +12 -0
  14. data/lib/netilion/api_subscription.rb +13 -0
  15. data/lib/netilion/asset.rb +18 -0
  16. data/lib/netilion/asset_health_condition.rb +13 -0
  17. data/lib/netilion/asset_status.rb +17 -0
  18. data/lib/netilion/asset_value.rb +12 -0
  19. data/lib/netilion/attachment.rb +12 -0
  20. data/lib/netilion/authentication.rb +15 -0
  21. data/lib/netilion/bill_of_material.rb +10 -0
  22. data/lib/netilion/client_application.rb +13 -0
  23. data/lib/netilion/company.rb +12 -0
  24. data/lib/netilion/delivery.rb +14 -0
  25. data/lib/netilion/delivery_status.rb +12 -0
  26. data/lib/netilion/document.rb +14 -0
  27. data/lib/netilion/document_category.rb +13 -0
  28. data/lib/netilion/document_classification.rb +12 -0
  29. data/lib/netilion/document_status.rb +12 -0
  30. data/lib/netilion/edm.rb +6 -0
  31. data/lib/netilion/edm/edge_device.rb +23 -0
  32. data/lib/netilion/edm/edge_device_status.rb +19 -0
  33. data/lib/netilion/edm/edge_device_type.rb +19 -0
  34. data/lib/netilion/edm/field_gateway.rb +22 -0
  35. data/lib/netilion/edm/field_gateway_status.rb +19 -0
  36. data/lib/netilion/edm/field_gateway_type.rb +19 -0
  37. data/lib/netilion/edm/network_interface.rb +19 -0
  38. data/lib/netilion/edm/record.rb +8 -0
  39. data/lib/netilion/edm/software_image.rb +20 -0
  40. data/lib/netilion/edm/software_image_type.rb +19 -0
  41. data/lib/netilion/edm/software_version.rb +21 -0
  42. data/lib/netilion/edm/software_version_status.rb +19 -0
  43. data/lib/netilion/edm/specification.rb +12 -0
  44. data/lib/netilion/edm/update_schedule.rb +21 -0
  45. data/lib/netilion/edm/update_schedule_status.rb +19 -0
  46. data/lib/netilion/event.rb +14 -0
  47. data/lib/netilion/event_status.rb +12 -0
  48. data/lib/netilion/event_type.rb +12 -0
  49. data/lib/netilion/extended_order_code_lookup.rb +7 -0
  50. data/lib/netilion/health_condition.rb +13 -0
  51. data/lib/netilion/health_condition_cause.rb +10 -0
  52. data/lib/netilion/health_condition_remedy.rb +10 -0
  53. data/lib/netilion/instrumentation.rb +15 -0
  54. data/lib/netilion/instrumentation_status.rb +12 -0
  55. data/lib/netilion/instrumentation_type.rb +13 -0
  56. data/lib/netilion/netilion.rb +6 -0
  57. data/lib/netilion/node.rb +14 -0
  58. data/lib/netilion/node_type.rb +12 -0
  59. data/lib/netilion/notification.rb +10 -0
  60. data/lib/netilion/permission.rb +14 -0
  61. data/lib/netilion/permission_request.rb +13 -0
  62. data/lib/netilion/product.rb +15 -0
  63. data/lib/netilion/product_category.rb +13 -0
  64. data/lib/netilion/product_lookup.rb +7 -0
  65. data/lib/netilion/product_status.rb +12 -0
  66. data/lib/netilion/purchase_order.rb +15 -0
  67. data/lib/netilion/purchase_order_status.rb +12 -0
  68. data/lib/netilion/quotation.rb +14 -0
  69. data/lib/netilion/quotation_status.rb +12 -0
  70. data/lib/netilion/record.rb +6 -0
  71. data/lib/netilion/request_for_quotation.rb +14 -0
  72. data/lib/netilion/request_for_quotation_status.rb +12 -0
  73. data/lib/netilion/search.rb +7 -0
  74. data/lib/netilion/specification.rb +13 -0
  75. data/lib/netilion/subscription.rb +15 -0
  76. data/lib/netilion/successor_lookup.rb +9 -0
  77. data/lib/netilion/tenant.rb +14 -0
  78. data/lib/netilion/threshold.rb +10 -0
  79. data/lib/netilion/unit.rb +12 -0
  80. data/lib/netilion/user.rb +10 -0
  81. data/lib/netilion/user_group.rb +10 -0
  82. data/lib/netilion/user_role.rb +12 -0
  83. data/lib/netilion/version.rb +5 -0
  84. data/netilion.gemspec +33 -0
  85. metadata +218 -0
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class AssetHealthCondition < LHS::Record
5
+ configuration items_key: :health_conditions
6
+
7
+ endpoint '{+api}/assets/{asset_id}/health_conditions'
8
+ endpoint '{+api}/assets/{asset_id}/health_conditions/{id}'
9
+
10
+ has_one :asset_status, class_name: 'Netilion::AssetStatus'
11
+ has_one :tenant, class_name: 'Netilion::Tenant'
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class AssetStatus < LHS::Record
5
+ configuration items_key: 'asset_statuses',
6
+ pagination_strategy: :page,
7
+ pagination_key: { body: %w[pagination page], parameter: 'page' },
8
+ limit_key: { body: %w[pagination per_page], parameter: 'limit' },
9
+ total_key: %w[pagination total_count]
10
+
11
+ endpoint '{+api}/asset/statuses'
12
+ endpoint '{+api}/asset/statuses/{id}'
13
+ endpoint '{+api}/assets/{asset_id}/status'
14
+
15
+ has_one :tenant, class_name: 'Netilion::Tenant'
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class AssetValue < LHS::Record
5
+ configuration items_key: :values
6
+
7
+ endpoint '{+api}/assets/{asset_id}/values'
8
+ endpoint '{+api}/assets/{asset_id}/values/{key}'
9
+
10
+ has_one :unit, class_name: 'Netilion::Unit'
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class Attachment < LHS::Record
5
+ configuration items_key: :attachments
6
+
7
+ endpoint '{+api}/attachments'
8
+ endpoint '{+api}/attachments/{id}'
9
+
10
+ has_one :document, class_name: 'Netilion::Document'
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class Authentication < LHC::Interceptor
5
+ def before_request
6
+ request.options[:auth] = {
7
+ basic: {
8
+ username: ::Netilion.config.username,
9
+ password: ::Netilion.config.password
10
+ }
11
+ }
12
+ request.headers['Api-Key'] = ::Netilion.config.api_key
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class BillOfMaterial < LHS::Record
5
+ configuration items_key: :bill_of_materials
6
+
7
+ endpoint '{+api}/bill_of_materials'
8
+ endpoint '{+api}/bill_of_materials/{id}'
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class ClientApplication < LHS::Record
5
+ configuration items_key: :client_applications
6
+
7
+ endpoint '{+api}/client_applications'
8
+ endpoint '{+api}/client_applications/{id}'
9
+
10
+ has_one :contact_person, class_name: 'Netilion::User'
11
+ has_one :technical_user, class_name: 'Netilion::User'
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class Company < LHS::Record
5
+ configuration items_key: :companies
6
+
7
+ endpoint '{+api}/companies'
8
+ endpoint '{+api}/companies/{id}'
9
+
10
+ has_one :tenant, class_name: 'Netilion::Tenant'
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class Delivery < LHS::Record
5
+ configuration items_key: :deliveries
6
+
7
+ endpoint '{+api}/deliveries'
8
+ endpoint '{+api}/deliveries/{id}'
9
+
10
+ has_one :sender, class_name: 'Netilion::User'
11
+ has_one :receiver, class_name: 'Netilion::User'
12
+ has_one :status, class_name: 'Netilion::DeliveryStatus'
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class DeliveryStatus < LHS::Record
5
+ configuration items_key: :delivery_statuses
6
+
7
+ endpoint '{+api}/delivery/statuses'
8
+ endpoint '{+api}/delivery/statuses/{id}'
9
+
10
+ has_one :tenant, class_name: 'Netilion::Tenant'
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class Document < LHS::Record
5
+ configuration items_key: :documents
6
+
7
+ endpoint '{+api}/documents'
8
+ endpoint '{+api}/documents/{id}'
9
+
10
+ has_one :classification, class_name: 'Netilion::DocumentClassification'
11
+ has_one :status, class_name: 'Netilion::DocumentStatus'
12
+ has_one :tenant, class_name: 'Netilion::Tenant'
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class DocumentCategory < LHS::Record
5
+ configuration items_key: :categories
6
+
7
+ endpoint '{+api}/document/categories'
8
+ endpoint '{+api}/document/categories/{id}'
9
+
10
+ has_one :parent, class_name: 'Netilion::DocumentCategory'
11
+ has_one :tenant, class_name: 'Netilion::Tenant'
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class DocumentClassification < LHS::Record
5
+ configuration items_key: :document_classifications
6
+
7
+ endpoint '{+api}/document/classifications'
8
+ endpoint '{+api}/document/classifications/{id}'
9
+
10
+ has_one :tenant, class_name: 'Netilion::Tenant'
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ class DocumentStatus < LHS::Record
5
+ configuration items_key: :document_statuses
6
+
7
+ endpoint '{+api}/document/statuses'
8
+ endpoint '{+api}/document/statuses/{id}'
9
+
10
+ has_one :tenant, class_name: 'Netilion::Tenant'
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ end
6
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class EdgeDevice < ::Netilion::Record
6
+ configuration items_key: :edge_devices
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/edge_devices'
14
+ endpoint '{+edm}/edge_devices/{id}'
15
+
16
+ has_one :type, class_name: 'Netilion::EDM::EdgeDeviceType'
17
+ has_one :status, class_name: 'Netilion::EDM::EdgeDeviceStatus'
18
+ has_many :field_gateways, class_name: 'Netilion::EDM::FieldGateway'
19
+ has_many :network_interfaces, class_name: 'Netilion::EDM::NetworkInterface'
20
+ has_many :specifications, class_name: 'Netilion::EDM::NetworkInterface'
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class EdgeDeviceStatus < ::Netilion::Record
6
+ configuration items_key: :edge_device_statuses
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/edge_device/statuses'
14
+ endpoint '{+edm}/edge_device/statuses/{id}'
15
+
16
+ has_many :edge_devices, class_name: 'Netilion::EDM::EdgeDevice'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class EdgeDeviceType < ::Netilion::Record
6
+ configuration items_key: :edge_device_types
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/edge_device/types'
14
+ endpoint '{+edm}/edge_device/types/{id}'
15
+
16
+ has_many :edge_devices, class_name: 'Netilion::EDM::EdgeDevice'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class FieldGateway < ::Netilion::Record
6
+ configuration items_key: :field_gateways
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/edge_devices/{edge_device_id}/field_gateways'
14
+ endpoint '{+edm}/edge_devices/{edge_device_id}/field_gateways/{id}'
15
+
16
+ has_one :type, class_name: 'Netilion::EDM::FieldGatewayType'
17
+ has_one :status, class_name: 'Netilion::EDM::FieldGatewayStatus'
18
+ has_one :edge_device, class_name: 'Netilion::EDM::EdgeDevice'
19
+ has_many :specifications, class_name: 'Netilion::EDM::NetworkInterface'
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class FieldGatewayStatus < ::Netilion::Record
6
+ configuration items_key: :field_gateway_statuses
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/field_gateway/statuses'
14
+ endpoint '{+edm}/field_gateway/statuses/{id}'
15
+
16
+ has_many :field_gateways, class_name: 'Netilion::EDM::FieldGateway'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class FieldGatewayType < ::Netilion::Record
6
+ configuration items_key: :field_gateway_types
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/field_gateway/statuses'
14
+ endpoint '{+edm}/field_gateway/statuses/{id}'
15
+
16
+ has_many :field_gateways, class_name: 'Netilion::EDM::FieldGateway'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class NetworkInterface < ::Netilion::Record
6
+ configuration items_key: :network_interfaces
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/edge_devices/{edge_device_id}/network_interfaces'
14
+ endpoint '{+edm}/edge_devices/{edge_device_id}/network_interfaces/{id}'
15
+
16
+ has_one :edge_device, class_name: 'Netilion::EDM::EdgeDevice'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class Record < ::Netilion::Record
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class SoftwareImage < ::Netilion::Record
6
+ configuration items_key: :software_images
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/software_images'
14
+ endpoint '{+edm}/software_images/{id}'
15
+ endpoint '{+edm}/software_versions/{software_version_id}/software_images'
16
+
17
+ has_one :type, class_name: 'Netilion::EDM::SoftwareImageType'
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class SoftwareImageType < ::Netilion::Record
6
+ configuration items_key: :software_image_types
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/software_image/types'
14
+ endpoint '{+edm}/software_image/types/{id}'
15
+
16
+ has_many :software_images, class_name: 'Netilion::EDM::SoftwareImage'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Netilion
4
+ module EDM
5
+ class SoftwareVersion < ::Netilion::Record
6
+ configuration items_key: :software_versions
7
+
8
+ configuration pagination_strategy: :page
9
+ configuration limit_key: { body: [:pagination, :per_page], parameter: :per_page }
10
+ configuration pagination_key: { body: [:pagination, :page], parameter: :page }
11
+ configuration total_key: { body: [:pagination, :total_key], parameter: :total_key }
12
+
13
+ endpoint '{+edm}/software_versions'
14
+ endpoint '{+edm}/software_versions/{id}'
15
+
16
+ has_one :status, class_name: 'Netilion::EDM::SoftwareVersionStatus'
17
+ has_one :edge_device_type, class_name: 'Netilion::EDM::EdgeDeviceType'
18
+ has_many :software_images, class_name: 'Netilion::EDM::SoftwareImage'
19
+ end
20
+ end
21
+ end