Sync updates to google.api package

Also adds endpoint.proto
This commit is contained in:
Jacob Geiger 2016-08-24 12:01:04 -07:00
parent 6712ffca40
commit 928a151b2f
17 changed files with 156 additions and 95 deletions

View File

@ -22,6 +22,7 @@ import "google/protobuf/descriptor.proto";
option java_multiple_files = true;
option java_outer_classname = "AnnotationsProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
extend google.protobuf.MethodOptions {
// See `HttpRule`.

View File

@ -21,6 +21,7 @@ import "google/api/annotations.proto";
option java_multiple_files = true;
option java_outer_classname = "AuthProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// `Authentication` defines the authentication configuration for an API.
@ -38,7 +39,9 @@ option java_package = "com.google.api";
// oauth:
// canonical_scopes: https://www.googleapis.com/auth/calendar.read
message Authentication {
// Individual rules for authentication.
// A list of authentication rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated AuthenticationRule rules = 3;
// Defines a set of authentication providers that a service supports.
@ -54,7 +57,6 @@ message Authentication {
//
// If a method doesn't have any auth requirements, request credentials will be
// ignored.
//
message AuthenticationRule {
// Selects the methods to which this rule applies.
//
@ -64,9 +66,13 @@ message AuthenticationRule {
// The requirements for OAuth credentials.
OAuthRequirements oauth = 2;
// Whether to allow requests without a credential. If quota is enabled, an
// API key is required for such request to pass the quota check.
// Whether to allow requests without a credential. The credential can be
// an OAuth token, Google cookies (first-party auth) or EndUserCreds.
//
// For requests without credentials, if the service control environment is
// specified, each incoming request **must** be associated with a service
// consumer. This can be done by passing an API key that belongs to a consumer
// project.
bool allow_without_credential = 5;
// Requirements for additional authentication providers.
@ -120,7 +126,6 @@ message AuthProvider {
// Please note that even though each of the canonical scopes is enough for a
// request to be accepted and passed to the backend, a request can still fail
// due to the backend requiring additional scopes or permissions.
//
message OAuthRequirements {
// The list of publicly documented OAuth scopes that are allowed access. An
// OAuth token containing any of these scopes will be accepted.

View File

@ -19,12 +19,14 @@ package google.api;
option java_multiple_files = true;
option java_outer_classname = "BackendProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// `Backend` defines the backend configuration for a service.
message Backend {
// A list of backend rules providing configuration for individual API
// elements.
// A list of API backend rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated BackendRule rules = 1;
}
@ -36,7 +38,6 @@ message BackendRule {
string selector = 1;
// The address of the API backend.
//
string address = 2;
// The number of seconds to wait for a response from a request. The

View File

@ -19,6 +19,7 @@ package google.api;
option java_multiple_files = true;
option java_outer_classname = "ContextProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// `Context` defines which contexts an API requests.
@ -39,7 +40,9 @@ option java_package = "com.google.api";
// Available context types are defined in package
// `google.rpc.context`.
message Context {
// List of rules for context, applicable to methods.
// A list of RPC context rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated ContextRule rules = 1;
}

View File

@ -19,12 +19,12 @@ package google.api;
option java_multiple_files = true;
option java_outer_classname = "ControlProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Selects and configures the service controller used by the service. The
// service controller handles features like abuse, quota, billing, logging,
// monitoring, etc.
//
message Control {
// The service control environment to use. If empty, no control plane
// feature (like quota and billing) will be enabled.

View File

@ -19,6 +19,7 @@ package google.api;
option java_multiple_files = true;
option java_outer_classname = "DocumentationProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// `Documentation` provides the information for describing a service.
@ -86,7 +87,9 @@ message Documentation {
// The top level pages for the documentation set.
repeated Page pages = 5;
// Documentation rules for individual elements of the service.
// A list of documentation rules that apply to individual API elements.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated DocumentationRule rules = 3;
// The URL to the root of documentation.

89
google/api/endpoint.proto Normal file
View File

@ -0,0 +1,89 @@
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.api;
import "google/api/annotations.proto";
option java_multiple_files = true;
option java_outer_classname = "EndpointProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// `Endpoint` describes a network endpoint that serves a set of APIs.
// A service may expose any number of endpoints, and all endpoints share the
// same service configuration, such as quota configuration and monitoring
// configuration.
//
// Example service configuration:
//
// name: library-example.googleapis.com
// endpoints:
// # Below entry makes 'google.example.library.v1.Library'
// # API be served from endpoint address library-example.googleapis.com.
// # It also allows HTTP OPTIONS calls to be passed to the backend, for
// # it to decide whether the subsequent cross-origin request is
// # allowed to proceed.
// - name: library-example.googleapis.com
// apis: google.example.library.v1.Library
// allow_cors: true
// # Below entry makes 'google.example.library.v1.Library'
// # API be served from endpoint address
// # google.example.library-example.v1.LibraryManager.
// - name: library-manager.googleapis.com
// apis: google.example.library.v1.LibraryManager
// # BNS address for a borg job. Can specify a task by appending
// # "/taskId" (e.g. "/0") to the job spec.
//
// Example OpenAPI extension for endpoint with allow_cors set to true:
//
// {
// "swagger": "2.0",
// "info": {
// "description": "A simple..."
// },
// "host": "MY_PROJECT_ID.appspot.com",
// "x-google-endpoints": [{
// "name": "MY_PROJECT_ID.appspot.com",
// "allow_cors": "true"
// }]
// }
message Endpoint {
// The canonical name of this endpoint.
string name = 1;
// DEPRECATED: This field is no longer supported. Instead of using aliases,
// please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intented
// alias.
//
// Additional names that this endpoint will be hosted on.
repeated string aliases = 2;
// The list of APIs served by this endpoint.
repeated string apis = 3;
// The list of features enabled on this endpoint.
repeated string features = 4;
// Allowing
// [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka
// cross-domain traffic, would allow the backends served from this endpoint to
// receive and respond to HTTP OPTIONS requests. The response will be used by
// the browser to determine whether the subsequent cross-origin request is
// allowed to proceed.
bool allow_cors = 5;
}

View File

@ -20,13 +20,16 @@ option cc_enable_arenas = true;
option java_multiple_files = true;
option java_outer_classname = "HttpProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Defines the HTTP configuration for a service. It contains a list of
// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
// to one or more HTTP REST API methods.
message Http {
// A list of HTTP rules for configuring the HTTP REST API methods.
// A list of HTTP configuration rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated HttpRule rules = 1;
}
@ -262,7 +265,8 @@ message HttpRule {
// The name of the request field whose value is mapped to the HTTP body, or
// `*` for mapping all fields not captured by the path pattern to the HTTP
// body. NOTE: the referred field must not be a repeated field.
// body. NOTE: the referred field must not be a repeated field and must be
// present at the top-level of response message type.
string body = 7;
// Additional HTTP bindings for the selector. Nested bindings must

View File

@ -16,9 +16,11 @@ syntax = "proto3";
package google.api;
option cc_enable_arenas = true;
option java_multiple_files = true;
option java_outer_classname = "LabelProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// A description of a label.

View File

@ -21,6 +21,7 @@ import "google/api/label.proto";
option java_multiple_files = true;
option java_outer_classname = "LogProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// A description of a log type. Example in YAML format:

View File

@ -21,6 +21,7 @@ import "google/api/annotations.proto";
option java_multiple_files = true;
option java_outer_classname = "LoggingProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Logging configuration of the service.
@ -54,7 +55,6 @@ option java_package = "com.google.api";
// - monitored_resource: library.googleapis.com/branch
// logs:
// - library.googleapis.com/activity_history
//
message Logging {
// Configuration of a specific logging destination (the producer project
// or the consumer project).

View File

@ -21,6 +21,7 @@ import "google/api/label.proto";
option java_multiple_files = true;
option java_outer_classname = "MetricProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Defines a metric type and its schema.
@ -30,14 +31,17 @@ message MetricDescriptor {
// Do not use this default value.
METRIC_KIND_UNSPECIFIED = 0;
// Instantaneous measurements of a varying quantity.
// An instantaneous measurement of a value.
GAUGE = 1;
// Changes over non-overlapping time intervals.
// The change in a value during a time interval.
DELTA = 2;
// Cumulative value over time intervals that can overlap.
// The overlapping intervals must have the same start time.
// A value accumulated over a time interval. Cumulative
// measurements in a time series should have the same start time
// and increasing end times, until an event resets the cumulative
// value to zero and sets a new start time for the following
// points.
CUMULATIVE = 3;
}

View File

@ -18,11 +18,12 @@ package google.api;
import "google/api/label.proto";
option cc_enable_arenas = true;
option java_multiple_files = true;
option java_outer_classname = "MonitoredResourceProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
option go_package = "google.golang.org/genproto/googleapis/api/monitoredres";
// An object that describes the schema of a [MonitoredResource][google.api.MonitoredResource] object using a
// type name and a set of labels. For example, the monitored resource
@ -44,10 +45,13 @@ message MonitoredResourceDescriptor {
// Required. The monitored resource type. For example, the type
// `"cloudsql_database"` represents databases in Google Cloud SQL.
// The maximum length of this value is 256 characters.
string type = 1;
// Optional. A concise name for the monitored resource type that might be
// displayed in user interfaces. For example, `"Google Cloud SQL Database"`.
// displayed in user interfaces. It should be a Title Cased Noun Phrase,
// without any article or other determiners. For example,
// `"Google Cloud SQL Database"`.
string display_name = 2;
// Optional. A detailed description of the monitored resource type that might
@ -71,7 +75,7 @@ message MonitoredResourceDescriptor {
// `"instance_id"` and `"zone"`:
//
// { "type": "gce_instance",
// "labels": { "instance_id": "my-instance",
// "labels": { "instance_id": "12345678901234",
// "zone": "us-central1-a" }}
message MonitoredResource {
// Required. The monitored resource type. This field must match

View File

@ -21,6 +21,7 @@ import "google/api/annotations.proto";
option java_multiple_files = true;
option java_outer_classname = "MonitoringProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Monitoring configuration of the service.
@ -60,7 +61,6 @@ option java_package = "com.google.api";
// metrics:
// - library.googleapis.com/book/returned_count
// - library.googleapis.com/book/overdue_count
//
message Monitoring {
// Configuration of a specific monitoring destination (the producer project
// or the consumer project).

View File

@ -19,11 +19,10 @@ package google.api;
import "google/api/annotations.proto";
import "google/api/auth.proto";
import "google/api/backend.proto";
import "google/api/billing.proto";
import "google/api/consumer.proto";
import "google/api/context.proto";
import "google/api/control.proto";
import "google/api/documentation.proto";
import "google/api/endpoint.proto";
import "google/api/http.proto";
import "google/api/label.proto";
import "google/api/log.proto";
@ -41,6 +40,7 @@ import "google/protobuf/wrappers.proto";
option java_multiple_files = true;
option java_outer_classname = "ServiceProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// `Service` is the root object of the configuration schema. It
@ -128,8 +128,10 @@ message Service {
// Configuration controlling usage of this service.
Usage usage = 15;
// Configuration of per-consumer project properties.
ProjectProperties project_properties = 17;
// Configuration for network endpoints. If this is empty, then an endpoint
// with the same name as the service is automatically generated to service all
// defined APIs.
repeated Endpoint endpoints = 18;
// Configuration for the service control plane.
Control control = 21;
@ -142,12 +144,8 @@ message Service {
// Defines the monitored resources used by this service. This is required
// by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
//
repeated MonitoredResourceDescriptor monitored_resources = 25;
// Billing configuration of the service.
Billing billing = 26;
// Logging configuration of the service.
Logging logging = 27;

View File

@ -19,6 +19,7 @@ package google.api;
option java_multiple_files = true;
option java_outer_classname = "SystemParameterProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// ### System parameter configuration
@ -37,7 +38,7 @@ message SystemParameters {
//
// Example: define api key and alt name for all methods
//
// SystemParameters
// system_parameters
// rules:
// - selector: "*"
// parameters:
@ -48,7 +49,7 @@ message SystemParameters {
//
// Example: define 2 api key names for a specific method.
//
// SystemParameters
// system_parameters
// rules:
// - selector: "/ListShelves"
// parameters:
@ -56,6 +57,8 @@ message SystemParameters {
// http_header: Api-Key1
// - name: api_key
// http_header: Api-Key2
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated SystemParameterRule rules = 1;
}

View File

@ -16,81 +16,24 @@ syntax = "proto3";
package google.api;
import "google/api/annotations.proto";
option java_multiple_files = true;
option java_outer_classname = "UsageProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Configuration controlling usage of a service.
message Usage {
// Service access types.
//
// Access to restricted API features is always controlled by
// [visibility][google.api.Visibility], independent of the ServiceAccess type.
//
enum ServiceAccess {
// The service can only be seen/used by users identified in the service's
// access control policy.
//
// If the service has not been whitelisted by your domain administrator
// for out-of-org publishing, then this mode will be treated like
// ORG_RESTRICTED.
RESTRICTED = 0;
// The service can be seen/used by anyone.
//
// If the service has not been whitelisted by your domain administrator
// for out-of-org publishing, then this mode will be treated like
// ORG_PUBLIC.
//
// The discovery document for the service will also be public and allow
// unregistered access.
PUBLIC = 1;
// The service can be seen/used by users identified in the service's
// access control policy and they are within the organization that owns the
// service.
//
// Access is further constrained to the group
// controlled by the administrator of the project/org that owns the
// service.
ORG_RESTRICTED = 2;
// The service can be seen/used by the group of users controlled by the
// administrator of the project/org that owns the service.
ORG_PUBLIC = 3;
}
// Controls which users can see or activate the service.
ServiceAccess service_access = 4;
// Requirements that must be satisfied before a consumer project can use the
// service. Each requirement is of the form <service.name>/<requirement-id>;
// for example 'serviceusage.googleapis.com/billing-enabled'.
repeated string requirements = 1;
// Services that must be activated in order for this service to be used.
// The set of services activated as a result of these relations are all
// activated in parallel with no guaranteed order of activation.
// Each string is a service name, e.g. `calendar.googleapis.com`.
repeated string depends_on_services = 2;
// Services that must be contacted before a consumer can begin using the
// service. Each service will be contacted in sequence, and, if any activation
// call fails, the entire activation will fail. Each hook is of the form
// <service.name>/<hook-id>, where <hook-id> is optional; for example:
// 'robotservice.googleapis.com/default'.
repeated string activation_hooks = 3;
// Services that must be contacted before a consumer can deactivate a
// service. Each service will be contacted in sequence, and, if any
// deactivation call fails, the entire deactivation will fail. Each hook is
// of the form <service.name>/<hook-id>, where <hook-id> is optional; for
// example:
// 'compute.googleapis.com/'.
repeated string deactivation_hooks = 5;
// Individual rules for configuring usage on selected methods.
// A list of usage rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated UsageRule rules = 6;
}