Request to Web Api Client Download File C# Call a Web API from a .NET Client (C#) This Content Is for a Previous Version of .NET

Total Page:16

File Type:pdf, Size:1020Kb

Request to Web Api Client Download File C# Call a Web API from a .NET Client (C#) This Content Is for a Previous Version of .NET request to web api client download file c# Call a Web API From a .NET Client (C#) This content is for a previous version of .NET. New development should use ASP.NET Core. For more information on using ASP.NET Core Web API, see: This tutorial shows how to call a web API from a .NET application, using System.Net.Http.HttpClient. In this tutorial, a client app is written that consumes the following web API: Action HTTP method Relative URI Get a product by ID GET /api/products/ id Create a new product POST /api/products Update a product PUT /api/products/ id Delete a product DELETE /api/products/ id. To learn how to implement this API with ASP.NET Web API, see Creating a Web API that Supports CRUD Operations. For simplicity, the client application in this tutorial is a Windows console application. HttpClient is also supported for Windows Phone and Windows Store apps. For more information, see Writing Web API Client Code for Multiple Platforms Using Portable Libraries. NOTE: If you pass base URLs and relative URIs as hard-coded values, be mindful of the rules for utilizing the HttpClient API. The HttpClient.BaseAddress property should be set to an address with a trailing forward slash ( / ). For example, when passing hard-coded resource URIs to the HttpClient.GetAsync method, don't include a leading forward slash. To get a Product by ID: Set client.BaseAddress = new Uri("https://localhost:5001/"); Request a Product . For example, client.GetAsync<Product>("api/products/4"); . Create the Console Application. In Visual Studio, create a new Windows console app named HttpClientSample and paste in the following code: The preceding code is the complete client app. RunAsync runs and blocks until it completes. Most HttpClient methods are async, because they perform network I/O. All of the async tasks are done inside RunAsync . Normally an app doesn't block the main thread, but this app doesn't allow any interaction. Install the Web API Client Libraries. Use NuGet Package Manager to install the Web API Client Libraries package. From the Tools menu, select NuGet Package Manager > Package Manager Console . In the Package Manager Console (PMC), type the following command: The preceding command adds the following NuGet packages to the project: Microsoft.AspNet.WebApi.Client Newtonsoft.Json. Newtonsoft.Json (also known as Json.NET) is a popular high-performance JSON framework for .NET. Add a Model Class. Examine the Product class: This class matches the data model used by the web API. An app can use HttpClient to read a Product instance from an HTTP response. The app doesn't have to write any deserialization code. Create and Initialize HttpClient. Examine the static HttpClient property: HttpClient is intended to be instantiated once and reused throughout the life of an application. The following conditions can result in SocketException errors: Creating a new HttpClient instance per request. Server under heavy load. Creating a new HttpClient instance per request can exhaust the available sockets. The following code initializes the HttpClient instance: The preceding code: Sets the base URI for HTTP requests. Change the port number to the port used in the server app. The app won't work unless port for the server app is used. Sets the Accept header to "application/json". Setting this header tells the server to send data in JSON format. Send a GET request to retrieve a resource. The following code sends a GET request for a product: The GetAsync method sends the HTTP GET request. When the method completes, it returns an HttpResponseMessage that contains the HTTP response. If the status code in the response is a success code, the response body contains the JSON representation of a product. Call ReadAsAsync to deserialize the JSON payload to a Product instance. The ReadAsAsync method is asynchronous because the response body can be arbitrarily large. HttpClient does not throw an exception when the HTTP response contains an error code. Instead, the IsSuccessStatusCode property is false if the status is an error code. If you prefer to treat HTTP error codes as exceptions, call HttpResponseMessage.EnsureSuccessStatusCode on the response object. EnsureSuccessStatusCode throws an exception if the status code falls outside the range 200–299. Note that HttpClient can throw exceptions for other reasons — for example, if the request times out. Media-Type Formatters to Deserialize. When ReadAsAsync is called with no parameters, it uses a default set of media formatters to read the response body. The default formatters support JSON, XML, and Form-url-encoded data. Instead of using the default formatters, you can provide a list of formatters to the ReadAsAsync method. Using a list of formatters is useful if you have a custom media-type formatter: Sending a POST Request to Create a Resource. The following code sends a POST request that contains a Product instance in JSON format: The PostAsJsonAsync method: Serializes an object to JSON. Sends the JSON payload in a POST request. If the request succeeds: It should return a 201 (Created) response. The response should include the URL of the created resources in the Location header. Sending a PUT Request to Update a Resource. The following code sends a PUT request to update a product: The PutAsJsonAsync method works like PostAsJsonAsync , except that it sends a PUT request instead of POST. Sending a DELETE Request to Delete a Resource. The following code sends a DELETE request to delete a product: Like GET, a DELETE request does not have a request body. You don't need to specify JSON or XML format with DELETE. Test the sample. To test the client app: Download and run the server app. Download instructions. Verify the server app is working. For example, http://localhost:64195/api/products should return a list of products. Set the base URI for HTTP requests. Change the port number to the port used in the server app. Don’t write your Web API Client code — you’re wasting your precious time. Web APIs are heavily gaining traction in the software world, replacing the (good?) old Web Services. Virtually every API that is born today is likely to be REST and being built using frameworks like WCF (if you’re brave enough), ASP.NET MVC WebAPI or Spring. With this wide adoption of Web APIs, it’s important to provide the tools to make it efficient to work with these technologies. One particular case of efficiency is the ability to generate code whenever possible, in order to automate repetitive and no-brain-required tasks. Swagger is the new WSDL. If you’re old enough to remember Web Services, you’d know that W3C came up with the Web Service Description Language — or WSDL — which provides an XML-based description of the interface of the Web Service. WSDL is able to describe all the meta-data of a Web Service: operations, parameters, returns, complex objects, transaccional meta-data, etc. Although painful to be read by humans, WSDL has one awesome usage: Generating client code. Because REST APIs don’t come with such a description language, the community closed the gap and Swagger was born. Generating C# Web API Clients with NSwag. NSwag is an open source toolbox that, among other things, is able to generate C# and TypeScript client classes to consume Web APIs. It supports generating client code in the following scenarios: From ASP.NET Web API assembly by inspecting the assembly compiled by an ASP.NET Web API application or ASP.NET Core MVC; From Swagger specification either by reading the OpenAPI specification generated by Swagger or by generating it from the compiled assembly of the Web API; It also allows generating Open API specifications for ASP.NET Web API projects that do not use Swagger, which enables scenarios where users don’t want or can’t use Swagger. The documentation is very good and pretty extensive, but the following video is a good place to start: Using NSwag on a project. My test bed for NSwag was a small project I’m preparing for a training session, where I used NSwag to generate a C# Client for a Web API. Because the project is being built “as-we-go”, the interfaces of the Web API are subject to regular changes. So, I wanted to have simple way of re-generating the client code whenever the API contract was updated. Here’s the steps I took: Create a Class Library for your client code. I started by creating the Class Library that will receive the generated code and provide the client functionality. Pro tip: Always look to follow name conventions on your solutions. In this case, I named this Class Library with the suffix .Client to ensure that the purpose of this assembly is clear. For example, if your Web API project is named Foo.Bar.WebApi , the client assembly should be Foo.Bar.WebApi.Client . Creating .nswag project file. Then, I had to create my web-api-client.nswag file with NSwag Studio. This was pretty straight forward: Build the Solution to ensure the Web API DLLs are compiled; Select the .NET Assembly where the Web API Controllers are compiled into; Select which Controllers to generate client code from; On the “Outputs” pane, select the “CSharp Client” checkbox; Enter the namespace for the generated classes; At the end of the pane, enter the name of the file where client code will be generated — this file should in the directory of the .Client project; Click “Generate Files”; Et voila! The generated code for my beautiful Web API: Then I saved the .nswag file in the .Client Class Library and put it into source control, to make sure everyone is able to generate code using the same settings.
Recommended publications
  • Web API and Microsoft Azure
    [ 1 ] www.it-ebooks.info Building Web Services with Microsoft Azure Quickly develop scalable, REST-based applications or services and learn how to manage them using Microsoft Azure Alex Belotserkovskiy Stephen Kaufman Nikhil Sachdeva professional expertise distilled PUBLISHING BIRMINGHAM - MUMBAI www.it-ebooks.info Building Web Services with Microsoft Azure Copyright © 2015 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: May 2015 Production reference: 1220515 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78439-837-8 www.packtpub.com www.it-ebooks.info Credits Authors Copy Editors Alex Belotserkovskiy Pranjali
    [Show full text]
  • A Field Guide to Web Apis by Kin Lane Contents
    A field guide to web APIs By Kin Lane Contents Executive summary 4 What are APIs used for? 5 Open data . 5 Websites . 5 Mobile . 5. Automobiles . 6. Homes and buildings . 6 Why are web APIs different? 7 They build on existing web architecture . 7. Intuitive resources . 7 Simplicity rules . 8. Easy to understand for developers and even nondevelopers . 8. Self-service resources . 8 . History of web APIs 9 Commerce . 9 . Social . 9 . Cloud computing . .9 . Mobile . .10 . What technology goes into an API? 11 REST . 11. JSON . 11 Security . 11 . Keys . 11 . Basic auth . 12 Open authorization . 12 . Webhooks . 12 Deploying your web API 13 Do-it-yourself approaches . 13 Cloud solutions . 13 . Enterprise gateways . 13 . Established practices for managing APIs 14 Self-service . 14 . Getting started . .14 . Documentation . 15 . Code samples . 15. 2 A field guide to web APIs Support and feedback loops . 15 . The legal aspect . 15. Developer dashboard . 16 Marketing and API evangelism 17 Goals . 17 User engagement . .17 . Blogging . 17 Landscape analysis . 18 . GitHub . .18 . Social . 18. Events . 19. The future of web APIs 20 API aggregation . 20 . Real-time APIs . 20. Backend as a Service (BaaS) . 20 . Automation . 20 Voice . 21. Internet of things . 21. Cloud trends 22 Maturity of IaaS layer . 22. Opportunities in the PaaS layer . .22 . Key takeaways 23 About Kin Lane 23 3 A field guide to web APIs Executive summary A new breed of web API has emerged, delivering a vision of a lightweight, low-cost approach to connect devices and allowing applications to exchange data efficiently. This research report is a field guide for web API providers, developers, and even nondevelopers .
    [Show full text]
  • Vector Screencast
    Charles University in Prague Faculty of Mathematics and Physics BACHELOR THESIS Simonˇ Rozs´ıval Vektorov´yscreencast Department of Distributed and Dependable Systems Supervisor of the bachelor thesis: Mgr. Martin Dˇeck´y Study programme: Computer science Specialization: Programming and software systems Prague 2015 I would like to thank my supervisor, Martin Dˇeck´y, for his valuable pieces of advice, and Otakar J´ıcha from Khanova ˇskola, for the idea of this project and for lending me a graphics tablet for testing. I would also like to thank my family and friends for supporting me during my studies. I declare that I carried out this bachelor thesis independently, and only with the cited sources, literature and other professional sources. I understand that my work relates to the rights and obligations under the Act No. 121/2000 Coll., the Copyright Act, as amended, in particular the fact that the Charles University in Prague has the right to conclude a license agreement on the use of this work as a school work pursuant to Section 60 paragraph 1 of the Copyright Act. In ........ date ............ signature of the author N´azev pr´ace: Vektorov´yscreencast Autor: Simonˇ Rozs´ıval Katedra: Katedra distribuovan´ych a spolehliv´ych syst´em˚u Vedouc´ıbakal´aˇrsk´epr´ace: Mgr. Martin Dˇeck´y Abstrakt: C´ılem bakal´aˇrsk´epr´ace je vytvoˇrit software pro z´aznam a pˇrehr´av´an´ı v´yukov´ych vide´ıpro potˇreby Khanovy ˇskoly. Na rozd´ılod bˇeˇzn´ych vide´ınejsou obrazov´adata uloˇzena ve formˇebitmap, ale jako vektory, coˇz umoˇzn´ısn´ıˇzit da- tovou n´aroˇcnost a vykreslit obraz ostˇre pˇri libovolnˇevelk´em rozliˇsen´ıobrazovky uˇzivatele.
    [Show full text]
  • Browser MMS Email OMA DL Codecs
    Solutions for OEM, ODM and Platform manufacturers Page 1 www.winwap.com Browser MMS Email OMA DL Codecs Page 2 Applications for connected consumer devices WEB Browser . 4 MMS Client . 8 Email Client . 11 OMA Download Agent . 16 Multimedia Codecs by On2 . 17 About Winwap Technologies. 18 OEM SOLUTIONS Page 3 WEB & WAP Browser Apps with open User-Interface The core functionality is built into the SDK. Keep one look and feel for your entire device Only a simple browser frame UI is required as most action takes place The Winwap MMS, Email, Browser and OMA DL solutions for most within the actual browser engine, but you platforms are dividied into SDK and User-Interface parts. The SDK is can design any UI provided in binary object code and provides the core functionality for yourself. each application. The User-Interface can optionally be provided as source code for easy integration and customization. Integrate the applications seamlessly into your device. Email Client The SDK’s support both touch and non-touch methods. Licensing are terms adjusted to fit your business model. All the complex POP and IMAP functionality as Get quick integration support from the same guys that well as folder handling has been integrated into have developed the softare. this very sofisticated SDK. The UI can as with Interoperable on a global scale thanks to over 10 years MMS be designed to look of development. any way you like and this allows you to integrate into widgets and any other part of your specific device solution to add Device integration is simple and allows to customize the value to the product.
    [Show full text]
  • ASP.Net Web API
    ASP.Net Web API 1 [email protected] מה זה Web API ? Web API הוא API אותו מממש השרת והוא מחזיר לקליינט Data בלבד ולא View הבקשה והתשובה הן בפרוטוקול Http\Https הקליינטים של Web API יכולים להיות רבים : אפשר להשתמש גם בASP.Net MVC להחזיר Desktop Http\Https Application לקליינט Data אבל WEB API יותר מתאים ונוח Mobile App Server Web API Web Client Data 2 [email protected] דוגמאות ל Web API דוגמאות ידועות ל Web API : /https://jsonplaceholder.typicode.com ● https://openweathermap.org/api ● /https://developers.google.com/maps ● https://developers.facebook.com/docs/graph-api ● ● ועוד רבים 3 [email protected] ASP.Net Web API Microsoft מאפשרת לנו לכתוב שרת אשר מממש Web API כך שקליינטים יוכלו לפנות אליו ולקבל מידע התשתית שמאפשרת זאת נקראת ASP.Net Web API התשתית הזו מאוד דומה ל ASP.Net MVC ההבדל המרכזי הוא ש ASP.Net MVC יכול להחזיר View ויכול להחזיר Data ואילו ASP.Net Web API יכול להחזיר רק Data 4 [email protected] מה זה REST ? REST הוא ראשי תיבות של - Representational State Transfer REST הוא architectural pattern ליצירת API שמשתמש ב HTTP לתקשורת REST הומצא בשנת 2000 REST נמצא בשימוש רוב האתרים שחושפים WEB API 5 [email protected] דוגמא לשימוש בREST עבור אתר הבלוגים שלנו Resource HTTP method Expected output Response Code OK/200 החזרת רשימת כל הבלוגים api/blogs GET/ Created/201 יצירת בלוג חדש api/blogs POST/ No Content or 200/OK/204 עדכן מידע בלוג קיים שהid הוא api/blogs/73 PUT 73/ No Content or 200/OK/204 מחק בלוג קיים שהid הוא api/blogs/73 DELETE 73/ OK/200 החזרת מידע בלוג שהid שלו הוא api/blogs/73 GET 73/ נובע מrouting עם api טבלה בעזרתה אפשר לממש controller .CRUD בשם את המידע עובר ב PUT/POST אפשר BlogsController כאשר id לא נמצא מחזירים להעביר כ querystring שנוסף ל url או ב body של הrequest 404/Not Found 6 [email protected] שימוש ב ASP.Net Web API נוסיף ספריה api תחת ספרית Controllers של פרויקט קיים של ASP.Net MVC.
    [Show full text]
  • Ts 129 222 V15.3.0 (2019-04)
    ETSI TS 129 222 V15.3.0 (2019-04) TECHNICAL SPECIFICATION 5G; Common API Framework for 3GPP Northbound APIs (3GPP TS 29.222 version 15.3.0 Release 15) 3GPP TS 29.222 version 15.3.0 Release 15 1 ETSI TS 129 222 V15.3.0 (2019-04) Reference RTS/TSGC-0329222vf30 Keywords 5G ETSI 650 Route des Lucioles F-06921 Sophia Antipolis Cedex - FRANCE Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16 Siret N° 348 623 562 00017 - NAF 742 C Association à but non lucratif enregistrée à la Sous-Préfecture de Grasse (06) N° 7803/88 Important notice The present document can be downloaded from: http://www.etsi.org/standards-search The present document may be made available in electronic versions and/or in print. The content of any electronic and/or print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI deliverable is the one made publicly available in PDF format at www.etsi.org/deliver. Users of the present document should be aware that the document may be subject to revision or change of status. Information on the current status of this and other ETSI documents is available at https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx If you find errors in the present document, please send your comment to one of the following services: https://portal.etsi.org/People/CommiteeSupportStaff.aspx Copyright Notification No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm except as authorized by written permission of ETSI.
    [Show full text]
  • Scalability in Web Apis
    Worcester Polytechnic Institute Scalability in Web APIs Ryan Baker Mike Perrone Advised by: George T. Heineman 1 Worcester Polytechnic Institute 1 Introduction 2 Background 2.1 Problem Statement 2.2 Game Services and Tools 2.2.1 Graphics Engine 2.2.2 Map Editor 2.2.3 Friend Network 2.2.4 Achievements 2.2.5 Leaderboards 2.3 Our Service Definition 2.3.1 Leaderboards 2.4 Service Requirements 2.4.1 Administrative Ease 2.4.2 Security 2.4.3 Scalability 2.5 Internal Service Decisions 2.5.1 Application Framework 2.5.2 Cloud Computing 3 Methodology 3.1 Decisions of Design and Architecture 3.1.1 Leaderboards 3.1.2 API Documentation 3.1.3 Developer Console 3.1.4 Admin Console 3.1.5 Java Client Package 3.1.6 Logging 3.2 Decisions of Implementation 3.2.1 Enterprise vs Public 3.2.2 Front End Implementation 3.2.3 Cloud Computing Provider (AWS) 3.2.4 Web Application Framework Implementation (Flask) 3.2.5 Continuous Integration Service 3.2.6 API 3.2.7 Logging 3.2.8 Database Schema 4 Success Metrics 4.1 Resiliency 4.1.1 Simulated Traffic 4.1.2 Load Testing and Scalability 4.2 Design 4.2.1 Client Perspective 2 4.2.3 Admin Perspective 5 Conclusions & Future Work 5.1 Client Conclusions 5.2 Administrator Conclusions 5.3 The Future 6 References 7 Appendix A ­ Why we chose Leaderboards B ­ Facebook’s Game Development API C ­ Playtomic’s API D ­ Front End Tooling Decision E ­ API Documentation Tool F ­ Elastic Beanstalk 3 1 Introduction Game developers, especially those that make social games, undertake a large amount of work to create them.
    [Show full text]
  • Khronos Open API Standards for Mobile Graphics, Compute And
    Open API Standards for Mobile Graphics, Compute and Vision Processing GTC, March 2014 Neil Trevett Vice President Mobile Ecosystem, NVIDIA President Khronos © Copyright Khronos Group 2014 - Page 1 Khronos Connects Software to Silicon Open Consortium creating ROYALTY-FREE, OPEN STANDARD APIs for hardware acceleration Defining the roadmap for low-level silicon interfaces needed on every platform Graphics, compute, rich media, vision, sensor and camera processing Rigorous specifications AND conformance tests for cross- vendor portability Acceleration APIs BY the Industry FOR the Industry Well over a BILLION people use Khronos APIs Every Day… © Copyright Khronos Group 2014 - Page 2 Khronos Standards 3D Asset Handling - 3D authoring asset interchange - 3D asset transmission format with compression Visual Computing - 3D Graphics - Heterogeneous Parallel Computing Over 100 companies defining royalty-free APIs to connect software to silicon Camera Control API Acceleration in HTML5 - 3D in browser – no Plug-in - Heterogeneous computing for JavaScript Sensor Processing - Vision Acceleration - Camera Control - Sensor Fusion © Copyright Khronos Group 2014 - Page 3 The OpenGL Family OpenGL 4.4 is the industry’s most advanced 3D API Cross platform – Windows, Linux, Mac, Android Foundation for productivity apps Target for AAA engines and games The most pervasively available 3D API – 1.6 Billion devices and counting Almost every mobile and embedded device – inc. Android, iOS Bringing proven desktop functionality to mobile JavaScript binding to OpenGL
    [Show full text]
  • Api Blueprint Json Schema
    Api Blueprint Json Schema Shaun include her sonority temperately, she fixings it odiously. Ethnical or undisappointing, Merrick never crowed any take! Sometimes petaliferous Patel venerates her promisees thru, but subclavicular Nevile geminate premeditatedly or troat deistically. The old site generated onto your api specification as heroku api for rspec request them up your schema blueprint api blueprint Create schema refactoring; xml or response produces it! The blueprint wins for blueprint api schema json! While this json data structures section will show you json api! Of our requests in OpenAPI has only text possible with JSON Schema. Pet schema json schema document your wcf soap still being on that blueprint api schema json body content negotiation is very careful about your data involved in a new business logic while invented as. Httpsapiblueprintorgdocumentationexamples14-json-schemahtml or. That key support other definition formats like API Blueprint and RAML join the Initiative. For quality, a mind is object object. Import your blueprint to represent the appropriate headers to be parsed from that begins with amazon api, or uploading json schema document. Referencing external JSON Schema with schema in API Blueprint 39 Open pksunkara opened this occupation on Apr 5 2017 2 comments Open. Apis that same json schema json schemas nest a subscription and other hand with. Baidu bce authorization header used? RAML is the latest addition to this series, of its developers profited much worth its predecessors WADL and Swagger. Fake rest api swagger. Is waiting any json schema like a excel dude in Api Blueprint. Create json we can also the api blueprint json schema that our worldwide community and parsing the whole company is.
    [Show full text]
  • Osisoft PI System Enterprise Data Infrastructure On
    PI System Connector connects PI System from OSIsoft PI System Enterprise Data Infrastructure on AWS 1 individual sites to the Roll-up PI System on AWS via Highly available and load-balanced configuration of Roll-up PI System that aggregates data from multiple PI Systems across sites. AWS Direct Connect or AWS Site-to-Site VPN. 2 Data from edge devices can be ingested via Modbus, OPC UA or MQTT into AWS IoT 12 Greengrass or with a AWS Lambda function. AWS Cloud 3 AWS IoT Greengrass sends the data from edge devices to AWS IoT Core using MQTT. An AWS IoT Core rule is triggered that invokes a Lambda Users Availability Zone 2 Availability Zone 2 function. VPC An AWS Lambda function translates data from Amazon S3 4 1 MQTT message into OSIsoft Messaging Format On- Public subnet Public subnet (OMF) and then sends it to the PI Web API which Premises posts the data to PI System. 11 AWS Site-to 5 Amazon 5 PI System data from on-premises is sent to the PI PI System Site VPN Redshift Connector Relay which posts the data to PI System. Connector 6 Elastic Load Balancing directs PI System traffic PI Connector PI Integrator for PI Vision Elastic Load PI Vision from public subnet (PI Connector Relay, PI Web AWS Direct 4 Relay Business API, PI vision and PI Integrator for Business Balancing Analytics Connect Amazon Analytics) to the PI Asset Framework (PI AF). PI Interface PI Server Kinesis 7 Highly available SQL Servers running on Amazon PI Web API EC2 instances store the metadata used by PI Vision AWS Lambda and PI AF.
    [Show full text]
  • Probing Web Apis to Build Detailed Workload Profile
    From the Outside Looking In: Probing Web APIs to Build Detailed Workload Profile Nan Deng, Zichen Xu, Christopher Stewart and Xiaorui Wang The Ohio State University From the Outside 1. Motivation 2. Problem Looking In 3. Our Approach Internet Service Web APIs ProgrammableWeb, 2014 Google Maps Facebook Amazon S3 The typical web page loads data from 7-25 third party providers [Everts, 2013] In 2013, the number of indexed APIs grew By 32% year over year [PW, 2013] From the Outside 1. Motivation 2. Problem Looking In 3. Our Approach ● Using Web APIs ● Benefits – Improve content – Salaries are 20% of without programming expenses [tripAdvisor] – Published interfaces – Failures, dynamic provide well defined, workloads, corner often RESTful, output cases covered – Data is centralized, – Efficient to move managed by experts compute to big data From the Outside 1. Motivation 2. Problem Looking In 3. Our Approach Using web APIs risks availability & performance ● “Everyone has bad days, and ● “...a bug [affected] people from third-party content providers third party sites integrated with are no exception.” Tammy Facebook” on Feb 7, 2013 Everts Took down CNN & WaPost ● Somtimes web APIs perform ● CDN Planet Homepage poorly because the were reported that Facebook took implemented poorly 796 ms to load, 2X longer than any other critical content Slow responses cost 3.5B/y [Everts, 2013] From the Outside 1. Motivation 2. Problem Looking In 3. Our Approach Web API Web APIs Probes Google Maps Models of Captured Cloud Design Response Times Is the web API well implemented? Profile Extraction How will it respond under extreme operating conditions? Workload Profiles Challenge: Create useful profiles faster than trial-and-error approach F F D D C C Hypothesis: Given cloud design, response serv.
    [Show full text]
  • Khronos Overview the State of the Art in Open Standards for Visual Computing Neil Trevett Khronos President Vice President Mobile Content, NVIDIA
    Khronos Overview The State of the Art in Open Standards for Visual Computing Neil Trevett Khronos President Vice President Mobile Content, NVIDIA © Copyright Khronos Group 2013 - Page 1 Khronos Connects Software to Silicon ROYALTY-FREE, OPEN STANDARD APIs for advanced hardware acceleration Low level silicon to software interfaces needed on every platform Graphics, video, audio, compute, vision, sensor and camera processing Defines the forward looking roadmap for the silicon community Shipping on billions of devices across multiple operating systems Rigorous conformance tests for cross-vendor consistency Khronos is OPEN for any company to join and participate Acceleration APIs BY the Industry FOR the Industry © Copyright Khronos Group 2013 - Page 2 Making a Difference – One API at a Time Well over 1 BILLION people are using what the Khronos members have created together - Every Day… © Copyright Khronos Group 2013 - Page 3 Khronos Standards glTF cooperation with MPEG for 3D Asset Compression! 3D Asset Handling - Advanced Authoring pipelines - 3D Asset Transmission Format with OpenCL 2.0 Finalized! streaming and compression Visual Computing - Object and Terrain Visualization - Advanced scene construction Over 100 companies defining royalty-free APIs to connect software to silicon Camera Control API OpenVX 1.0 Acceleration in the Browser Provisional - WebGL for 3D in browsers Released! - WebCL – Heterogeneous Computing for the web Sensor Processing - Mobile Vision Acceleration WebGL and WebCL - On-device Sensor Fusion Momentum! © Copyright
    [Show full text]