VC:VmFolder API JSON REST

I try to start a workflow through REST/JSON. The workflow takes two inputs:

1. a string called vmName - variable explicitly.

2. a VC:VmFolder variable called FolderName - I have to get the virtual computers folder in order to make a clone. the problem is that I have only a folder name because this is the level of the interface that my users work.

Once the workflow has been called, she begins a slew of clone, snapshot, activity etc.

I spend the following JSON and I return an error message complaining about the "syntactically incorrect" request

I know that my problem is with the way that the JSON is structured with regard to the VC:VmFolder because it is an object and not a base type (String, number). How to structure the call correctly and especially has a good set of Web site documentation or reference that will guide me in the right direction in the future when dealing with this or other data types complex / objects - I want to learn how to fish?

  1. {
  2. 'settings'
  3. [
  4. {
  5. « nom » : "vmName"
  6. 'type' : 'chain'
  7. 'value' :{"string":{"value":"MyVMName"}} 
  8. },
  9. {
  10. « nom » : "vcFolder"
  11. 'type' : "VC:VmFolder"
  12. 'value' :{{Class=fontblue}} "VC:VmFolder" :{{class=fontblue}} 'value' : "nom_de_dossier" }}
  13. }
  14. ]
  15. }

Any help is greatly appreciated.

Thank you.

So here's your baited beforehand in a fish pond fishing rod

The attached workflow has the id used here (of course, you need to update the URL: port with your server in order to test this):

https://vra-01a.corp.local:443/vco/api/workflows/f40c35ce-1c89-492f-8e33-0eee13d836cc/executions

This is the body to send via json:

 {
  "parameters": [{
  "value": {
  "string": {
  "value": "DemoVM2"
  }
  },
  "type": "string",
  "name": "vmName",
  "scope": "local"
  }, {
  "value": {
  "string": {
  "value": "Management"
  }
  },
  "type": "string",
  "name": "vmFolderName",
  "scope": "local"
  }]
 }

Lam in the screenshot here was launched using the client rest of postman with demand of the json body and the url listed above. As you can see, there are entries of string in function.

The supplied result is a VC:VmFolder object

Tags: VMware

Similar Questions

  • More quick REST API / JSON approaches to the interviews of the OPA?

    I recognize there are services / libraries that can convert an OPA Web Service deployment on the hub to a JSON / REST API.  (Examples: Mashape I used for the other REMAINS in the SOAP proxy).

    But, is there a consensus on the more common approach / best to this operation?  Is there an approach that may be more in line with the future development of the OPA hub around REST API?  I think I saw something with Oracle Cloud Computing Mobile Service, but I cannot find enough documentation to the CEP with.

    It occurs to me, that instead of researching the topic for an hour or more, I could have benefits more ask on the forum.

    Thank you

    Paul, my quick view is that whatever you do will be OK, because even once we add REST API, existing SOAP API will remain for backward compatibility reasons.

    It would also be impossible to build compatibility for something we have not designed yet, so I can't really all guide on what to do / avoid in order to simplify any possible future transition official rest API.

    Davin.

  • JSON REST API format

    Hi all

    I want to read a specific attribute of my assets using the REST API and I would like this information in JSON, but I don't know how to do to get the attribute first, I used http://localhost:9080 / cs/REST/sites/mysite/types/BasicContent_C/assets/1374098078620 / , but the API returns the entire RESOURCE as XML, is it possible to return a single attribute? and it is possible to return this information in JSON format? or I need to read the information together and look for the attribute I want show?

    I want to show information about an external jsp page, I mean the other application.

    Best regards.

    Hello rvillamarin,

    I'm sorry but I needed the same two months ago and I have not found the way.

    Answer your questions, in my opinion:

    is it possible to return a single attribute? N ° you must retrieve the whole XML and look for the attribute on it.

    and it is possible to return this information in JSON? No. two options: create a model in WCSites in order to recover the attributes and present a JSON or create an intermediate java class to convert XML to JSON.

    or I need to read the information together and search for the attribute I want to show? So you can not do directly in the call of REST, you need to develop something.

    What we have done is to process the XML once we received in the client.

    It will be useful,

    Gerardo

  • With Json REST Web services only accepts objects?

    Hello

    With the help of JDEV 12.1.3.0.0 is it possible to send webservice one list and receive it in the client side?

    I wanted to just this:

    @Stateless

    @Path ("/costumer")

    public class CostumerImpl {}

    @EJB

    SessionEJBnameLocal myBean;

    @GET

    @Produces (value = {"application/json", "application/xml"})

    @Path ("/ list")

    public list < CostumerEO > lista() {}

    Return myBean.getCostumerEOFindAll ();

    }

    }

    The only way I found was to create an object with a list, as showned below, send this object and this way has worked:

    @XmlRootElement

    public class {CustomerList

    List < Customer > customerList = new ArrayList < customer > ();

    {} public void setCustomerList (List < Customer > customerList)

    this.customerList = list of customers;

    }

    @XmlElement (name = "allcustomers")

    public List < Customer > getCustomerList() {}

    return list of customers;

    }

    }

    But I want is not to create this object.

    Is this possible?

    JDev 12.1.3.0.0

    Any help would be appreciated.

    Concerning

    Carlos

    I got it to work.

    I went to andrejus apllication lib, got jackson jars, add to my library and the class paths and the test.

    She returned to the country of my comic.

    Now, I can have a class webservice producing json from the BC model without the need for other java classes to parse json or lists.

    Thank you all.

  • API - POST - REST VCO connection pool closing

    Hello

    I'm working on an automation scenario where I need a VCO A workflow to start another workflow VCO B using the VCO REST Plugin (1.0.2) on VCO 5.1.1.

    I did it with success while creating a multitude of REST and surgery REMAINS by using the appropriate workflow. However, my approach is a lot of static and I need to create REST operations on the fly. I have had a look at workflows Plugin and try to do the same thing in my workflow.

    However I am stuck with the error 'Connection Pool close' when you try to run the POST request.

    My approach is to store the host REMAINS as a static attribute with VCO configuration object and retrieve it from there. I can run GET operations without any problem with the owner, i.e.


    restRequest = restHost.createRequest (restType, restUrl, restContent);

    restResponse = restRequest.execute ();

    My problem is actually running a POST operation. I prepared the content in XML format, which is

    " <-xmlns = execution context" http://www.VMware.com/VCO "> "
    < Parameters >

    < name parameter = "param1" type = "string" >

    < string > 1 < / string >

    < / parameter >

    < name parameter = "param2" type = "string" >

    < string > value2 < / string >

    < / parameter >

    < / Parameter >

    < / execution context >

    and use the content type "application/xml". Earlier in my code, I run a query GET to retrieve my ID for workflow target to create a Url like this:

    flow of work/98c3b8ee-9569-4940-acc1-b8fbc2e64649 / executions.

    This is code that I use to make the POST while creating an operation of REST when needed and delete it later.


    var restOperation = new RESTOperation (System.nextUUID ());

    restOperation.method = restType;

    restOperation.urlTemplate = restUrl;

    restOperation.defaultContentType = restContentType;

    restHost.addOperation (restOperation);

    RESTHostManager.updateHost (restHost);

    inputParameters var = [];

    var restRequest = restOperation.createRequest (inputParameters, restContent);

    restRequest.contentType = restContentType;

    var restResponse = restRequest.execute ();

    restHost.removeOperation (restOperation.id);

    RESTHostManager.updateHost (restHost);

    My code does not work when calling for the lifting of restRequest.execute: ' InternalError: connection pool arrested "." If anyone else has tried a similar scenario or has any idea what I may be missing?

    Thank you

    Bernd

    Thanks chap - update the objects did the trick.

    In my case, that initially caused the problem travel of COULD happen. Of course store the restHost object in the configuration of VCO leads to an out-of-date version at run time. I'm now store the ID of restHost only. Then, copy the following code works:

    var restHostId is System.getModule("my.library").myGetConfigAttr ("Folder", "VCO", "restHostId");.

    var restHost = RESTHostManager.getHost (restHostId);

    If (restType == 'GET') {}
    try {}
    restRequest = restHost.createRequest (restType, restUrl, restContent);
    restResponse = restRequest.execute ();
    }
    catch (exp) {throw ("request REST to run: cannot run '" + restType + "' '" + restUrl + "' request-reason = '" + exp + "'") ;}}
    }
    else {}
    try {}
    var restOperation = new RESTOperation (System.nextUUID ());
    restOperation.method = restType;
    restOperation.urlTemplate = restUrl;
    restOperation.defaultContentType = restContentType;
     
    restHost.addOperation (restOperation);
    RESTHostManager.updateHost (restHost);
     
    restHost = RESTHostManager.getHost (restHost.id);
    restOperation = restHost.getOperation (restOperation.id);

    inputParameters var = [];
    var restRequest = restOperation.createRequest (inputParameters, restContent);
    restRequest.contentType = restContentType;

    var restResponse = restRequest.execute ();

    restHost.removeOperation (restOperation.id);
    RESTHostManager.updateHost (restHost);
    }
    catch (exp) {throw ("request REST to run: cannot run '" + restType + "' '" + restUrl + "' request-reason = '" + exp + "'") ;}}
    }

  • REST &gt; JSON &gt; Workflow

    I learn the vRO and I'm stuck with trying to get a REST request to complete successfully a particular workflow. I followed the tutorial here (http://www.vcoteam.info/articles/learn-vco/268-how-to-use-the-rest-api-to-start-a-workflow.html) to apply successfully for a REST to my server vRO. I would like now to take a step further and use the REST api to kick off one of the included workflow (get the VM Uuid).

    Following the same steps in the tutorial above, I can start the workflow (get VM Uuid) via a call to REST. However, it fails with the following error:

    Workflow: Get VM Uuid / Get VM Uuid (item1): java.lang.RuntimeException: ch.dunes.model.type.ConvertorException: could not convert an object, reason: finder not found for type: null

    Now, after my research I believe that I need convert/wrap the JSON data in an output format appropriate for the script 'Get VM Uuid' but I don't know how to do it. Any help would be greatly appreciated.

    Thank you.

    PS. Here is the JSON data that I am sending via:

    {

    "settings":

    [

    {

    'value': {'chain': {'value': 'testvm'}},

    'type': 'VC:VirtualMachine ',.

    "name':"vm. "

    "scope": "local".

    }

    ]

    }

    PPS. any book recommendations would be appreciated as well.

    Hello

    The problem with your body of the request is that you try to specify the virtual input by name object ('testvm', of type string).

    Instead, you must specify the parameter with id and the type of virtual machine. Here is an example request body:

    {
      "parameters":
        [
          {"value":
            {"sdk-object":
              {
                  "type":"VC:VirtualMachine",
                  "id":"10.23.107.55/vm-123"
              }
            },
            "type":"VC:VirtualMachine",
            "name":"vm",
            "scope": "local"
          }
      ]
    }
    

    Note that the value is not of type string, but type object-sdk. The other part of interseting is the structure of virtual machine id - it has the id/host idformat, where host is the address of the vCenter, the virtual machine management and id is the ID of the virtual machine (usually looks like vm -).

    If you don't know what the exact id of your virtual machine, you can find it by selecting the virtual machine in the browser of the client Java vRO inventory.

    On the other question - recommendations about what kind of books you want? Books on Javascript? Or books on vRO, JSON, REST?

  • How to recover Contacts using ContactGroupID using SOAP or RESTFul API in c#?

    Hi guys,.

    I want to recover contact records from Eloqua 10 using ContactGroupID or by using the SOAP API or RESTFul API in c#. Well want to, help me for the same thing.

    Thanking you,

    Kind regards

    Dhaval Doshi.

    Hi Alain,

    You can use the bulk API to export contacts who are members of a segment or group. Documentation is available at the following address: Eloqua bulk API 1.0: importing and exporting data

    Hope this helps and please let me know if you need more information.

    Thank you

    Fred

  • The REST api is supported by Eloqua?

    Hi guys,.

    I know that this seems to be an odd question at first, but bear with me.

    Recently, I created a few features to read certain Eloqua components.

    Then I came across some problems with th! api e REST and contacted support, at one point, they reported that the REST api was not officially taken in charge, is this true?

    Because using SOAP is no option for our programming environment and the major PART is just for the massif of the small amount of calls, we have to do.

    Hope you can give me a permission in this respect, because we do not want to create stuff on top of the api REST when we can never support on it.

    Through the REST API, you can do many things, not all supported.  This page lists the supported operations: management of Eloqua API use cases

  • Consume the Rest Service

    Hello

    JDeveloper Version 11.1.2.4.0.

    What is the best way to consume the REST API of JDeveloper. Found a note for mobile

    Java / Oracle SOA blog: use JSON-REST in ADF Mobile

    for example.

    Best way to consume REST below

    https://maps.googleapis.com/maps/API/geocode/JSON?address=1600+Amphitheatre+Parkway, mountain view +, + CA & key = API_KEY

    Thank you

    JIT


    Hello

    If you want to consume it from a mobile phone or a web application. For mobile, you have found a trick for web applications, you can use

    1 REST control based XML data REST (11 g R2 starting) services

    2 Jersey client API REMAINS in a JavaBean (which then you can expose as a POJO data control)

    Frank

  • Reorganization of the JSON data

    Hi all

    I need help, reorganizing the data I receive from a JSON Unflatten.
    I have a JSON string of a call to API (JSON unflatten) that contains a name (String), a digital and a channel (also a string).
    The JSON Unflatten automatically directs the data it receives in order, the data is provided.  The data is information on the channels.  The problem arises when not all channels are provided.  If out of 12 channels, the JSON receives information on only 4 channels, he ordered the 1 to 4 in the table.  However, 1 may not correspond to channel 1 and can actually be channel 5 and 3 might not correspond to channel 3 so on and so forth.  I want to reorganize the JSON based on reading channel (a channel named canal).  So, if in the table that Channel 4 is actually 12 (based on the channel of the channel, i.e., channel-12), I would link data from Channel 4 to profile 12 in a new table, so that the order of the channels still dependent on chain channel and not according to the order of unflatten of JSON.

    Please help as I am running out of ideas on how to solve this problem.

    Thank you.

    That's what is lying to you?

    PS: Try to avoid the multiple index table - it is preferable to use arrays and loops

  • String in JSON format does not correctly... sometimes

    I use the following (in collaboration with HttpConnectionFactory) to retrieve an our API JSON array:

    public class LocationAPI {
        public static String getHttpResponse(String url){
            HttpConnectionFactory connfac = null;
            HttpConnection conn = null;
            DataInputStream ds = null;
            String response = null;
            try {
                connfac = new HttpConnectionFactory(url);
                conn = connfac.getNextConnection();
    
                if(conn.getResponseCode() == HttpConnection.HTTP_OK){
                    ds = conn.openDataInputStream();
                    byte[] data = new byte[ds.available()];
                    ds.read(data);
                    response = new String(data);
                }else{
                    //http error response code handling
                }
    
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    
            return response;
        }
    }
    

    The API returns something in the sense of the following:

    {
        "data": [
            {
                "city": "Des Moines",
                "business_logo_url": null,
                "name": "LOUIES FLOOR COVERING INC",
                "phone": "515-243-8608",
                "icon_url": "/site_media/categoryicons/Shopping.png",
                "zipcode": "50312",
                "special_id": null,
                "state": "IA",
                "street": "2709 Ingersoll Ave",
                "special": null,
                "lat": 41.585709999999999,
                "lng": -93.653125000000003,
                "id": 136982,
                "website_url": null
            }
        ],
        "pages": 1,
        "page": 1
    }
    

    Depending on the situation, the query could return to what any one place 50 locations. Then I am parsing out them with the following:

    try {
                JSONObject responseObject = new JSONObject(response);
                JSONArray responseArray = responseObject.getJSONArray("data");
                JSONObject itemObject = responseArray.getJSONObject(0);
    
                responseCity = itemObject.optString("city");
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    

    If the answer is short enough (I tested it with one place, still trying to find a query which returns both), it works fine. If he shoots Max (50 places), it-error "org.json.me.JSONException: missing value.» 829 character of ".". When I walked through it, I took a glance at the string and it seems to download the part of the answer. Any suggestions as to what I'm missing here?

    Have you tried to hit the API in a browser to see if your server is truncating the answer? In addition, you can try to use

    response = new String(IOUtilities.streamToBytes(ds);
    

    in case the length of the response of statement is not ds.available (), but everything that is currently available for reading (probably the case).

  • Configuration API to add users to the service

    Hello

    I am new to TMS or TMSPE, I'll try to find the API (SOAP, Rest, http direct,... ect) that Cisco can give us as a system integrator to configure users, terminate, update users on Telepresense Service, and I couldn't.

    Appreciate the help here.

    Thank you

    Hadi

    The only Cisco MSD and MSD associated product API supporting us publicly and externally is the API of booking:

    http://www.Cisco.com/en/us/docs/Telepresence/infrastructure/tmsba/Cisco_TMSBA_API_guide_14-3.PDF

    All the other APIs are undocumented and not support I'm afraid.

    Rgds,

    Dale

  • Beting API integration

    Hello

    I have a possible client that has an export business, he wants a new site Web SEO stand for a global search,

    In addition it requires a bet statistics API to integrate into its Web site were visitors can view Paris euromillions statistics and so.

    Is this possible with adobe platform bc?

    If so the API does not require databases or things that are not compatible with adobe bc, anyone who has programmed these platforms of Paris can give me some advice?

    so far he told me that the program has already been built, and I don't know what kind of program or programming language on what was built.

    You will need to understand (with your client) you want to display on the site Web of BC (and when) you want to synchronize with the system of BC a you want to synchronize with the betting to better reach system requirements.

    British Colombia has new API JSON, which you can access 3rd party with a few tips and a SOAP API, drop me a line if you would like more information.

  • How to integrate the search engine (Google) customized with oracle apex 5.0?

    <script>
      (function() {
        var cx = 'aaaaaaaaaaaa:bbbbb';         
        var gcse = document.createElement('script');
        gcse.type = 'text/javascript';
        gcse.async = true;
        gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
            '//cse.google.com/cse.js?cx=' + cx;
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(gcse, s);
      })();
    </script>
    <gcse:searchbox ></gcse:searchbox>
    
    

    Like, I then politico who and want to change the settings of the CSE research must have be take place. Above the CSE code works for any thing you search I want to connect this way regardless of the setting I have spend in search results will go.

    For this I need to use Json rest api in oracle apex to bind the varibales. Say for example: cr = (country); LN (language) = en; This value will be passed through JSON ESC (google), and the result will appear any suggestion I how to get this...
    Thank you.

    Used JavaScript get json response and show it to the page. You can also use the pl/sql to achieve this.

  • How MAF 2.2.0 security work?

    I have experience working on the ADF, but not on the site of the security. Now I have the need to provide for application of the MAF. Current application of ADF has CustomsLoginModule.jar in \wlserver\server\lib\mbeantypes < JDEV_HOME >, then the application web.xml has login-config

    <>login-config

    FORM < auth-method > < / auth-method >

    < form-login-config >

    /faces/signin/signin.JSF < form-login-page > < / form-login-page >

    /faces/signin/signin.JSF < form-error-page > < / form-error-page >

    < / form-login-config >

    < / login-config >

    On signin.jsf after the user enters the name of user and password, doLogin use in training for under user name and password that store in the oracle database table. Then put UserInfo in the scope of session for ADF session using.

    My question is how can I do for connection of the MAF and give me UserInfo or any other information, then I can make use of this information to call the WebService JSON REST use this CustomsLoginModule.jar ?

    I use Jdeveloper 12.2.1 side Server (under Windows) and Jdeveloper with MAF 2.2.0 12.1.3 extension (Mac) for consuming side.

    Hello.

    Here are answers to your questions.

    (1) this is the way I can replace button registration by entering the user name / password (exist in the oracle database table) that the only logical Web ID / password?

    You must configure the SQL WebLogic authentication provider so that it works. See here for more details:

    https://docs.Oracle.com/middleware/1221/WLS/SECMG/rdbms_atn.htm#SECMG190

    (2) is there anywhere that explains step by step how to create the ACS project (in public samples)?

    Unfortunately, no. However, you should be able to re-use almost as is, since it relies on the API OPSS. If you configure the SQL authenticator, then OPSS will be able to authenticate on the DB as well.

    This video explains the basics of the ACS: https://www.youtube.com/watch?v=2RQPtI6o-l0

    Best regards

    Frédéric.

Maybe you are looking for