Class: Conductor::Http::Api::SchemaResourceApi

Inherits:
Object
  • Object
show all
Defined in:
lib/conductor/http/api/schema_resource_api.rb

Overview

SchemaResourceApi - API for schema management operations (Orkes)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ SchemaResourceApi

Returns a new instance of SchemaResourceApi.



12
13
14
# File 'lib/conductor/http/api/schema_resource_api.rb', line 12

def initialize(api_client = nil)
  @api_client = api_client || ApiClient.new
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



10
11
12
# File 'lib/conductor/http/api/schema_resource_api.rb', line 10

def api_client
  @api_client
end

Instance Method Details

#delete_schema_by_name(name) ⇒ void

This method returns an undefined value.

Delete all versions of a schema by name

Parameters:

  • name (String)

    Schema name



71
72
73
74
75
76
77
78
# File 'lib/conductor/http/api/schema_resource_api.rb', line 71

def delete_schema_by_name(name)
  @api_client.call_api(
    '/schema/{name}',
    'DELETE',
    path_params: { name: name },
    return_http_data_only: true
  )
end

#delete_schema_by_name_and_version(name, version) ⇒ void

This method returns an undefined value.

Delete a schema by name and version

Parameters:

  • name (String)

    Schema name

  • version (Integer)

    Schema version



59
60
61
62
63
64
65
66
# File 'lib/conductor/http/api/schema_resource_api.rb', line 59

def delete_schema_by_name_and_version(name, version)
  @api_client.call_api(
    '/schema/{name}/{version}',
    'DELETE',
    path_params: { name: name, version: version },
    return_http_data_only: true
  )
end

#get_all_schemasArray<SchemaDef>

Get all schemas

Returns:

  • (Array<SchemaDef>)


46
47
48
49
50
51
52
53
# File 'lib/conductor/http/api/schema_resource_api.rb', line 46

def get_all_schemas
  @api_client.call_api(
    '/schema',
    'GET',
    return_type: 'Array<SchemaDef>',
    return_http_data_only: true
  )
end

#get_schema_by_name_and_version(name, version) ⇒ SchemaDef

Get a schema by name and version

Parameters:

  • name (String)

    Schema name

  • version (Integer)

    Schema version

Returns:

  • (SchemaDef)


34
35
36
37
38
39
40
41
42
# File 'lib/conductor/http/api/schema_resource_api.rb', line 34

def get_schema_by_name_and_version(name, version)
  @api_client.call_api(
    '/schema/{name}/{version}',
    'GET',
    path_params: { name: name, version: version },
    return_type: 'SchemaDef',
    return_http_data_only: true
  )
end

#save(body, new_version: false) ⇒ void

This method returns an undefined value.

Save a schema definition

Parameters:

  • body (SchemaDef)

    Schema definition

  • new_version (Boolean) (defaults to: false)

    Whether to create a new version



20
21
22
23
24
25
26
27
28
# File 'lib/conductor/http/api/schema_resource_api.rb', line 20

def save(body, new_version: false)
  @api_client.call_api(
    '/schema',
    'POST',
    query_params: { newVersion: new_version },
    body: body,
    return_http_data_only: true
  )
end