addObject
+Create a new object of a specified {type}, body represents object to be created in XML, JSON or YAML format
+ ++ +
/{type}
+
+ +
Usage and SDK Samples
+ + + + +
+curl -X post -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://localhost/midpoint/ws/rest/{type}?options="
+
+
+
+
+import io.swagger.client.*;
+import io.swagger.client.auth.*;
+import io.swagger.client.model.*;
+import .DefaultApi;
+
+import java.io.File;
+import java.util.*;
+
+public class DefaultApiExample {
+
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+ // Configure HTTP basic authorization: m_basic
+ HttpBasicAuth m_basic = (HttpBasicAuth) defaultClient.getAuthentication("m_basic");
+ m_basic.setUsername("YOUR USERNAME");
+ m_basic.setPassword("YOUR PASSWORD");
+
+ DefaultApi apiInstance = new DefaultApi();
+ String type = type_example; // String | type of the object to be created. Possible values are connectors, connectorHosts, genericObjects, resources, users, objectTemplates, systemConfigurations, tasks, shadows, roles, valuePolicies, orgs, services
+ Object body = ; // Object |
+ array[String] options = ; // array[String] | Additional options for operation, see ModelExecuteOptionsType
+ try {
+ apiInstance.addObject(type, body, options);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DefaultApi#addObject");
+ e.printStackTrace();
+ }
+ }
+}
+
+
+
+import .DefaultApi;
+
+public class DefaultApiExample {
+
+ public static void main(String[] args) {
+ DefaultApi apiInstance = new DefaultApi();
+ String type = type_example; // String | type of the object to be created. Possible values are connectors, connectorHosts, genericObjects, resources, users, objectTemplates, systemConfigurations, tasks, shadows, roles, valuePolicies, orgs, services
+ Object body = ; // Object |
+ array[String] options = ; // array[String] | Additional options for operation, see ModelExecuteOptionsType
+ try {
+ apiInstance.addObject(type, body, options);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DefaultApi#addObject");
+ e.printStackTrace();
+ }
+ }
+}
+
+
+
+Configuration *apiConfig = [Configuration sharedConfig];
+// Configure HTTP basic authorization (authentication scheme: m_basic)
+[apiConfig setUsername:@"YOUR_USERNAME"];
+[apiConfig setPassword:@"YOUR_PASSWORD"];
+
+
+String *type = type_example; // type of the object to be created. Possible values are connectors, connectorHosts, genericObjects, resources, users, objectTemplates, systemConfigurations, tasks, shadows, roles, valuePolicies, orgs, services
+Object *body = ; //
+array[String] *options = ; // Additional options for operation, see ModelExecuteOptionsType (optional)
+
+DefaultApi *apiInstance = [[DefaultApi alloc] init];
+
+// Add
+[apiInstance addObjectWith:type
+ body:body
+ options:options
+ completionHandler: ^(NSError* error) {
+ if (error) {
+ NSLog(@"Error: %@", error);
+ }
+ }];
+
+
+
+var = require('');
+var defaultClient = .ApiClient.instance;
+
+// Configure HTTP basic authorization: m_basic
+var m_basic = defaultClient.authentications['m_basic'];
+m_basic.username = 'YOUR USERNAME'
+m_basic.password = 'YOUR PASSWORD'
+
+var api = new .DefaultApi()
+
+var type = type_example; // {String} type of the object to be created. Possible values are connectors, connectorHosts, genericObjects, resources, users, objectTemplates, systemConfigurations, tasks, shadows, roles, valuePolicies, orgs, services
+
+var body = ; // {Object}
+
+var opts = {
+ 'options': // {array[String]} Additional options for operation, see ModelExecuteOptionsType
+};
+
+var callback = function(error, data, response) {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully.');
+ }
+};
+api.addObject(type, body, opts, callback);
+
+
+
+using System;
+using System.Diagnostics;
+using .Api;
+using .Client;
+using ;
+
+namespace Example
+{
+ public class addObjectExample
+ {
+ public void main()
+ {
+
+ // Configure HTTP basic authorization: m_basic
+ Configuration.Default.Username = "YOUR_USERNAME";
+ Configuration.Default.Password = "YOUR_PASSWORD";
+
+ var apiInstance = new DefaultApi();
+ var type = type_example; // String | type of the object to be created. Possible values are connectors, connectorHosts, genericObjects, resources, users, objectTemplates, systemConfigurations, tasks, shadows, roles, valuePolicies, orgs, services
+ var body = new Object(); // Object |
+ var options = new array[String](); // array[String] | Additional options for operation, see ModelExecuteOptionsType (optional)
+
+ try
+ {
+ // Add
+ apiInstance.addObject(type, body, options);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling DefaultApi.addObject: " + e.Message );
+ }
+ }
+ }
+}
+
+
+
+setUsername('YOUR_USERNAME');
+io.swagger.client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
+
+$api_instance = new io.swagger.client\Api\DefaultApi();
+$type = type_example; // String | type of the object to be created. Possible values are connectors, connectorHosts, genericObjects, resources, users, objectTemplates, systemConfigurations, tasks, shadows, roles, valuePolicies, orgs, services
+$body = ; // Object |
+$options = ; // array[String] | Additional options for operation, see ModelExecuteOptionsType
+
+try {
+ $api_instance->addObject($type, $body, $options);
+} catch (Exception $e) {
+ echo 'Exception when calling DefaultApi->addObject: ', $e->getMessage(), PHP_EOL;
+}
+
+
+ Parameters
+ + + +Name | +Description | +
---|---|
type* | ++ + + + + | +
Name | +Description | +
---|---|
body * | ++ + + + + | +
Name | +Description | +
---|---|
options | ++ + + + + | +