servicecontrol.yaml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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.v2.ServiceController
  7. documentation:
  8. summary: |-
  9. Provides admission control and telemetry reporting for services integrated
  10. with Service Infrastructure.
  11. overview: |-
  12. Google Service Control provides control plane functionality to managed
  13. services, such as logging, monitoring, and status checks. This page
  14. provides an overview of what it does and how it works.
  15. ## Why use Service Control?
  16. When you develop a cloud service, you typically start with the business
  17. requirements and the architecture design, then proceed with API definition
  18. and implementation. Before you put your service into production, you
  19. need to deal with many control plane issues:
  20. * How to control access to your service.
  21. * How to send logging and monitoring data to both consumers and producers.
  22. * How to create and manage dashboards to visualize this data.
  23. * How to automatically scale the control plane components with your
  24. service.
  25. Service Control is a mature and feature-rich control plane provider
  26. that addresses these needs with high efficiency, high scalability,
  27. and high availability. It provides a simple public API that can be
  28. accessed from anywhere using JSON REST and gRPC clients, so when you move
  29. your service from on-premise to a cloud provider, or from one cloud
  30. provider to another, you don't need to change the control plane provider.
  31. Services built using Google Cloud Endpoints already take advantage of
  32. Service Control. Cloud Endpoints sends logging and monitoring data
  33. through Google Service Control for every request arriving at its
  34. proxy. If you need to report any additional logging and monitoring data
  35. for your Cloud Endpoints service, you can call the Service Control API
  36. directly from your service.
  37. The Service Control API definition is open sourced and available on
  38. [GitHub](https://github.com/googleapis/googleapis/tree/master/google/api/servicecontrol). By
  39. changing the DNS name, you can easily use alternative implementations
  40. of the Service Control API.
  41. ## Architecture
  42. Google Service Control works with a set of *managed services* and their
  43. *operations* (activities), *checks* whether an operation is allowed to
  44. proceed, and *reports* completed operations. Behind the scenes, it
  45. leverages other
  46. Google Cloud services, such as
  47. [Google Service
  48. Management](https://cloud.google.com/service-infrastructure/docs/service-management/getting-started), [Stackdriver
  49. Logging](https://cloud.google.com/products/operations), and [Stackdriver
  50. Monitoring](https://cloud.google.com/monitoring), while hiding their
  51. 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`](https://cloud.google.com/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`](https://cloud.google.com/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](https://cloud.google.com/service-infrastructure/docs/service-control/reference/rest/v1/services) is
  76. a network service managed by
  77. [Google Service
  78. Management](https://cloud.google.com/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](https://cloud.google.com/service-infrastructure/docs/service-control/reference/rest/v1/Operation). ##
  99. Check
  100. The
  101. [`services.check`](https://cloud.google.com/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`](https://cloud.google.com/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](https://cloud.google.com/service-infrastructure/docs/service-control/getting-started)
  122. to find out how to set up and use the Google Service Control API.
  123. backend:
  124. rules:
  125. - selector: google.api.servicecontrol.v2.ServiceController.Check
  126. deadline: 5.0
  127. - selector: google.api.servicecontrol.v2.ServiceController.Report
  128. deadline: 5.0
  129. authentication:
  130. rules:
  131. - selector: google.api.servicecontrol.v2.ServiceController.Check
  132. oauth:
  133. canonical_scopes: |-
  134. https://www.googleapis.com/auth/cloud-platform,
  135. https://www.googleapis.com/auth/servicecontrol
  136. - selector: google.api.servicecontrol.v2.ServiceController.Report
  137. oauth:
  138. canonical_scopes: |-
  139. https://www.googleapis.com/auth/cloud-platform,
  140. https://www.googleapis.com/auth/servicecontrol