Class: CortexApp::CustomData

Inherits:
Api
  • Object
show all
Defined in:
lib/cortex_app/custom_data.rb

Overview

API client to interact with Cortex custom data

Constant Summary

Constants inherited from Api

Api::API_URL

Instance Method Summary collapse

Methods inherited from Api

#initialize

Constructor Details

This class inherits a constructor from CortexApp::Api

Instance Method Details

#post(entity_tag:, data:) ⇒ Object

POSTs custom data to Cortex for a specific entity

Parameters:

  • entity_tag (String)

    the entity tag in Cortex

  • data (Hash)

    the custom data to POST



10
11
12
# File 'lib/cortex_app/custom_data.rb', line 10

def post(entity_tag:, data:)
  http_post(path: post_path(entity_tag), data: data)
end

#put_bulk(data:) ⇒ Object

Bulk PUTs custom data to Cortex for multiple entities

Parameters:

  • data (Hash)

    the custom data to PUT



17
18
19
# File 'lib/cortex_app/custom_data.rb', line 17

def put_bulk(data:)
  http_put(path: 'catalog/custom-data', data: data)
end