Call to vCenter API - getAllVirtualMachines returns Undefined

Hey all, hoping that this is an easy.


I have an Orchestrator workflow to set the notes/annotation on a virtual machine in vCenter (based on the example in this post on the forum). The workflow only has a scriptable object, the content is as follows:


var xml = XMLManager.fromString (vm.toXml ());

System.log ("XML is" + xml);

var vimObjectRef = xml.getElementsByTagName("ns9:VmVimObjectRef").item (0);

System.log ("vimObjectRef is" + vimObjectRef);

moRef var = vimObjectRef.getElementsByTagName("ns9:MoRef").item (0);

System.log ("moRef is" + moRef);

vmId var = moRef.textContent;

System.log ("vmId is" + vmId);


the purpose of "conn" is my SDK on my DEV vCenter Server

vcVm = conn.getAllVirtualMachines (null, "xpath:id =" "+ vmId +" ' "") [0];

System.log ("vcVM is" + vcVm);

var configSummary = vcVm.summary.config;

System.log ("configSummary is" + configSummary);

System.log ("old annotation:"+ configSummary.annotation ");

System.log ("new annotation:" + notes);

Context of var = new VcVirtualMachineConfigSpec();

configSpec.annotation = notes;

var task = vcVm.reconfigVM_Task (configSpec);

System.log (Task);

Tags: VMware

Similar Questions

  • Make a call to REST API through c# to 'change a fixed cost value.

    HI -.

    I am trying to make a call to REST API through c# for "change to a fixed cost value.

    I did successfully the following tasks via c# with the call of the API REMAINS the chargeback manager 2.0

    -Connection to the chargeback manager 2.0

    -Add a custom Chargeback hierarchy

    -Add vCenter Server entity in the hierarchy of Chargeback that was created by the REST API

    -Add the fixed cost model.

    But when I tried to use the REST API to 'change a value of fixed cost' based on the version of the document programming API 2.0.

    He is not successful... Here are the error messages and the code I had.

    Code:

    Public Shared ReadOnly Property ModifiyFixedCost (CookieContainer cookieContainer) as string
    {
    HttpWebRequest request;
    Stream streamReq;
    = request (WebRequest.Create ("https://10.63.11.34/vCenter-CB/api/fixedCost/707/values"); )
    = //request (WebRequest.Create ("https://10.63.11.34/vCenter-CB/api/hierarchy/696/entity/697/costModel/701/fixedCosts/values"); )
    request. CookieContainer = cookieContainer;
    request. Method = "PUT";
    request. KeepAlive = true;
    request. Timeout = 600000;
    request. ContentType = "application/x-www-formulaires-urlencoded; application/x-www-form-urlencoded
    streamReq = request. GetRequestStream();

    Reading XML file.
    String strXML;
    String strCurrentPath = System.IO.Directory.GetCurrentDirectory;
    String strPath = "";
    strPath = strCurrentPath + "\\ModifiyFixedCostXML.txt";

    using (StreamReader sr = new StreamReader (strPath))
    {
    strXML = sr. ReadToEnd();
    }

    String strResp;
    Byte [] byteArray = Encoding.UTF8.GetBytes (strXML);
    streamReq.Write (byteArray, 0, byteArray.Length);
    streamReq.Close ();

    to using (WebResponse response = request. GetResponse())
    {
    Stream streamResp = response. GetResponseStream();
    StreamReader streamReaderResp = new StreamReader (streamResp);
    strResp = streamReaderResp.ReadToEnd ();
    }
    Return strResp;
    }

    XML file:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < application >
    < FixedCosts >
    < FixedCost id = "1" >
    values <>
    < value >
    < cost > 3.14 < / cost >
    < span id = "1" / >
    < / value >
    < / value >
    < / FixedCost >
    < / FixedCosts >
    < / request >

    Error messages;

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < response xmlns =" http://www.VMware.com/vCenter/chargeback/2.0 "" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " status = "Failure" > ""

    < majorErrorCode error = '500' minorErrorCode = '0' message = "No such method defined or an API call lack of required arguments. / >

    < / answer >

    Please explain what is the problem here... Is the chargeback REST API c# 2.0 support?

    Thank you

    Yale

    Yale,

    I see the following changes are required in the application:

    1. URL is missing, the startTime and endTime, if the end time is not required to send it as -1. For example: http://localhost: 8080/vCenter-CB/api/fixedCost/553/values? startTime = endTime =-1 & 1340130600000
    2. In XML, fixed cost id must be the same as that mentioned in the URL. XML tag is

    Thank you

    Diomande

  • BlackBerry.System.Model return undefined

    Hello

    I have an application based on sencha touch 2.1 and I add the webworks inside lib.

    When I try to get the device model using blackberry.system.model returning undefined.

    But other api such as blackberry.system.softwareVersion, blackberry.system.name, blackberry.connection.type works fine.

    Thank you & best regards

    Arun

    What operating system you test on? The model property is not supported in BlackBerry 10:

    https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.System.html#.model

    However, we have an API community for this here:

    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10/deviceInfo

  • Function return undefined values

    My function returns undefined values. It seems that the return of the function statement is executed before the database is queried and values are assigned to variables. If I do an alert within the loop for () I get the correct values from the database, but these values are not affected before excecuting the return statement function. How can I do this differently?

    function getColumnNames(table){
        var rs1, rs2, rs3, rs4, rs5;
        db.transaction(function (tx) {
            tx.executeSql("SELECT * FROM schema WHERE table_name=?",[table], function(ax, results){
                var size = results.rows.length, i;
                var item;
                for (i = 0; i < size; i++){
                    item = results.rows.item(i);
                    rs1 = item.col1;
                    rs2 = item.col2;
                    rs3 = item.col3;
                    rs4 = item.col4;
                    rs5 = item.col5;
                                    alert(rs1); //correct value is returned here
                }
            });
        });
        return [rs1, rs2, rs3, rs4, rs5];
    }
    

    Hey Fabian,.

    You are quite correct that the return statement is executed before the database returns the results. There are ongoing asynchronous calls. You can set breakpoints in JavaScript code to see what is happening. You can correct the problem by using function callbacks. I edited your code below to use the callback functions - there might be a few typos, but the general approach should be wooded.

    function getColumnNames(table, callback){
        var rs1, rs2, rs3, rs4, rs5;
        db.transaction(function (tx) {
            tx.executeSql("SELECT * FROM schema WHERE table_name=?",[table], function(ax, results){
                var size = results.rows.length, i;
                var item;
                for (i = 0; i < size; i++){
                    item = results.rows.item(i);
                    rs1 = item.col1;
                    rs2 = item.col2;
                    rs3 = item.col3;
                    rs4 = item.col4;
                    rs5 = item.col5;
                        alert(rs5); //correct values are being returned
                    callback([rs1, rs2, rs3, rs4, rs5]);
                }
            });
        });
    }
    
    // example of how to call getColumnNames with callback
    getColumnNames('importantTable', function (result)
    {
        console.log(result);
    });
    
    // alternative version
    function onCallback(result)
    {
        console.log(result);
    }
    
    getColumnNames('importantTable', onCallback);
    

    I hope this helps.

    See you soon,.

    James

  • CPO 3.0 call a REST API

    I try to call a remote REST API that returns a JSON object.

    The call browser API looks like this

    http://IPAM-dev/phpipam/API/?app_id=API&controller=sections&action=read&ID=6

    Returns

    {'success': true, 'data': {'id': '6', 'name': "Telford subnets", 'description': '',' masterSection': '0', 'permissions': "{\"4\":\"1\ ""} strictMode ',' ': '1', 'subnetOrdering': null, 'order': null, "editDate": null, "showVLAN": '0', 'showVRF': '0' "}}

    When I try to use the OPC Web HTTP Request activity it fails with the following error

    Unable to send a content-body with this type of verb.

    I think the problem here is the content type. The default is application/xml; charset = utf - 8 in the activity, I tried to change this text, html and json, but still did not work. I can't let the emty content type in the activity.

    Anyone have any suggestion how to make a REST of CPO call using the activity Web HTTP request

    Try to change GET to POST (in the form of CALL-CPO_REST - RQ.png).  Sends the contents of the body generally requires a POST not a GET.

  • Call a HTTPS API of JSX

    Hello

    I'm calling an HTTP API (which is mine) InDesign. The API returns JSON and are accessible to the public via HTTPS (HTTP does not work!).

    Now, I tried the GetURL function, as described in this blogpost (Rorohiko: GetURLs.jsx - access HTTP content InDesign ExtendScript) and http.get () of has (http: send and receive requests http - has v0.3a documentation)

    With both HTTP method calls work well, but my API requires the call to be over HTTPS and I can't seem to find a way to do it.

    I tried to assign the host for example "Host: myendpoint.com:443" but who doesn't.

    Also, I have no idea what is the culprit. The Socket error (socket.error) is empty and can't seem to find another error reporting facilities.

    I hope that you know what is the problem and how to fix it!

    Thank you

    Zeger

    Just $0.02, but I think that you have found the end of support for the framework HTTP capabilities has.

    The piece of 2 cents, of whatever hard, Adobe API script can make use of other languages with more features, such as COM / VBScript on Windows and AppleScript on OSX. The script API may transfer to these languages in addition (or library c ++) and they can fully manage the request and then need to return data would support the API script. Not for the feint of heart.

    Finally, while it is certainly not the most silky road, you might consider some kind of "power of Attorney", similar to how the CORS is sometimes treated. If you have a script on a web server (any language), say, PHP, you can send an HTTP request to it by specifying the target HTTPS and all other arguments, while PHP then performs the HTTPS request and returns the information back to HTTP. Not elegant, but there are always several ways to handle any situation.

  • Cisco UCS blades ¦ smbiosDump command returns "undefined, but can be defined.

    Hello community.

    I installed ESXi on a series B UCS blade but were unable to enumerate the UUID (set via Service profile) with the... smbiosDump, more than command.

    All other fields back properly for the serial number, etc... but no UUID. UUID returns: "undefined, but can be defined.    Is this a problem of ESXi and UCS?

    (NOTE, with ESX classic, dmidecoe ¦ more command lists the UUID perfectly.)

    Thoughts, comments, suggestions, input welcome.

    Best of all,

    Jason

    of cpaggen: esxcfg-info | grep UUID

  • The caller of the API do not have permission to perform this operation

    I generated an OAuth token and I get the following result every time that I have the query API (either directly or to try it out the tests here: https://secure.na1.echosign.com/public/docs/restapi/v5)

    {
    "message": "the caller of the API need not have permission to perform this operation."
    'code': "PERMISSION_DENIED".
    }


    I checked "on" for each single scope and set the modifier to the account (I also tried to change the group, but that made no difference). The key to OAuth has been authorized by the account used to register for this account of eSign. It is also a developer account, and it's under a user different from what I write under.


    Basically, all I want to do is get the status on all documents and see whether they are signed or not. I don't like that the user has permissions for that.


    Thank you!

    Hello Ollie,

    The error is specific to an API call or is happening with several API calls that you are trying to do with OAuth token? Can you inbox me your email address with which you have created the application API with OAuth?

    Kind regards

    -Usman

  • Re-opening a call using the API (v8)

    Hello world

    How can I re - open a call using the API?

    Klebert

    You can always call ExecuteQuery to execute the query "call to reopen it. Then call the CallForwardInt to get to the correct agent / group which will generate notifications.

  • Symbol "LoseMessage", "Reset_btn", image1, 15 1061 line: call to a method may be undefined

    Hi I have a game set in place, when exhaust you your life it takes you to a screen to lose (symbol), on this screen, I have a button called Reset Game.

    The name of the button is 'Reset_btn '.

    The button instance's "resetbtn".

    I have the code in the symbol, and I get this error:

    Symbol "LoseMessage", "Reset_btn", image1, 15 1061 line: call to a method may be undefined for addEventListener through a reference with static type class.

    Here is my code:

    The button Reset code
    resetbtn.addEventListener (MouseEvent.CLICK, Reset_btn);
    function Reset_btn(event:Event):void
    {
    gotoAndStop (1);
    }


    I gave my button and the instance name and a name for the button, why am I still get this error, can anyone help?

    Casey

    As I mentioned in my last response, this isn't how you assign an instance name to an object.  Delete what you have done for this button in the library.  Select the button on the stage inside the movieclip and in the Panel properties assign it as the instance name where it say .

  • 1180: call to a method may be undefined addFrameScript.

    I have a fla file, it has been linked with external pacakage file this a document class

    It was called by the property inspector. When I try to do a code in the first picture it shows

    This error [1180: call to a method may be undefined addFrameScript.];

    Should I type the code in the time line what should I do?

    pls help me it is too urgent

    Thanks in advance

    You are welcome.

    Please mark this thread as answered, if you can.

  • Error: 1180: call to a method may be undefined application_creationCompleteHandler.

    Hello

    I am currently working on a Flash Catalyst project. The project was works very well (created buttons and assigning everything) and I added a new page and changed my (default state) and then added an interaction to change my status to "start" to my State "world map". I implemented the start state, add transitions and went to test. This error appeared:

    "Flash Catalyst cannot run this project because of an error in the code. To find the error, switch to the workspace Code and look into the Panel of problems. »

    Under the workspace of code, this is the error:

    Description: 1180: call to a method may be undefined application_creationCompleteHandler.

    Resources: Main.mxml

    Path: project/src

    Location: line 2

    Type: Flex problem

    It is located at the end of line 2 after the size of the width. I noticed other projects flash catalyst I did do not have this bit of coding on it.

    creationComplete = "application_creationCompleteHandler ()" "

    I tried to come back, removal of the "getting started" page, I added and trying to revive the project and the same error is there. I also tried to publish the project and that gives me the same error and only produced a few files in the folder "deploy-to-web", but several files missing.

    In the workspace 'code' you cannot change the code at all (so this workspace is not useful outside the preview of the code).

    I have to just restart my project or is it repairable? How can I avoid this error in the future? I tried to reproduce this problem by adding the same page 'start-up' to another similar document and it worked perfectly, and this error has not been created.

    Thanks for any help,

    Timothy Whalin

    This problem is caused by an underlying bug in the catalyst. But you may be able to fix your project as follows:

    1. Add one to start the Application > interaction play Action Sequence
    2. Delete the above interaction
    3. Add a new page/state
    4. Add one to start the Application > play Transition to [State]

    Maybe it's enough to get your project into a viable State.

    -Bear

  • Cannot call a Javascript API of Blackberry to a Web application hosted on a Tomcat server.

    Hi all, I have been using Web work for development. I was able to build a webworks with HTML application, which in turn calls blackberry API using Javascript. However, when I move the HTML to a web application in a tomcat server, and calling the WebApp page from the WebWorks shell with all the permissions granted, I get an error TypeError: cannot convert 'undefined' in an object... Please advice if I am attemping is technically possible, or webworks serves only to write a native application using HTML hosted in blackberry.

    If you host content from a remote domain requiring API access, you need to declare explicitly in the config.

    You will need to create a piece of access as follows:

    http://tx8zdflb30.xxxxx.com:8003" subdomains="true">
    
    
    

    And then you add the elements of functionality for each of the APIs you want than this field/origin to have access to.

  • Is there an API that returns the model number or any other identifier for a module installed, I can use to identify the characteristics of this module?

    For example, I'll call you

    DaqSystem.Local.GetPhysicalChannels (PhysicalChannelTypes.AI, PhysicalChannelAccess.External)

    For a list of connected devices.  The data in the table back looks like this:

    cDAQ1Mod4/ai0 (etc.)

    It tells me that I have a CompactDAQ chassis, which is good, and an analog module in the slot Module4.  What I need to know is not just that there is an analog module in the slot to #4, but also of its ability (voltage, temperature, voltage, etc.) so that I can use the correct DAQmx task for this type of module.  All this has to be discovered during execution.

    Otherwise, I'll have to provide a configuration utility when the user program needs to determine which module is plugged that slot - and will it change by moving it to another location, you must enter these details again.  I want to avoid this by making the material more discoverable as possible.

    I can remember an API - and that is my hope.

    * beep *.

    Hello

    I could understand the syntax for you. It's here.

    Device blah = DaqSystem.Local.LoadDevice ("cDAQ1");
    foreach (String dev in bla. ChassisModuleDeviceNames)
    {
    Label1. Text += "\n" + DaqSystem.Local.LoadDevice (dev). ProductType;
    }

    This displays the model number of all modules of the cDAQ in the chassi. I hope this helps.

    Kind regards

    Perry S.

  • BPS API to return to the charging source

    Hello Guyz is there any API BPS to return the value of loader Type means that the load is loading USB or Charger taken

    Yes, search for the function battery_info_get_charger_name() in battery.h BPS. Here are all the battery.h functions available:
    https://developer.BlackBerry.com/native/reference/core/com.QNX.doc.bps.lib_ref/topic/manual/battery...

    This is the name of shipper returned:
    Not connected: "none."
    Wall charger: "USB DCP.
    USB in the desktop: "USB Host".

    There are probably other values, but I don't have the time to test it yet. You can quickly get a peek at all the values accessible in battery.h by entering this url in your mobile browser:
    file:///PPS/system/BattMgr/status

    Don't forget to refresh the page when you plug / unplug to see the new State, the name of the shipper is somewhere near the end of the file.

Maybe you are looking for

  • Palm Treo 300

    So I found a palm treo 300 in a thrift store and bought for like $ 7. After popping open the case and hanging on to an old charger electric razor, got to work. I installed the synchronization program on my computer, put everything in place and works.

  • Storage of ThinkPad Twist

    Hello! This will be like a silly question, but I can't answer on my own, so I thought I would ask here. My company has just purchased a Lenovo's ThinkPad Twist for me (I'm a big fan of Lenovo). I'm just trying to give a sense specifications for stora

  • Programs open slowly.

    Nearly every program that I run takes 30 seconds. 2 min. to initiate. After instructor, everything works fine.  I don't think that it is a problem of computer performance.  I have an AMD Athlon 64 X 2 Dual Core Processor 3600 + with 3 GB of RAM.  Eve

  • BlackBerry smartphones, I just received new Torch 9850 my wife but I want it to try it before you activate

    I don't know about airplane mode, but apparently I can only put it on when it is started again? So he could get on the network and disable his old phone? Safe mode puts the phone in airplane mode? Thanks, I actually got myself a too, but it's going t

  • What does FMCopyApplication.exe do?

    Hi all..What does FMCopyApplication.exe do? and how its diff of LCM.