1. 程式人生 > >無線與物聯網實驗6題目和解答

無線與物聯網實驗6題目和解答

  1. In the Marketplace, search for “Parasoft” and select “Service Virtualization On-Demand”. You may select the “BYOL” option if you’ve previously received a special license from Parasoft. Click Create.
  2. Provide a name for the VM then enter a username and password. You can choose to create a new resource group for the VM or add it to an existing VM. All other options can be left at the defaults. Click OK.
  3. Select a virtual machine size (recommended is DS2_V2 or better). Click OK.
  4. Under “Settings,” you may change other configurations if desired. It is recommended that you do not change the default configuration unless you have a specific reason for doing so. Click OK.
  5. Click the OK on the Summary view.
  6. Click Purchase on the Buy view. After your free trial is complete (the first 30 days), you will be charged. The VM creation process will take several minutes to complete.
  7. Once the VM’s status is “Running,” select the VM and copy its Public IP Address.
  8. Go to http://<VM_IP_Address> in your browser. The Continuous Testing Platform main menu will appear. Once the “Online Percentage” widget shows “100%,” the virtual machine is fully configured and initialized:
  9. Near the top, click “Add System”:
  10. Select “Import a system from file,” then browse to AlexaWeatherSystem.zip (Download it here). Select “AzureVirtServer” as the Target server, then click “Import”: We’ve now imported the AlexaWeatherSkill system, virtual services and associated data.
  11. Let’s finish by placing our proxy endpoint between our Lambda function and the OpenWeatherMap API. The proxy is deployed at http://<VM_IP_Address>:9080/proxy Go into your virtualWeather function in AWS Lambda (https://console.aws.amazon.com/lambda/) and change the Environment Variable we created to the proxy endpoint:
  12. In our environment (http://<VM_IP_Address>/em/ui/environments/1), we can now control the data being returned to our Lambda function to test different condition. This will change our Alexa’s behavior on-demand! Select T-Storm from the dropdown under the OpenWeatherMap API component and select the “Provision” button: Traffic is now being directed to our virtual “T-Storm” service and a response (indicating rain and thunderstorms) is being returned. Say something like, “Alexa, ask virtualWeather what the weather is in 91016” and you’ll hear as a response “Grab an umbrella! Thunderstorm and heavy rain in Monrovia.” We now have the power to control the weather!