createDevice
Creates new Device
/devices
Usage and SDK Samples
curl -X POST "https://localhost/inventory-service/api/v1/devices"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DeviceApi;
import java.io.File;
import java.util.*;
public class DeviceApiExample {
public static void main(String[] args) {
DeviceApi apiInstance = new DeviceApi();
Device body = ; // Device | Device object that needs to be created
try {
Device result = apiInstance.createDevice(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeviceApi#createDevice");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DeviceApi;
public class DeviceApiExample {
public static void main(String[] args) {
DeviceApi apiInstance = new DeviceApi();
Device body = ; // Device | Device object that needs to be created
try {
Device result = apiInstance.createDevice(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeviceApi#createDevice");
e.printStackTrace();
}
}
}
Device *body = ; // Device object that needs to be created
DeviceApi *apiInstance = [[DeviceApi alloc] init];
// Creates new Device
[apiInstance createDeviceWith:body
completionHandler: ^(Device output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SiemensInventoryRestApi = require('siemens_inventory_rest_api');
var api = new SiemensInventoryRestApi.DeviceApi()
var body = ; // {Device} Device object that needs to be created
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createDevice(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createDeviceExample
{
public void main()
{
var apiInstance = new DeviceApi();
var body = new Device(); // Device | Device object that needs to be created
try
{
// Creates new Device
Device result = apiInstance.createDevice(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DeviceApi.createDevice: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\DeviceApi();
$body = ; // Device | Device object that needs to be created
try {
$result = $api_instance->createDevice($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DeviceApi->createDevice: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DeviceApi;
my $api_instance = WWW::SwaggerClient::DeviceApi->new();
my $body = WWW::SwaggerClient::Object::Device->new(); # Device | Device object that needs to be created
eval {
my $result = $api_instance->createDevice(body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DeviceApi->createDevice: $@\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.DeviceApi()
body = # Device | Device object that needs to be created
try:
# Creates new Device
api_response = api_instance.create_device(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DeviceApi->createDevice: %s\n" % e)
Parameters
Body parameters
| Name | Description |
|---|---|
| body * |