addAttribute
Add a custom attribute to an object
/attributes/{objectName}
Usage and SDK Samples
curl -X POST "http://localhost/api/scdata/v1/attributes/{objectName}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String objectName = objectName_example; // String | Object name
PropertyDefinition body = ; // PropertyDefinition |
try {
apiInstance.addAttribute(objectName, body);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addAttribute");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String objectName = objectName_example; // String | Object name
PropertyDefinition body = ; // PropertyDefinition |
try {
apiInstance.addAttribute(objectName, body);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addAttribute");
e.printStackTrace();
}
}
}
String *objectName = objectName_example; // Object name
PropertyDefinition *body = ; //
DefaultApi *apiInstance = [[DefaultApi alloc] init];
[apiInstance addAttributeWith:objectName
body:body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var IrisSupplyChainDataModelApi = require('iris_supply_chain_data_model_api');
var api = new IrisSupplyChainDataModelApi.DefaultApi()
var objectName = objectName_example; // {String} Object name
var body = ; // {PropertyDefinition}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.addAttribute(objectName, body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class addAttributeExample
{
public void main()
{
var apiInstance = new DefaultApi();
var objectName = objectName_example; // String | Object name
var body = new PropertyDefinition(); // PropertyDefinition |
try
{
apiInstance.addAttribute(objectName, body);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.addAttribute: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\DefaultApi();
$objectName = objectName_example; // String | Object name
$body = ; // PropertyDefinition |
try {
$api_instance->addAttribute($objectName, $body);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->addAttribute: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $objectName = objectName_example; # String | Object name
my $body = WWW::SwaggerClient::Object::PropertyDefinition->new(); # PropertyDefinition |
eval {
$api_instance->addAttribute(objectName => $objectName, body => $body);
};
if ($@) {
warn "Exception when calling DefaultApi->addAttribute: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
objectName = objectName_example # String | Object name
body = # PropertyDefinition |
try:
api_instance.add_attribute(objectName, body)
except ApiException as e:
print("Exception when calling DefaultApi->addAttribute: %s\n" % e)
Parameters
Name | Description |
---|---|
objectName* |
String
Object name
Required
|
Name | Description |
---|---|
body * |