servicecontrol.yaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. type: google.api.Service
  2. config_version: 3
  3. name: servicecontrol.googleapis.com
  4. title: Service Control API
  5. apis:
  6. - name: google.api.servicecontrol.v1.QuotaController
  7. - name: google.api.servicecontrol.v1.ServiceController
  8. documentation:
  9. summary: |-
  10. Provides admission control and telemetry reporting for services integrated
  11. with Service Infrastructure.
  12. overview: |-
  13. Google Service Control provides control plane functionality to managed
  14. services, such as logging, monitoring, and status checks. This page
  15. provides an overview of what it does and how it works.
  16. ## Why use Service Control?
  17. When you develop a cloud service, you typically start with the business
  18. requirements and the architecture design, then proceed with API definition
  19. and implementation. Before you put your service into production, you
  20. need to deal with many control plane issues:
  21. * How to control access to your service.
  22. * How to send logging and monitoring data to both consumers and producers.
  23. * How to create and manage dashboards to visualize this data.
  24. * How to automatically scale the control plane components with your
  25. service.
  26. Service Control is a mature and feature-rich control plane provider
  27. that addresses these needs with high efficiency, high scalability,
  28. and high availability. It provides a simple public API that can be
  29. accessed from anywhere using JSON REST and gRPC clients, so when you move
  30. your service from on-premise to a cloud provider, or from one cloud
  31. provider to another, you don't need to change the control plane provider.
  32. Services built using Google Cloud Endpoints already take advantage of
  33. Service Control. Cloud Endpoints sends logging and monitoring data
  34. through Google Service Control for every request arriving at its
  35. proxy. If you need to report any additional logging and monitoring data
  36. for your Cloud Endpoints service, you can call the Service Control API
  37. directly from your service.
  38. The Service Control API definition is open sourced and available on
  39. [GitHub](https://github.com/googleapis/googleapis/tree/master/google/api/servicecontrol). By
  40. changing the DNS name, you can easily use alternative implementations
  41. of the Service Control API.
  42. ## Architecture
  43. Google Service Control works with a set of *managed services* and their
  44. *operations* (activities), *checks* whether an operation is allowed to
  45. proceed, and *reports* completed operations. Behind the scenes, it
  46. leverages other
  47. Google Cloud services, such as
  48. [Google Service
  49. Management](/service-infrastructure/docs/service-management/getting-started), [Stackdriver
  50. Logging](/logging), and [Stackdriver Monitoring](/monitoring), while
  51. hiding their complexity from service producers. It enables service
  52. producers to send telemetry data to their consumers. It uses caching,
  53. batching, aggregation, and retries to deliver higher performance and
  54. availability than the individual backend systems it encapsulates.
  55. <figure id="fig-arch" class="center">
  56. <div style="width: 70%;margin: auto">
  57. <img src="/service-infrastructure/docs/service-control/images/arch.svg"
  58. alt="The overall architecture of a service that uses Google Service
  59. Control."> </div> <figcaption><b>Figure 1</b>: Using Google Service
  60. Control.</figcaption> </figure>
  61. The Service Control API provides two methods:
  62. *
  63. [`services.check`](/service-infrastructure/docs/service-control/reference/rest/v1/services/check),
  64. used for:
  65. * Ensuring valid consumer status
  66. * Validating API keys
  67. *
  68. [`services.report`](/service-infrastructure/docs/service-control/reference/rest/v1/services/report),
  69. used for:
  70. * Sending logs to Stackdriver Logging
  71. * Sending metrics to Stackdriver Monitoring
  72. We'll look at these in more detail in the rest of this overview.
  73. ## Managed services
  74. A [managed
  75. service](/service-infrastructure/docs/service-management/reference/rest/v1/services) is
  76. a network service managed by
  77. [Google Service
  78. Management](/service-infrastructure/docs/service-management/getting-started). Each
  79. managed service has a unique name, such as `example.googleapis.com`,
  80. which must be a valid fully-qualified DNS name, as per RFC 1035.
  81. For example:
  82. * Google Cloud Pub/Sub (`pubsub.googleapis.com`)
  83. * Google Cloud Vision (`vision.googleapis.com`)
  84. * Google Cloud Bigtable (`bigtable.googleapis.com`)
  85. * Google Cloud Datastore (`datastore.googleapis.com`)
  86. Google Service Management manages the lifecycle of each service's
  87. configuration, which is used to customize Google Service Control's
  88. behavior. Service configurations are also used by Google Cloud Console for
  89. displaying APIs and their settings, enabling/disabling APIs, and more.
  90. ## Operations
  91. Google Service Control uses the generic concept of an *operation*
  92. to represent the activities of a managed service, such as API calls and
  93. resource usage. Each operation is associated with a managed service and a
  94. specific service consumer, and has a set of properties that describe the
  95. operation, such as the API method name and resource usage amount. For more
  96. information, see the
  97. [Operation
  98. definition](/service-infrastructure/docs/service-control/reference/rest/v1/Operation). ##
  99. Check
  100. The
  101. [`services.check`](/service-infrastructure/docs/service-control/reference/rest/v1/services/check) method
  102. determines whether an operation should be allowed to proceed for a
  103. managed service.
  104. For example:
  105. * Check if the consumer is still active.
  106. * Check if the consumer has enabled the service.
  107. * Check if the API key is still valid.
  108. By performing multiple checks within a single method call, it provides
  109. better performance, higher reliability, and reduced development cost to
  110. service producers compared to checking with multiple backend systems.
  111. ## Report
  112. The
  113. [`services.report`](/service-infrastructure/docs/service-control/reference/rest/v1/services/report) method
  114. reports completed operations for a managed service to backend
  115. systems, such as logging and monitoring. The reported data can be seen in
  116. Google API Console and Google Cloud Console, and retrieved with
  117. appropriate APIs, such as the Stackdriver Logging and Stackdriver
  118. Monitoring APIs.
  119. ## Next steps
  120. * Read our [Getting Started
  121. guide](/service-infrastructure/docs/service-control/getting-started) to
  122. find out how to set up and use the Google Service Control API.
  123. backend:
  124. rules:
  125. - selector: google.api.servicecontrol.v1.QuotaController.AllocateQuota
  126. deadline: 10.0
  127. - selector: google.api.servicecontrol.v1.ServiceController.Check
  128. deadline: 5.0
  129. - selector: google.api.servicecontrol.v1.ServiceController.Report
  130. deadline: 16.0
  131. authentication:
  132. rules:
  133. - selector: google.api.servicecontrol.v1.QuotaController.AllocateQuota
  134. oauth:
  135. canonical_scopes: |-
  136. https://www.googleapis.com/auth/cloud-platform,
  137. https://www.googleapis.com/auth/servicecontrol
  138. - selector: google.api.servicecontrol.v1.ServiceController.Check
  139. oauth:
  140. canonical_scopes: |-
  141. https://www.googleapis.com/auth/cloud-platform,
  142. https://www.googleapis.com/auth/servicecontrol
  143. - selector: google.api.servicecontrol.v1.ServiceController.Report
  144. oauth:
  145. canonical_scopes: |-
  146. https://www.googleapis.com/auth/cloud-platform,
  147. https://www.googleapis.com/auth/servicecontrol