VMWare Orchestrator Presentation via vSphere - action

I working on a VM-deployment-automation project. My problem is difference of input screens between vSphere Web Client and vCO Desktop Client. Sorry my English but I have 2 screenshots about this issue:
vCenter Orchestrator
vSphere Web Client
Words are not important (they are Turkish words). First area is operating system area and the second area is os version area.
Example: if first area is "Linux", then second area is dropdown list of Linux distributions. And I use an action has script like this:
if (ostype == "Windows") {
return ["Windows 2012 R2 Standard", "Windows 10", ...];
}
else if (ostype == "Linux") {
return ["RedHat", "Suse", "Ubuntu", ...];
}
else {
throw "Unknown OS type";
}
My main problem is in vSphere client. Because the version action is not working in vSphere and vSphere presents the version area as a text-box. I want present this area as a dropdown list or something like this.

I think so there is a bug about this. "Default value" option is fixes this bug. But this time we cannot use variable in presentation comment area. If it is not important, we can use "default value" option.

Related

Open a c++ application installed on computer with a custom url in browser [duplicate]

How do i set up a custom protocol handler in chrome? Something like:
myprotocol://testfile
I would need this to send a request to http://example.com?query=testfile, then send the httpresponse to my extension.
The following method registers an application to a URI Scheme. So, you can use mycustproto: in your HTML code to trigger a local application. It works on a Google Chrome Version 51.0.2704.79 m (64-bit).
I mainly used this method for printing document silently without the print dialog popping up. The result is pretty good and is a seamless solution to integrate the external application with the browser.
HTML code (simple):
Click Me
HTML code (alternative):
<input id="DealerName" />
<button id="PrintBtn"></button>
$('#PrintBtn').on('click', function(event){
event.preventDefault();
window.location.href = 'mycustproto:dealer ' + $('#DealerName').val();
});
URI Scheme will look like this:
You can create the URI Scheme manually in registry, or run the "mycustproto.reg" file (see below).
HKEY_CURRENT_USER\Software\Classes
mycustproto
(Default) = "URL:MyCustProto Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "myprogram.exe,1"
shell
open
command
(Default) = "C:\Program Files\MyProgram\myprogram.exe" "%1"
mycustproto.reg example:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\mycustproto]
"URL Protocol"="\"\""
#="\"URL:MyCustProto Protocol\""
[HKEY_CURRENT_USER\Software\Classes\mycustproto\DefaultIcon]
#="\"mycustproto.exe,1\""
[HKEY_CURRENT_USER\Software\Classes\mycustproto\shell]
[HKEY_CURRENT_USER\Software\Classes\mycustproto\shell\open]
[HKEY_CURRENT_USER\Software\Classes\mycustproto\shell\open\command]
#="\"C:\\Program Files\\MyProgram\\myprogram.exe\" \"%1\""
C# console application - myprogram.exe:
using System;
using System.Collections.Generic;
using System.Text;
namespace myprogram
{
class Program
{
static string ProcessInput(string s)
{
// TODO Verify and validate the input
// string as appropriate for your application.
return s;
}
static void Main(string[] args)
{
Console.WriteLine("Raw command-line: \n\t" + Environment.CommandLine);
Console.WriteLine("\n\nArguments:\n");
foreach (string s in args)
{
Console.WriteLine("\t" + ProcessInput(s));
}
Console.WriteLine("\nPress any key to continue...");
Console.ReadKey();
}
}
}
Try to run the program first to make sure the program has been placed in the correct path:
cmd> "C:\Program Files\MyProgram\myprogram.exe" "mycustproto:Hello World"
Click the link on your HTML page:
You will see a warning window popup for the first time.
To reset the external protocol handler setting in Chrome:
If you have ever accepted the custom protocol in Chrome and would like to reset the setting, do this (currently, there is no UI in Chrome to change the setting):
Edit "Local State" this file under this path:
C:\Users\Username\AppData\Local\Google\Chrome\User Data\
or Simply go to:
%USERPROFILE%\AppData\Local\Google\Chrome\User Data\
Then, search for this string: protocol_handler
You will see the custom protocol from there.
Note: Please close your Google Chrome before editing the file. Otherwise, the change you have made will be overwritten by Chrome.
Reference:
https://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx
Chrome 13 now supports the navigator.registerProtocolHandler API. For example,
navigator.registerProtocolHandler(
'web+custom', 'http://example.com/rph?q=%s', 'My App');
Note that your protocol name has to start with web+, with a few exceptions for common ones (like mailto, etc). For more details, see: http://updates.html5rocks.com/2011/06/Registering-a-custom-protocol-handler
This question is old now, but there's been a recent update to Chrome (at least where packaged apps are concerned)...
http://developer.chrome.com/apps/manifest/url_handlers
and
https://github.com/GoogleChrome/chrome-extensions-samples/blob/e716678b67fd30a5876a552b9665e9f847d6d84b/apps/samples/url-handler/README.md
It allows you to register a handler for a URL (as long as you own it). Sadly no myprotocol:// but at least you can do http://myprotocol.mysite.com and can create a webpage there that points people to the app in the app store.
This is how I did it. Your app would need to install a few reg keys on installation, then in any browser you can just link to foo:\anythingHere.txt and it will open your app and pass it that value.
This is not my code, just something I found on the web when searching the same question. Just change all "foo" in the text below to the protocol name you want and change the path to your exe as well.
(put this in to a text file as save as foo.reg on your desktop, then double click it to install the keys)
-----Below this line goes into the .reg file (NOT including this line)------
REGEDIT4
[HKEY_CLASSES_ROOT\foo]
#="URL:foo Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\foo\shell]
[HKEY_CLASSES_ROOT\foo\shell\open]
[HKEY_CLASSES_ROOT\foo\shell\open\command]
#="\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%1\""
Not sure whether this is the right place for my answer, but as I found very few helpful threads and this was one of them, I am posting my solution here.
Problem: I wanted Linux Mint 19.2 Cinnamon to open Evolution when clicking on mailto links in Chromium. Gmail was registered as default handler in chrome://settings/handlers and I could not choose any other handler.
Solution:
Use the xdg-settings in the console
xdg-settings set default-url-scheme-handler mailto org.gnome.Evolution.desktop
Solution was found here https://alt.os.linux.ubuntu.narkive.com/U3Gy7inF/kubuntu-mailto-links-in-chrome-doesn-t-open-evolution and adapted for my case.
I've found the solution by Jun Hsieh and MuffinMan generally works when it comes to clicking links on pages in Chrome or pasting into the URL bar, but it doesn't seem to work in a specific case of passing the string on the command line.
For example, both of the following commands open a blank Chrome window which then does nothing.
"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "foo://C:/test.txt"
"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window "foo://C:/test.txt"
For comparison, feeding Chrome an http or https URL with either of these commands causes the web page to be opened.
This became apparent because one of our customers reported that clicking links for our product from a PDF being displayed within Adobe Reader fails to invoke our product when Chrome is the default browser. (It works fine with MSIE and Firefox as default, but not when either Chrome or Edge are default.)
I'm guessing that instead of just telling Windows to invoke the URL and letting Windows figure things out, the Adobe product is finding the default browser, which is Chrome in this case, and then passing the URL on the command line.
I'd be interested if anyone knows of Chrome security or other settings which might be relevant here so that Chrome will fully handle a protocol handler, even if it's provided via the command line. I've been looking but so far haven't found anything.
I've been testing this against Chrome 88.0.4324.182.
open
C:\Users\<Username>\AppData\Local\Google\Chrome\User Data\Default
open Preferences then search for excluded_schemes you will find it in 'protocol_handler' delete this excluded scheme(s) to reset chrome to open url with default application

Different behavior of EnableStatic on Windows Server 2016

I wrote C++ program running on 2 cluster nodes which should add \ remove a virtual IP from the network card on each node (following some logic I've wrote..).
For that, I use EnableStatic method of the Win32_NetworkAdapterConfiguration class (https://msdn.microsoft.com/en-us/library/aa390383(v=vs.85).aspx).
On that program I have 2 buttons, "Release VIP" and "Acquire VIP".
I use RDP to connect these nodes (using the permanent IP, not the VIP).
For Release VIP I call: EnableStatic({ "1.1.1.5" }, { "255.255.0.0" });
For Acquire VIP I call: EnableStatic({ "1.1.1.5", "1.1.1.80" }, { "255.255.0.0", "255.255.0.0" });
(For this example 1.1.1.80 is the VIP)
When I did it on Windows 2012 everything worked fine and I was able to add \ remove the virtual IP.
Now, on Windows 2016, my RDP is losing connection for 2-3 seconds as a result of the change in the VIP on the network card (both add and remove..).
I know that in this API documentation Microsoft wrote that RDP should lose connection but I wonder:
Why it didn't happened in Windows 2012?
Did they made any change?
Maybe I do something wrong?
And more important:
Does it have other effect except the RDP losing connection that I should know of??
Is there a better API to use?
Thanks a lot!

WlanHostedNetworkStartUsing or how windows 10 builtin mobile hotspot works

I'm trying to write a program which creates hotspot. I'm using WlanHostedNetworkStartUsing but it returns ERROR_INVALID_STATE. And yet when I call WlanHostedNetworkInitSettings it returns succsess. According to documemtation (last paragraph in Remarks section) it should to create a virtual wireless connection under Control Panel\Network and Internet\Network and Sharing Center but it doesn't.
I've searching a bit and found this:
When I run netsh wlan show drivers it puts:
Driver : Intel(R) Dual Band Wireless-AC 3165
Vendor : Intel Corporation
Provider : Intel
Date : 07-Sep-16
Version : 19.20.0.6
INF file : ????
Type : Native Wi-Fi Driver
Radio types supported : 802.11b 802.11g 802.11n 802.11a 802.11ac
/ ...
Hosted network supported : No <--- Here
/ ...
So it says my wifi adapter doesn't wifi sharing at all (I have last drivers from HP site).
BUT when I try to create hotspot with Windows 10 builtin' tool it works.
The question: How could windows tool do it and how can I use this mechanism in my app?
Original 06/06/2018 comments here (see updates below):
Microsoft deprecated the WLAN HostedNetwork capability and it is NOT
available for Win10 drivers. To use the old model in Win10 you must
find and install drivers from 2015 (8.1 or possibly earlier depending
on vendor).
The Win10 driver model changed the mechanism of HostedNetwork to be
based on WiFi Direct, and took control away from app-developers and
moved this feature to the kernel. There are some samples available if
you dig around, that show how to use the modern-com (RT) UWP app
libraries to configure a WiFi Direct HostedNetwork. It is a PITA,
which was not explained by Microsoft, is not understood by most people
commenting on this in the web, and which mostly looks like a two-step
microsoft failure where product features were cut to make ship
schedule and re-orgs among teams changed the ownership and plan for
WiFi and hotspots. WiFi direct enables - theoretically - a simpler
pairing and authentication model between devices. But the currently
implementation involves bluetooth and therefore it is questionable
other than support a limited mobile device WiFi 2.0 scenario. If you
are working with headless devices or IoT device scenarios this is
broken.
I've had to do a lot of work in this area. If you have a choice in
WiFi hardware, I strongly recommend a hardware chipset that uses the
Intel drivers (they are solid).
You may find this App store app helpful if your scenario allows for UX
interaction.
http://www.topuwp.com/windowsapps/wifi-direct-access-point/598084.html
====================
02/27/2020 Update to that story...
When Hosted network supported : No then legacy hosted network support is not available on your adapter because you have WiFi Direct in Windows 10 etc. In which case you'll want to know and use this very sparsely commented on supported portion of WiFi Direct:
https://learn.microsoft.com/en-us/uwp/api/windows.networking.networkoperators.networkoperatortetheringmanager.createfromconnectionprofile
Command Line to HotSpot settings: start ms-settings:network-mobilehotspot
Article that talks about PowerShell programmatic access to the WinRT HotSpot APIs
enable Win10 inbuild hotspot by cmd/batch/powershell
KEYWORDS: "Virtual Wi-Fi", SoftAP, AdHoc IBSS, MobileHotSpot, netsh wlan HostedNetwork
====================
Which would not be complete without a working C++/WinRT code sample as follows:
#include <winrt/Windows.Networking.Connectivity.h>
#include <winrt/Windows.Networking.NetworkOperators.h>
#include <winrt/Windows.Devices.WiFiDirect.h>
#include <winrt/Windows.Security.Credentials.h>
namespace winrt { // /ZW embed in :<winrt> when `Windows` is ambiguously defined
static void af_winrt_wifi_hotspot_test() {
// start ms-settings:network-mobilehotspot
init_apartment(); // apartment_type::multi_threaded
if (false /* play as you wish to test this all in simple c++ console app, I used clang */) {
auto publisher = Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher();
auto advertisement = publisher.Advertisement();
advertisement.ListenStateDiscoverability(Windows::Devices::WiFiDirect::WiFiDirectAdvertisementListenStateDiscoverability::Intensive);
advertisement.IsAutonomousGroupOwnerEnabled(true);
auto legacySettings = advertisement.LegacySettings();
legacySettings.IsEnabled(true);
legacySettings.Ssid(L"your-hotspot-name");
auto credential = Windows::Security::Credentials::PasswordCredential(); credential.Password(L"the-password!");
legacySettings.Passphrase(credential);
publisher.Start();
}
else {
auto connectionProfile{ Windows::Networking::Connectivity::NetworkInformation::GetInternetConnectionProfile() };
auto tetheringManager = Windows::Networking::NetworkOperators::NetworkOperatorTetheringManager::CreateFromConnectionProfile(connectionProfile);
auto credential = Windows::Security::Credentials::PasswordCredential(); credential.Password(L"the-password!");
auto conf = Windows::Networking::NetworkOperators::NetworkOperatorTetheringAccessPointConfiguration();
conf.Ssid(L"I-Own-You"); conf.Passphrase(credential.Password());
auto oldConf = tetheringManager.GetCurrentAccessPointConfiguration();
auto oldSsid = oldConf.Ssid(); auto oldPwd = oldConf.Passphrase();
tetheringManager.ConfigureAccessPointAsync(conf); // Sets new ssid/pwd here
switch (tetheringManager.TetheringOperationalState()) {
case Windows::Networking::NetworkOperators::TetheringOperationalState::Off: {
auto ioAsync = tetheringManager.StartTetheringAsync();
auto fResult = ioAsync.get();
}
break;
case Windows::Networking::NetworkOperators::TetheringOperationalState::On: {
// auto ioAsync = tetheringManager.StopTetheringAsync();
// auto fResult = ioAsync.get();
}
break;
case Windows::Networking::NetworkOperators::TetheringOperationalState::InTransition:
default:
break;
}
}
clear_factory_cache();
uninit_apartment();
}
}
Look here for older Microsoft Samples relating to WiFiDirectAdvertisementPublisher:
C++ WiFiDirectLegacyAPDemo_v1.0.zip on Microsoft Page
C# Microsoft IoT Sample OnboardingAccessPoint.cs on GitHub Page
mobile broadband networks, use IMbnConnectionProfileManager::CreateConnectionProfile
Wi-Fi networks, use WlanSetProfile function
Mobile Hotspot XML WFD_GROUP_OWNER_PROFILE profile is in this dir-path: C:\ProgramData\Microsoft\Wlansvc\Profiles\Interfaces\
So many articles on the web, so much confusion created by WiFi-Direct.
I've spent two whole days figuring it all out. Which, for my time, is a lot.
No excuse for Microsoft (where I use to work as an Architect) not having created a Blog about this very popular topic. Let alone simply having made netsh and Ad Hoc Wifi compat support, instead of leaving it so cryptic and confusing for devops, end-users, and developers.
-- enjoy David
The above is pretty concise, and exposes working c++/WinRT code for all scenarios.
[I now have this bundled in EdgeS: EdgeShell/EdgeScript/afm-scm toolset]
[]5
Your computer does not support hosted network.
Because of that, this won't work.
Open command prompt as admin and try these commands:
netsh wlan set hostednetwork mode=allow ssid=“OSToto Hotspot” key=“12345678”
The ssid is the name of your network and the key is the password. You can name them like the above command.
Then run:
netsh wlan start hostednetwork
Rest before saying anything else, I would like to got through your source code.

Issue with CQN registration getting dropped implictly

Using custom C++ OCI wrappers, I can successful register a CQN C++ callback-based registration, but it appears that somehow the subscription is dropped right away, behind my back. I get no call back on simple DMLs. If I try to unregister that subscription, for which register() worked just fine, I get ORA-29970: Specified registration id does not exist.
I'm running this test on a Win7 (64-bit) box, running a local 11.2.0.1.0 Oracle Server, and I connect with a C++ client app built against instantclient-11.2.0.2.0 that runs on that same machine.
I tried setting OCI_ATTR_SUBSCR_TIMEOUT explicitly to 0, to no avail.
I checked the job_queue_processes instance param to make sure it's not 0 (it's 1000).
Of course, the user/schema I'm connecting with has been granted CHANGE NOTIFICATION
I'm running out of ideas on this issue, and I would appreciate some insights on what else I could try or check.
I'm starting to wonder if CQN needs to be activated somehow. My DBA skills are close to nonexistent, this is a stock install of 11gR1 on Windows using the installer, with no special configurations or customization done at all.
Thanks, --DD
Update #1
A colleague successfully ran that same test, and he ran it using the server-provided oci.dll. I tried that (I build using instantclient, but forced the PATH at runtime: Path=D:\oracle\product\11.2.0\dbhome_1\BIN;$(Path) in VS Property Page> Debugging> Environment), and indeed the CQN test works! We still haven't figured out whether the slight version difference between client and server, or using instantclient (the Light variant by the way) vs a full client vs a server install is the real culprit.
But it is bad news that a newer instantclient does not support CQN...
Update #2
I've tried all 6 combinations of instantclient Light (65 MB) or Normal (150 MB) in versions 12.2.0.(1|2|3).0 on Win64, and none of them worked. Haven't tested the Full Client yet, nor have we tested on Linux just yet.
Environment_var cqn_env = Environment::create(OCI_EVENTS + OCI_OBJECT);
Connection_var cqn_conn = Connection::logon2(...);
Subscription sub(cqn_conn, "cqn_test", OCI_SUBSCR_NAMESPACE_DBCHANGE);
sub.set<attr::SUBSCR_CALLBACK>( &cqn_callback_func );
sub.set<attr::SUBSCR_CQ_QOSFLAGS>( OCI_SUBSCR_CQ_QOS_QUERY );
try {
sub.register_self();
} catch (const OracleException& ex) {
BOOST_REQUIRE(ex.error_code && *ex.error_code == 29972);
cerr << "\nSKIPPED: test requires CHANGE NOTIFICATION privilege" << endl;
return;
}

Why am I getting "The ExternalInterface is not available in this container" in a Flex Mobile Project?

I am using StageWebView to show a local HTML page (using file://). I want to call a function in my flex mobile project to be called from a JS function. Using ExternalInterface, I have
in Flex -
ExternalInterface.addCallback("myFunction",myFunc);
in JS -
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function showAlert()
{
alert("Going to call AS function");
thisMovie("ShowLocalHTML").myFunction("Hello");
return false;
}
I am getting "Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime." when trying to run the application.
And my project targets Android platform. And I have Mozilla, Chrome installed on my desktop - although I am not user if that is relevant to the problem.
Please help in resolving this issue.
Since I am new to Flex and AS it took me a while to understand the problem. See http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html and http://sean.voisen.org/blog/2010/10/making-the-most-of-stagewebview/. What it means is External Interface is not available for use with StageWebView in AIR for android.
True, but you still can communicate js <> air if you are using an ANE solution. Check here https://github.com/myflashlab/webView-ANE I'm the coder of this ANE by the way! :)