addSchemaInfo
Create a schema metadata if it does not already exist
Creates a schema metadata with the given schema information if it does not already exist. A unique schema identifier is returned.
/api/v1/schemaregistry/schemas
Usage and SDK Samples
curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"http://localhost/api/v1/schemaregistry/schemas" \
-d '{
"evolve" : true,
"validationLevel" : "LATEST",
"name" : "name",
"description" : "description",
"type" : "avro",
"schemaGroup" : "schemaGroup",
"compatibility" : "BACKWARD"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.Class1SchemaApi;
import java.io.File;
import java.util.*;
public class Class1SchemaApiExample {
public static void main(String[] args) {
// Create an instance of the API class
Class1SchemaApi apiInstance = new Class1SchemaApi();
SchemaMetadata schemaMetadata = ; // SchemaMetadata |
try {
Long result = apiInstance.addSchemaInfo(schemaMetadata);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling Class1SchemaApi#addSchemaInfo");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final SchemaMetadata schemaMetadata = new SchemaMetadata(); // SchemaMetadata |
try {
final result = await api_instance.addSchemaInfo(schemaMetadata);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->addSchemaInfo: $e\n');
}
import org.openapitools.client.api.Class1SchemaApi;
public class Class1SchemaApiExample {
public static void main(String[] args) {
Class1SchemaApi apiInstance = new Class1SchemaApi();
SchemaMetadata schemaMetadata = ; // SchemaMetadata |
try {
Long result = apiInstance.addSchemaInfo(schemaMetadata);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling Class1SchemaApi#addSchemaInfo");
e.printStackTrace();
}
}
}
// Create an instance of the API class
Class1SchemaApi *apiInstance = [[Class1SchemaApi alloc] init];
SchemaMetadata *schemaMetadata = ; //
// Create a schema metadata if it does not already exist
[apiInstance addSchemaInfoWith:schemaMetadata
completionHandler: ^(Long output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SchemaRegistryRestApi = require('schema_registry_rest_api');
// Create an instance of the API class
var api = new SchemaRegistryRestApi.Class1SchemaApi()
var schemaMetadata = ; // {SchemaMetadata}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addSchemaInfo(schemaMetadata, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class addSchemaInfoExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new Class1SchemaApi();
var schemaMetadata = new SchemaMetadata(); // SchemaMetadata |
try {
// Create a schema metadata if it does not already exist
Long result = apiInstance.addSchemaInfo(schemaMetadata);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling Class1SchemaApi.addSchemaInfo: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\Class1SchemaApi();
$schemaMetadata = ; // SchemaMetadata |
try {
$result = $api_instance->addSchemaInfo($schemaMetadata);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling Class1SchemaApi->addSchemaInfo: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::Class1SchemaApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::Class1SchemaApi->new();
my $schemaMetadata = WWW::OPenAPIClient::Object::SchemaMetadata->new(); # SchemaMetadata |
eval {
my $result = $api_instance->addSchemaInfo(schemaMetadata => $schemaMetadata);
print Dumper($result);
};
if ($@) {
warn "Exception when calling Class1SchemaApi->addSchemaInfo: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.Class1SchemaApi()
schemaMetadata = # SchemaMetadata |
try:
# Create a schema metadata if it does not already exist
api_response = api_instance.add_schema_info(schemaMetadata)
pprint(api_response)
except ApiException as e:
print("Exception when calling Class1SchemaApi->addSchemaInfo: %s\n" % e)
extern crate Class1SchemaApi;
pub fn main() {
let schemaMetadata = ; // SchemaMetadata
let mut context = Class1SchemaApi::Context::default();
let result = client.addSchemaInfo(schemaMetadata, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
| Name | Description |
|---|---|
| schemaMetadata * |
Schema to be added to the registry |