addAction
-Create and start an Action.
--
/simulation/{simid}/addAction
- -
Usage and SDK Samples
- - - -curl -X POST\
--H "Accept: application/json"\
--H "Content-Type: application/json"\
-"https://wrench-project.org/v1/simulation/{simid}/addAction"
- import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.WRENCHApi;
-
-import java.io.File;
-import java.util.*;
-
-public class WRENCHApiExample {
-
- public static void main(String[] args) {
-
- WRENCHApi apiInstance = new WRENCHApi();
- String simid = simid_example; // String | ID of the simulation
- Simid_addAction_body body = ; // Simid_addAction_body | Input to start a new action.
- try {
- GenericResponse result = apiInstance.addAction(simid, body);
- System.out.println(result);
- } catch (ApiException e) {
- System.err.println("Exception when calling WRENCHApi#addAction");
- e.printStackTrace();
- }
- }
-}
- import io.swagger.client.api.WRENCHApi;
-
-public class WRENCHApiExample {
-
- public static void main(String[] args) {
- WRENCHApi apiInstance = new WRENCHApi();
- String simid = simid_example; // String | ID of the simulation
- Simid_addAction_body body = ; // Simid_addAction_body | Input to start a new action.
- try {
- GenericResponse result = apiInstance.addAction(simid, body);
- System.out.println(result);
- } catch (ApiException e) {
- System.err.println("Exception when calling WRENCHApi#addAction");
- e.printStackTrace();
- }
- }
-}
- String *simid = simid_example; // ID of the simulation
-Simid_addAction_body *body = ; // Input to start a new action. (optional)
-
-WRENCHApi *apiInstance = [[WRENCHApi alloc] init];
-
-// Create and start an Action.
-[apiInstance addActionWith:simid
- body:body
- completionHandler: ^(GenericResponse output, NSError* error) {
- if (output) {
- NSLog(@"%@", output);
- }
- if (error) {
- NSLog(@"Error: %@", error);
- }
- }];
-
- var WrenchRestApi = require('wrench_rest_api');
-
-var api = new WrenchRestApi.WRENCHApi()
-var simid = simid_example; // {{String}} ID of the simulation
-var opts = {
- 'body': // {{Simid_addAction_body}} Input to start a new action.
-};
-var callback = function(error, data, response) {
- if (error) {
- console.error(error);
- } else {
- console.log('API called successfully. Returned data: ' + data);
- }
-};
-api.addAction(simid, opts, callback);
-
- using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
- public class addActionExample
- {
- public void main()
- {
-
- var apiInstance = new WRENCHApi();
- var simid = simid_example; // String | ID of the simulation
- var body = new Simid_addAction_body(); // Simid_addAction_body | Input to start a new action. (optional)
-
- try
- {
- // Create and start an Action.
- GenericResponse result = apiInstance.addAction(simid, body);
- Debug.WriteLine(result);
- }
- catch (Exception e)
- {
- Debug.Print("Exception when calling WRENCHApi.addAction: " + e.Message );
- }
- }
- }
-}
-
- <?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\ApiWRENCHApi();
-$simid = simid_example; // String | ID of the simulation
-$body = ; // Simid_addAction_body | Input to start a new action.
-
-try {
- $result = $api_instance->addAction($simid, $body);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling WRENCHApi->addAction: ', $e->getMessage(), PHP_EOL;
-}
-?>
- use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::WRENCHApi;
-
-my $api_instance = WWW::SwaggerClient::WRENCHApi->new();
-my $simid = simid_example; # String | ID of the simulation
-my $body = WWW::SwaggerClient::Object::Simid_addAction_body->new(); # Simid_addAction_body | Input to start a new action.
-
-eval {
- my $result = $api_instance->addAction(simid => $simid, body => $body);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling WRENCHApi->addAction: $@\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.WRENCHApi()
-simid = simid_example # String | ID of the simulation
-body = # Simid_addAction_body | Input to start a new action. (optional)
-
-try:
- # Create and start an Action.
- api_response = api_instance.add_action(simid, body=body)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling WRENCHApi->addAction: %s\n" % e)
- Parameters
- -Name | -Description | -
---|---|
simid* | -
-
-
-
-
-
-
-
-
- String
-
-
-
-
- ID of the simulation
-
-
- Required
-
- |
-
Name | -Description | -
---|---|
body | -- - - - - | -