Alison's New App is now available on iOS and Android! Download Now

Module 1: Start with a Solid Platform

    Study Reminders
    Support

    GCP APIs
    Everything you do in GCP is done with API's. This topic introduces API's and discusses how they are used. Let us be precise about what an application programming interface or API is. A software services implementation can be complex and changeable. If other software services had to be explicitly coded at that level of detail in order to use that surface the result would be brittle and error-prone. So, instead application developers structure the software they write so that presents a clean well-defined interface that straps away needless detail.And then they document that interface that's an application programming interface. The underlying implementation can change as long as the interface does not and other pieces of software that use the API do not have to know or care.(Refer Slide Time: 00:59)The services that make up GCP offer API is so that code you write can control them. These API’s which can be enabled through the GCP console or what is called restful in other words they follow the representations state transfer paradigm. In a broad sense that means that your code can use Google services in much the same way that web browsers talk to web servers. The API is identify resources in GCP with URLs. Your code can pass information to the api's using JSON which is a very popular way of passing textual information over the web. And there is an open system OAuth 2 for user login and access control.GCP API is also assist in helping you to control your spend with most including daily quotas and limits where needed quotas and rates can be raised by request.(Refer Slide Time: 02:08)In addition to the Cloud SDK you will also use client libraries than able you to easily create and man resources. GCP client libraries exposes API’s for two main purposes, app API is provide access to services and they are optimized for supported language such as nodejs and Python. Admin API's are for functionality for resource management. For example you can use admin api's if you want to build your own automated tools.The different application managed service options will be discussed in more detail later in the course.(Refer Slide Time: 02:51)The GCP console includes a tool called the api's explorer that helps you learn about the api's interactively. And lets you see what api s are available and in what versions.T api's expect parameters and documentation on them is built-in. You can try to api's interactively even with user authentication. Suppose you have explored an API and you are ready to build an application that uses it, do you have to start coding from scratch?No Google provides client libraries to take a lot of the drudgery out of the task of calling GCP from your code.(Refer Slide Time: 03:29)In this example the compute.instances.list method from the compute engine API will be tested, items listed in red are required inputs. When the method is run you will have to login using OAuth 2.0. Since rest api is our HTTP based if the method runs correctly you will receive a 200 message and the appropriate data will be displayed at the project or the zone were entered and correctly you will get a 400 error and no data will be displayed.