How to grab the view that comes from Onyx?

Hello,
  i started using Onyx project recently. That's really amazing what it does. I am wondering if there is some possibility to check the main view ... let my try to explain this.
I want to change option for esxi5 box - advanced/Logging to external syslog server.
While in gui i did my steps and Onyx prints the output:
# ------- UpdateOptions -------
$changedValue = New-Object VMware.Vim.OptionValue[] (1)
$changedValue[0] = New-Object VMware.Vim.OptionValue
$changedValue[0].key = "Syslog.global.logHost"
$changedValue[0].value = "tcp://x.x.x.x:514"
$_this = Get-View -Id 'OptionManager-EsxHostAdvSettings-456'
$_this.UpdateOptions($changedValue)
This is working as expected. I can throw this to powercli and it will set up the option. This will work only for that particular esxi box. I want to create a loop that will change this option for each esxi box in the cluster.
The view that onyx is using is : "Get-View -Id 'OptionManager-EsxHostAdvSettings-456'"
So he already knows the view/host moref .
But if i would like to have this in a loop so it will do it for each host, so  how can i get to that kind of view ?
So far i could only build something like
foreach($vmhostview in (get-view -viewtype HostSystem -Searchroot (get-cluster "xxyyzz").id))
$changedValue = New-Object VMware.Vim.OptionValue[] (1)
$changedValue[0] = New-Object VMware.Vim.OptionValue
$changedValue[0].key = "Syslog.global.logHost"
$changedValue[0].value = "tcp://x.x.x.x:514"
$number=$vmhostview.moref.split("-")[1]
$_this = Get-View -Id OptionManager-EsxHostAdvSettings-$number
$_this.UpdateOptions($changedValue)
Which is totally stupid approach i belive although it's working.. splitting moref...
After some time i noticed that
http://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.option.OptionManager.html
Says that OptionManager is the property from Config manager. So from that i could get the id of this view:
((get-vmhost myHost |get-view).ConfigManager.AdvancedOption).ToString()
which will result in output : OptionManager-EsxHostAdvSettings-456
So having this i could do my loop at the end:
foreach($vmhostview in (get-view -viewtype HostSystem -Searchroot (get-cluster "xxyyzz").id))
$changedValue = New-Object VMware.Vim.OptionValue[] (1)
$changedValue[0] = New-Object VMware.Vim.OptionValue
$changedValue[0].key = "Syslog.global.logHost"
$changedValue[0].value = "tcp://x.x.x.x:514"
$_this = Get-View -Id ($vmhostview.ConfigManager.AdvancedOption).ToString()
$_this.UpdateOptions($changedValue)
Now i do not know that it was just a luck that i found the location of this view name or is this the way how i am supposed to find the view id name. I am wondering how other people are handling that kind of case, if there is easier way to do it. If someone could share his experience i would really appreciate it.
Regards,
Greg

There is no need to construct these View-Ids as you see them coming from Onyx.
In fact I would write that script like this
$changedValue = New-Object VMware.Vim.OptionValue[] (1)
$changedValue[0] = New-Object VMware.Vim.OptionValue
$changedValue[0].key = "Syslog.global.logHost"
$changedValue[0].value = "tcp://x.x.x.x:514"
Get-View -ViewType HostSystem -Searchroot (Get-Cluster "xxyyzz").ExtensionData.MoRef | %{
  $optMgr = Get-View $_.ConfigManager.AdvancedOption
  $optMgr.UpdateOptions($changedValue)
Move the part that doesn't change with each HostSystem outside the loop
The ConfigManager is an array with MoRefs that point to the respective Managers. You can just do a Get-View with a MoRef and it will return the object representing the Manager
From the Manager object you can now call the method
Btw, you better consult the latest SDK Reference.
You can find the HostConfigManager here.

Similar Messages

  • How to track the URL that comes from a referred page using XSQL Custom Handler

    Hi,
    I have a cold fusion page(say cf.cfm) that sent a request to xsql page(say test.xsql) and then xsql page displays results. I want to capure the URL of cf.cfm page and then after checking its host name and path name for correctness then want to display the test.xsql results.
    Please let me know how can I capture URL of the refered page(cf.cfm) in the Custom Handler and then I want to extract host-name and path-name out of that url and on the basis of their values I want to display the result of XSQL page(test.xsql).
    Regards
    a2012

    req.getHeader("Referer") will return the referring url

  • How to find the file that delete from time capsule?

    How to find the file that delete from time capsule?

    I mean I saved JPEG file in Time capsule and unfortunately delete the file. Can I get it back
    IF.... .no other backups have occured since you deleted the file, you might be able to retrieve it using an application like Disk Warrior. It's about $100 as I recall, and there are no guarantees that it will work.
    DiskWarrior 4 - The Disk Utility for Mac  Disk Repair, Mac Directory ...
    Any of the free or low priced utilities that you might see or try will not be able to retrieve a deleted file from a Time Capsule.
    If any backups have occured since you deleted the file, the deleted file has almost certainly been overwritten. No way to retrieve it in that case.

  • How to delete the list that comes up in Open Recent

    I apologize because I know this has been answered before, but I cannot find the answer after quite a bit of searching in the forum. I'd like to delete the list that comes up when I choose File/Open Recent and I can't remember how to do that. Could someone please tell me? Thanks.

    *Click the (empty) input field on the web page to open the drop down list
    *Highlight an entry in the drop down list
    *Press the Delete key (on Mac: Shift+Delete) to remove it.
    *http://kb.mozillazine.org/Deleting_autocomplete_entries
    *http://kb.mozillazine.org/Password_Manager

  • How to get the view link definition from the view link accessor

    Hi,
    I am using Jdev 10.1.3 and ADF BC. I am trying to do deep copy in a master/details view, after the new child record is created, I want to update the foreign key attribute. I know I can get the list of attribute definitions from the row in the view object, which include the view link accessors, I am wondering if I can get the view link definition from the view link accessors, so that I can get the source and destination attribute names.
    Thanks!

    Hi,
    you should get this through
    ViewObject vo = this.findViewObject("LocationsView1");
    int indx = vo.getAttributeIndexOf("DepartmentsView");
    ViewAttributeDefImpl vAttrDefImpl = (ViewAttributeDefImpl) vo.getAttributeDef(indx);
    ViewLinkDefImpl vdefImpl = (ViewLinkDefImpl) vAttrDefImpl.findViewLinkDefImpl();
    Note that this code starts from the ApplicationModuleImpl class, which is why I used this.findViewObject().
    Frank

  • How long is the charger that comes in the box?

    I'm going to get an iPad 2 and I am going to get an adapter for the charger, but I wanted to know how long the charger that comes in the box so I know if I should get the little box adapter or the six-foot long adapter.

    Sorry, misunderstood
    Yes the cable is 1m long. And if its a charger itself it should work fine
    Jason

  • How do I convert ip that comes from the user in String as an argument to...

    InetAddress style?
    Thanks,
    Amir

    Depending on the format that your user types in, you could use InetAddress.getByName(userInput)
    Good Luck
    Lee

  • WPF: How to know the selection is come from datagrid or from ListBox?

    Our application has a page which includes DataGrid and ListBox.
    Both ItemSource are binding to PlateCells.
    public ObservableCollection<CellVM> PlateCells
    public class CellVM : BaseViewModel
    public CellVM(int wellNumber)
    WellNumber = wellNumber;
    Row = wellNumber / define.NumberofWellsInRow;
    Col = wellNumber % define.NumberofWellsInRow;
    // row and col are 0-based
    public int WellNumber { get; set; }
    public int Row { get; set; }
    public int Col { get; set; }
    bool _isSelected;
    public bool IsSelected
    get { return _isSelected; }
    set
    _isSelected = value;
    OnPropertyChanged("IsSelected");
    string _sampleId;
    public string SampleId
    { get { return _sampleId; }
    set
    _sampleId = value;
    OnPropertyChanged("SampleId");
    when a cell is selected, the cell will be highlight in both DataGrid and ListBox.
    We also implement SelectAll button for both DataGrid and ListBox.
    And SelectAll is ToggleButton. First time click is select All cells and second time click, it will unselect All cells.
    What we notice when SelectAll button is click, all cells in both DataGrid and List box  are highlight.
    After that click on a grid any cell, all cells becomes unselected in both DataGrid and ListBox.
     We assume this the behavior from DataGrid, after click SelectAll and click any cell in DataGrid will remove all selection and only highlight one cell in the datagrid.
    However, this is behavior does not happen in ListBox. click any cell in ListBox only unselect that cell and not unselect all cells.
    So we need to know click(selection) is coming from DataGrid or ListBox and take different actions.
    How do we know the click is coming from DataGrid or ListBox? Thx!
    JaneC

    >>How do we know the click is coming from DataGrid or ListBox? Thx!
    It depends on where in the code you want to be able to determine this. In the view model class you cannot really know if the user clicked in the ListBox or in the DataGrid because the view model knows nothing (and shouldn't know either) about any of these
    controls. It only exposes a property that may be set from anywhere.
    Handling the GotFocus event for any or each of the controls seems to be a good solution because then you can take the appropriate action depending on which control was focused/clicked.
    You could of course move the code that is being executed when the GotFocus event occurs, i.e. the code in your event handler, from the code-behind of the view to the view model class by using a command in the view model class and then hook up the GotFocus
    event to this command using event triggers:
    <DataGrid>
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="GotFocus" >
    <i:InvokeCommandAction Command="{Binding YourCommand}" />
    </i:EventTrigger>
    </i:Interaction.Triggers>
    </DataGrid>
    How to do this is a topic of its own though. Please refer to my blog post about how to handle events in MVVM for more information:
    http://blog.magnusmontin.net/2013/06/30/handling-events-in-an-mvvm-wpf-application/. You will need to reference an assembly that is part of the Expression Blend SDK which you can download from here:
    http://www.microsoft.com/en-us/download/details.aspx?id=10801.
    Anyway, as mentioned, handling the GotFocus event seems like a good idea here since you cannot determine which control that was clicked in the setter of the source property in the view model class.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • How to install the JRE that comes with JME 3.0 to a Windows Mobile device

    From Sun's JME download page:
    Integration with 3rd party emulators and Windows Mobile devices
    The new Java ME Platform SDK architecture allows integration of 3rd party emulators and devices. Java ME Platform SDK comes with Sun's Java runtime environment for Windows Mobile. A user can install this runtime on a Windows Mobile device or a Microsoft device emulator and experience all the on-device features of Java ME Platform SDK.*
    My question is, how can I install the Java runtime environment that comes with Java ME Platform SDK 3.0 to a Windows Mobile device. I am a newbie in this device programming and I'm setting up my development environment. So far, I have installed JME in my computer, and have also installed both the Windows Mobile 5 and Windows Mobile 6 emulator. I've been searching the internet for answers, but it always points me to using a third party java runtime such us Mysaifu, etc. I would like to stick with what is packaged with JME if possible.
    If anybody assist me or direct me to an online documentation on how to do this. All help is greatly appreciated :-)

    I had some success installing on a real Mobile 5 device [http://forums.sun.com/thread.jspa?threadID=5344195]
    There is a link to a doc on the main download page, item 5 under How to Install. [http://java.sun.com/javame/downloads/sdk30ea.jsp] I used this for the real device, Treo 700w. Did not try it with an emulator.
    The support looks to be an emulator rather than a JVM per say. But then again I could be wrong on that. I too had poked around looking for a JVM, CrEme, J9, etc..
    I do have a commercial app installed on the Treo that uses IBM's J9, which is seems requires a contact with a sales person to get ahold of. I had hoped to find something that might clue me in on how to "hook up" my own J2ME app with the J9 installed by the commercial package. But I've pretty much decided to get a real J2ME handset rather than continue to waste my time hacking up something with WM. Now the question is which one makes a good reference platform?

  • How to install the fonts that come standard in other environments

    I am new to archlinux. I've used Fedora and Ubuntu before. I have a fresh install and it runs smooth. I like it a lot. There are a few things I need to work out. The thing I'd like to do at the moment is to get the fonts that other desktop environments use. Right now I am using LXDM+LXDE. I just want the standard fonts that I had before but I want to stick with LXDE. Things start look really ugly quickly in programs like skype. What is the best way to do this?
    http://s13.postimg.org/unodh3wrb/2014_0 … _scrot.png
    -- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

    Please mark solved threads as solved (https://wiki.archlinux.org/index.php/Fo … ow_to_Post).

  • How to use the headset that comes in the box with ...

    Hi. I just got the nokia 5800 XM as a gift. It contained a headset in the box, that could be connected to the phone on one side, and to the earphones on the other side. However, when i'm connecting it to the phone, i'm not getting any indication on the phone display that a headset is connected, and if i get a phone call it doesn't go through the headset.
    I noticed that when i connect the earphones directly to the phone, the phone asks me to specify what they are (headphones, lineout tv-out cable, music stand). but when i connect the headset, it doesn't ask me that. Does this mean that hte headset itself is damaged?
    Thanks.

    I had a similar issue.  All music played through the headset and during phone calls the mic worked but could not hear the person talking through the earphones, this just went through the phone.  Plugged and unplugged the headset numerous times, checked all settings, did everything I could that seemed related and it made no difference.
    With all this playing around the phone's battery went flat and the phone switched off.  Plugged the phone into a charger and when I switched it on the headset miraculously worked perfectly.  It still does some strange things occasionally.  When listening to music the call answer button on the little control box sometimes doesn't work...and no the key lock isn't on!
    When it works, the headset is great, but it's a similar experience to all Nokia headsets and car kits I have owned in the past, a bit flakey and tend to lock up at times.

  • How to hyper link the text that comes from database ?

    Hi all,
    Jdev Ver :11.1.1.4.0
    I have one usecase like, to highlight(using af:commandlink) the keywords from some content..
    And i have some set of keywords, and where ever the keywords appears in the content i need to show those words as a af:commandlink in the page ..
    Anyone aware of this kind of usecase ? Please suggest some ideas..
    thanks,
    Gopinath J

    Hi,
    It is not straight forward, here is the sample code to do that where i replaced the text key with the hyperlink and bounded it to outputText
        <af:outputText value="#{<Bean>.text}" escape="false"/>
        //variable text inside bean with setters and getters
        private String text = "This is a sample text where the text key is shown as hyperlink";
        public void setText(String text) {
            this.text = text;
        //replaces the text "key" references with the hyperlink
        public String getText() {
            text = text.replace("key","<a href=\"http://google.com\">key</a>"); //escape sequence the quote to provide value for href
            return text;
        }Sireesha

  • How come all my email that comes from facebook comes with the same from name

    All e-mail that comes from my facebook has the same from name like sandy wenfel when its from my mother,wife,friend ect.
    What did i do and how do i fix it

    Airmail you my friend are a Genius.
    I've been living with that nightmare for months, and you fixed it in seconds.
    I should have asked this question here a long time ago. Thank You Kevin (AKA)''Teeter-Kick-Azz [[#question-1056669|said]]''
    <blockquote>
    All e-mail that comes from my facebook has the same from name like sandy wenfel when its from my mother,wife,friend ect.
    What did i do and how do i fix it
    </blockquote>

  • I lost my logic 8 pro serial number. I can't find the booklet that comes with the serial number. How can retrieve this? I upgraded from logic pro 7. I changed hard drives and now it keeps asking for the serial number. But I can't find it. Where can I requ

    I lost my logic 8 pro serial number. I can't find the booklet that comes with the serial number. How can retrieve this? I upgraded from logic pro 7. I changed hard drives and now it keeps asking for the serial number. But I can't find it. Where can I request it? Thanks!

    If you still have the receipt or other proof of purchase, you can ask Apple to send you the serial. Otherwise, bad luck mate.. Good news is, you can now buy Logic Pro 9 from App Store for just 199 USD

  • Hi, i am trying to open and view a report that comes from another server with different odbc connection

    hi, i am trying to open and view a report that comes from another server with different odbc connection
    i created a crystal report for a mysql database on my machine and everything works great
    but we have other reports that come from other machines with different odbc connection
    and this its not working when opens the report asks for credentials
    and i cannot use the remote ip for these reports that come from other machine
    question
    if i cannot connect to remote ip to open the report
    for each report i have to create a database the report database on my machine and then open the report ?
    or there is some other way to open the report ?
    i am using visual studio 2013 and mysql and
       <add key="MYSQLODBCDRIVER" value="{MySQL ODBC 5.3 UNICODE Driver}"/>
    thanks

    short
    i have a report that it was created on another server with a specific dsn
    now i am trying to open the report on my machine
    the database from the other server does not exist on my machine
    the server machine where the report was created the ip its not accessible
    question ?
    can i open the report on my machine or its impossible ?
    thanks

Maybe you are looking for