※当サイトの記事には、広告・プロモーションが含まれます。

Google APIとGoogle Cloud APIの違いって?

f:id:ts0818:20210821145437j:plain

gigazine.net

虹彩認証などで個人を認識し、大規模なデータベースで経歴などを照合可能な生体認証デバイスHIIDE」が、アフガニスタンを制圧したイスラム主義組織・タリバンの手に渡ったことが報じられました。

https://gigazine.net/news/20210819-taliban-seized-hiide/

HIIDEについては、2010年当時アメリカ国防総省が1000万ドル(約11億円)相当の費用をかけてHIIDEを配備したことが報じられたほか、その後アメリカ軍がウサーマ・ビン・ラーディン特定するために使用したり、テロリストを特定することを目的とするアフガニスタン国民の生体情報収集に使われたりしたことで知られています。

https://gigazine.net/news/20210819-taliban-seized-hiide/

元陸軍諜報員であり、人権団体の最高技術責任者であるウェルトン・チャン氏は「HIIDEが悪用された場合のプライバシーや対処法の問題については、誰も考えたことがないと思います。今後、アメリカ軍と外交機関は、アフガニスタンのような不安定な状況下でHIIDEを再び展開するかどうかについて、慎重に検討する必要があります」と述べました。

https://gigazine.net/news/20210819-taliban-seized-hiide/

⇧ というか、軍で扱うものなんだから、外部に流出した際のリスクについては想定していないとかNGな気がするんだけど...。

当然、デバイスに対しては、誰でもアクセスできないように認証・認可とか実装されてるとは思うけど... 

性悪説」を前提にセキュリティの構築にアプローチしてる「ゼロトラスト(Zero trust)」とかの概念も、2010年以前だと確立されてなかったかもしらんけどさ...

というわけで、今さら感が拭えませんが、「Google」の「API(Application programing Interface)」なんかについて調査してみました。

レッツトライ~。

 

Google API」と「Google Cloud API」の違いって?

まぁ、何て言うか、気になるよね?

github.com

The googleapis organization hosts tools, technical articles, and issues related to Google API design and practice. It also hosts client libraries for using many Google APIs from a variety of supported languages.

https://github.com/googleapis/googleapis.github.io/

API Design Guide

Google APIs use a common API Design Guide that encourages a simple and consistent API design philosophy. It also provides solutions to common design issues, such as proper default values for enums and patterns for long-running operations.

https://github.com/googleapis/googleapis.github.io/

⇧ ってな感じで、「googleapis organization」って団体の素性がいまいち良く分からんのだけど、「Google APIs」ってのは、「API Design Guide」ってものに則って作られてますと。

API Design Guide」を確認してみると、

cloud.google.com

はじめに

これは、ネットワーク API の一般的な設計ガイドです。2014 年以来 Google 内部で使用され、Cloud API やその他の Google API を設計するときに Google が従うガイドです。この設計ガイドは、外部のデベロッパーへの情報提供と、互いの連携作業の効率化のためにここで共有されています。

https://cloud.google.com/apis/design

⇧ ってな感じで、

は別物ですよ、ってな書きっぷりになってますと。

Google Cloud API」については、 

cloud.google.com

Google Cloud API

Google Cloud APIs は、Google Cloud Platform サービスへのプログラマティック インターフェースです。Google Cloud Platform の重要な部分であり、コンピューティングからネットワーキング、ストレージ、機械学習ベースのデータ分析まで、あらゆる機能を簡単にアプリケーションへ追加できます。

https://cloud.google.com/apis/docs/overview

⇧ ってな感じで、「GCPGoogle Cloud Platform)」で公開されてる「サービス」を利用するための「API(Application programing Interface)」ってことっぽいですな。

Cloud APIについて

Cloud APIs は、Cloud Pub/Sub API などのネットワーク API サービスとして公開されます。各 Cloud API は通常、googleapis.com の 1 つ以上のサブドメインpubsub.googleapis.com など)で動作し、公共のインターネットと Virtual Private Cloud(VPC)ネットワークを介して、JSON HTTP と gRPC の両方のインターフェースをクライアントに提供します。クライアントは、HTTP および gRPC リクエストを Cloud API エンドポイントに直接送信するか、クライアント ライブラリを使用して送信できます。

https://cloud.google.com/apis/docs/overview

⇧ ってな感じで、「JSON HTTP」ないしは「gRPC」で「API(Application programing Interface)」を操作するっぽいですな。

Cloud APIへのアクセス

Cloud API には、多くの一般的なプログラミング言語でのクライアント ライブラリを使用してサーバー アプリケーションからアクセスできます。Firebase SDK を介してモバイルアプリから、またはサードパーティのクライアントを使用してアクセスすることもできます。Cloud APIs には、Google Cloud SDK ツールまたは Google Cloud Console からアクセスすることもできます。

https://cloud.google.com/apis/docs/overview

⇧ プログラミングから使用する場合は「クライアントライブラリ」を使えば良いらしいってな説明になってますと。

じゃあ、「Google API」は?

github.com

Google APIs

This repository contains the original interface definitions of public Google APIs that support both REST and gRPC protocols. Reading the original interface definitions can provide a better understanding of Google APIs and help you to utilize them more efficiently. You can also use these definitions with open source tools to generate client libraries, documentation, and other artifacts.

https://github.com/googleapis/googleapis

Overview

Google APIs are typically deployed as API services that are hosted under different DNS names. One API service may implement multiple APIs and multiple versions of the same API.

https://github.com/googleapis/googleapis

Google APIs use Protocol Buffers version 3 (proto3) as their Interface Definition Language (IDL) to define the API interface and the structure of the payload messages. The same interface definition is used for both REST and RPC versions of the API, which can be accessed over different wire protocols.

There are several ways of accessing Google APIs:

  1. JSON over HTTP: You can access all Google APIs directly using JSON over HTTP, using Google API client library or third-party API client libraries.

  2. Protocol Buffers over gRPC: You can access Google APIs published in this repository through GRPC, which is a high-performance binary RPC protocol over HTTP/2. It offers many useful features, including request/response multiplex and full-duplex streaming.

  3. Google Cloud Client Libraries: You can use these libraries to access Google Cloud APIs. They are based on gRPC for better performance and provide idiomatic client surface for better developer experience.

https://github.com/googleapis/googleapis

⇧ う、う~ん...

よう分からんけど、

って理解で良いんかな?

 「all Google APIs」ってのに「Google Cloud API」が含まれてるのかどうかがいまいちよく分からんのよね...

ただ、「Google Maps Platform(旧:Google Maps API)」とかも「GCPGoogle Colud Platform)」で「APIキー」を作らないと使えないようになってるなどあるから、いまいち「Google Cloud API」と「Google API」の境界が分からんのよね...

Wikipediaさんに聞いてみた。 

Google APIs are application programming interfaces (APIs) developed by Google which allow communication with Google Services and their integration to other services. Examples of these include Search, Gmail, Translate or Google Maps. Third-party apps can use these APIs to take advantage of or extend the functionality of the existing services.

https://en.wikipedia.org/wiki/Google_APIs

⇧ ってな感じで、「Google Service」を利用するための「API(Application programing Interface)」の 集まりってことで、「APIs(Application programing Interfaces)」って複数形の説明になってるけど、何か特定の1つを指示す場合は「Google API」ってことになるんかな。

Google Service」はと言うと、

The following is a list of products and services provided by Google LLC. Active, soon-to-be discontinued, and discontinued products, services, tools, hardware, and other applications are broken out into designated sections.

https://en.wikipedia.org/wiki/List_of_Google_products

⇧ ってな感じで、「Google LLC」が提供してる「プロダクト」と「サービス」って言っていて、見た感じ「Google Colud」って言葉は出てこないんだけど、「GCPGoogle Cloud Platform)」を利用しないと使えないはずの「Google Maps」が掲載されてるのが気になるかな...

不思議なのが、Googleさん「Google API」については説明がなくて、「Google Cloud API」ばっかりが検索でヒットするんよね...

「different between google api and google cloud api」とかで検索してみたんだけど、軒並み「Google Cloud API」がヒットするというね...

Googleエンジンの「SEO(Search Engine Optimization:検索エンジン最適化)
」どうなってるんじゃい...

 

Google APIs Exploer って?

Google API」と「Google Cloud API」の違いについてがいまいちよく分からんのだけど、

codezine.jp

Google APIと通信する方式には次の2つがあります。

  • OAuth1でアクセス許可を得て、ATOM書式で通信する
  • OAuth2でアクセス許可を得て、JSON書式でhttpsを使って通信する

 前者は古いAPIの通信方式で、徐々に後者に置き換えられています。新たに公開されるAPIは全て後者になっています。今回紹介するAPIも後者であるとします。

これだけ押さえておけばあらゆるAPIを呼び出せる! Google APIを使用するための基本 (1/4):CodeZine(コードジン)

⇧ ってな感じで、実質、「OAuth2でアクセス許可を得て、JSON書式でhttpsを使って通信する」の1択になるっぽい。 

 後者のAPIDiscovery based APIと呼ばれます。Discovery based APIの仕様はDiscovery Documentと呼ばれるJSON文書で定義されており、この仕様に準拠しているAPIの大部分は、Google APIs Discovery Serviceという「APIを探すAPI」を使って探すことができます。

これだけ押さえておけばあらゆるAPIを呼び出せる! Google APIを使用するための基本 (1/4):CodeZine(コードジン)

 また、JSON文書であるDiscovery Documentは、プログラムで処理することができます。これを利用して、Discovery Documentで定義されているAPIを使用するWebアプリケーションを、自動的に生成することもできます。

これだけ押さえておけばあらゆるAPIを呼び出せる! Google APIを使用するための基本 (1/4):CodeZine(コードジン)

 この仕組みを利用したツールにGoogle API Explorerがあります。Google API Explorerは、Google APIs Discovery Serviceを使ってAPIを取得し、一覧表示してくれますが、それだけにとどまりません。一覧にあるAPIを簡単に実行してみることが可能です。

これだけ押さえておけばあらゆるAPIを呼び出せる! Google APIを使用するための基本 (1/4):CodeZine(コードジン)

⇧ ってな感じで、「Google APIs Discovery Service」を利用したツールが「Google API Explorer」ってことみたいね。

う~ん...

developers.google.com

⇧ よう分からんけど、「Google API」の一覧って考えて良いんかな?

 

同じ様な疑問を抱えてる方がいらっしゃいました。 

stackoverflow.com

Where do i find a complete list of all Google APIs? I haven't found any.

https://stackoverflow.com/questions/6122505/complete-list-of-all-google-apis/21178816

⇧ っていう問いかけに対し、

This link shows http://code.google.com/more/
Google Libraries API - Developer's Guide

The Google Libraries API is a content distribution network and loading architecture for the most popular, open-source JavaScript libraries. Using the google.load() method gives your application high speed and global access to a growing list of the most popular, open-source JavaScript libraries. You can also use tags to include the libraries.

https://stackoverflow.com/questions/6122505/complete-list-of-all-google-apis/21178816

⇧ ってな回答があって、「http://code.google.com/more/」にアクセスしてみたところ、

f:id:ts0818:20210821120540p:plain

f:id:ts0818:20210821120624p:plain

⇧ ってな感じで、プロダクトが分かれてるようなので、「Colud」と「それ以外」って感じで「API(Application programing Interface)」は別物って認識で良さそうってことですかね。

結論として、

  • Google Cloud API
    • プロダクトが「Cloud」のAPI(Application programing Interface)
  • Google API
    • プロダクトが「Cloud」以外のAPI(Application programing Interface)すべて

って分類になるってことかと。

そもそも「Google API」って用語自体について、Googleさんが特に説明してないから何とも言えませんが...

ただ、「Google API」って用語自体の説明はないけれども、Googleさんが、

はじめに

これは、ネットワーク API の一般的な設計ガイドです。2014 年以来 Google 内部で使用され、Cloud API やその他の Google API を設計するときに Google が従うガイドです。この設計ガイドは、外部のデベロッパーへの情報提供と、互いの連携作業の効率化のためにここで共有されています。

https://cloud.google.com/apis/design

⇧ って分類にしておったしね。

それにしても、このあたりの情報、もうちょっと確認しやすくして欲しい...

有識者の方に直接聞ける環境だったら、徒に時間だけが過ぎていくこともないんですけどね...

思わず、

「なぜオレは あんなムダな時間を・・・・・・」

っていう『スラムダンク』の三井寿の台詞をつぶやきたくなりましたな...


SLAM DUNK(スラムダンク) コミック 全31巻完結セット (ジャンプ・コミックス)

今回はこのへんで。