Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ce_rise_hex_core_sdk.ModelsApi

All URIs are relative to http://localhost:8080

MethodHTTP requestDescription
create_recordPOST /models/{model}/versions/{version}:createValidate and create a record
query_recordsPOST /models/{model}/versions/{version}:queryQuery records for a model version
validate_model_payloadPOST /models/{model}/versions/{version}:validateValidate payload against model rules

create_record

Record create_record(model, version, idempotency_key, create_request)

Validate and create a record

Validates input payload and writes a new record through the configured record store adapter.

Example

  • Bearer (JWT) Authentication (bearerAuth):
import ce_rise_hex_core_sdk
from ce_rise_hex_core_sdk.models.create_request import CreateRequest
from ce_rise_hex_core_sdk.models.record import Record
from ce_rise_hex_core_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8080
# See configuration.py for a list of all supported configuration parameters.
configuration = ce_rise_hex_core_sdk.Configuration(
    host = "http://localhost:8080"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): bearerAuth
configuration = ce_rise_hex_core_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with ce_rise_hex_core_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ce_rise_hex_core_sdk.ModelsApi(api_client)
    model = 'model_example' # str | Model identifier.
    version = 'version_example' # str | Model version.
    idempotency_key = 'idempotency_key_example' # str | Client-generated key used to deduplicate retries for side-effecting requests.
    create_request = ce_rise_hex_core_sdk.CreateRequest() # CreateRequest | 

    try:
        # Validate and create a record
        api_response = api_instance.create_record(model, version, idempotency_key, create_request)
        print("The response of ModelsApi->create_record:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ModelsApi->create_record: %s\n" % e)

Parameters

NameTypeDescriptionNotes
modelstrModel identifier.
versionstrModel version.
idempotency_keystrClient-generated key used to deduplicate retries for side-effecting requests.
create_requestCreateRequest

Return type

Record

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Record created (or idempotent replay returned existing result).-
401Authentication required or invalid token.-
409Idempotency conflict.-
422Validation failed.-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

query_records

QueryResponse query_records(model, version, query_request)

Query records for a model version

Applies a filter object and returns matching records provided by the record store adapter.

Example

  • Bearer (JWT) Authentication (bearerAuth):
import ce_rise_hex_core_sdk
from ce_rise_hex_core_sdk.models.query_request import QueryRequest
from ce_rise_hex_core_sdk.models.query_response import QueryResponse
from ce_rise_hex_core_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8080
# See configuration.py for a list of all supported configuration parameters.
configuration = ce_rise_hex_core_sdk.Configuration(
    host = "http://localhost:8080"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): bearerAuth
configuration = ce_rise_hex_core_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with ce_rise_hex_core_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ce_rise_hex_core_sdk.ModelsApi(api_client)
    model = 'model_example' # str | Model identifier.
    version = 'version_example' # str | Model version.
    query_request = ce_rise_hex_core_sdk.QueryRequest() # QueryRequest | 

    try:
        # Query records for a model version
        api_response = api_instance.query_records(model, version, query_request)
        print("The response of ModelsApi->query_records:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ModelsApi->query_records: %s\n" % e)

Parameters

NameTypeDescriptionNotes
modelstrModel identifier.
versionstrModel version.
query_requestQueryRequest

Return type

QueryResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Matching records returned.-
401Authentication required or invalid token.-
404Requested model/version is not present in registry.-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

validate_model_payload

ValidationReport validate_model_payload(model, version, validate_request)

Validate payload against model rules

Runs configured validators for the selected model/version and returns a merged validation report.

Example

  • Bearer (JWT) Authentication (bearerAuth):
import ce_rise_hex_core_sdk
from ce_rise_hex_core_sdk.models.validate_request import ValidateRequest
from ce_rise_hex_core_sdk.models.validation_report import ValidationReport
from ce_rise_hex_core_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8080
# See configuration.py for a list of all supported configuration parameters.
configuration = ce_rise_hex_core_sdk.Configuration(
    host = "http://localhost:8080"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): bearerAuth
configuration = ce_rise_hex_core_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with ce_rise_hex_core_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ce_rise_hex_core_sdk.ModelsApi(api_client)
    model = 'model_example' # str | Model identifier, for example `re-indicators-specification`.
    version = 'version_example' # str | Model version string, for example `0.0.3`.
    validate_request = ce_rise_hex_core_sdk.ValidateRequest() # ValidateRequest | 

    try:
        # Validate payload against model rules
        api_response = api_instance.validate_model_payload(model, version, validate_request)
        print("The response of ModelsApi->validate_model_payload:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ModelsApi->validate_model_payload: %s\n" % e)

Parameters

NameTypeDescriptionNotes
modelstrModel identifier, for example `re-indicators-specification`.
versionstrModel version string, for example `0.0.3`.
validate_requestValidateRequest

Return type

ValidationReport

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Validation report returned.-
401Authentication required or invalid token.-
404Requested model/version is not present in registry.-
422Payload is syntactically valid JSON but violates model constraints.-

[Back to top] [Back to API list] [Back to Model list] [Back to README]