push all website files

This commit is contained in:
Jacob Levine
2019-01-06 13:14:45 -06:00
parent d7301e26c3
commit d2d5d4c04e
15662 changed files with 2166516 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// Copyright (c) 2015, 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/http.proto";
import "google/protobuf/descriptor.proto";
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
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`.
HttpRule http = 72295728;
}

View File

@@ -0,0 +1,181 @@
// Copyright 2018 Google LLC.
//
// 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 go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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.
//
// Example for an API targeted for external use:
//
// name: calendar.googleapis.com
// authentication:
// providers:
// - id: google_calendar_auth
// jwks_uri: https://www.googleapis.com/oauth2/v1/certs
// issuer: https://securetoken.google.com
// rules:
// - selector: "*"
// requirements:
// provider_id: google_calendar_auth
message 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.
repeated AuthProvider providers = 4;
}
// Authentication rules for the service.
//
// By default, if a method has any authentication requirements, every request
// must include a valid credential matching one of the requirements.
// It's an error to include more than one kind of credential in a single
// request.
//
// If a method doesn't have any auth requirements, request credentials will be
// ignored.
message AuthenticationRule {
// Selects the methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;
// The requirements for OAuth credentials.
OAuthRequirements oauth = 2;
// If true, the service accepts API keys without any other credential.
bool allow_without_credential = 5;
// Requirements for additional authentication providers.
repeated AuthRequirement requirements = 7;
}
// Configuration for an anthentication provider, including support for
// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
message AuthProvider {
// The unique identifier of the auth provider. It will be referred to by
// `AuthRequirement.provider_id`.
//
// Example: "bookstore_auth".
string id = 1;
// Identifies the principal that issued the JWT. See
// https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1
// Usually a URL or an email address.
//
// Example: https://securetoken.google.com
// Example: 1234567-compute@developer.gserviceaccount.com
string issuer = 2;
// URL of the provider's public key set to validate signature of the JWT. See
// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
// Optional if the key set document:
// - can be retrieved from
// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html
// of the issuer.
// - can be inferred from the email domain of the issuer (e.g. a Google service account).
//
// Example: https://www.googleapis.com/oauth2/v1/certs
string jwks_uri = 3;
// The list of JWT
// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
// that are allowed to access. A JWT containing any of these audiences will
// be accepted. When this setting is absent, only JWTs with audience
// "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]"
// will be accepted. For example, if no audiences are in the setting,
// LibraryService API will only accept JWTs with the following audience
// "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
//
// Example:
//
// audiences: bookstore_android.apps.googleusercontent.com,
// bookstore_web.apps.googleusercontent.com
string audiences = 4;
// Redirect URL if JWT token is required but no present or is expired.
// Implement authorizationUrl of securityDefinitions in OpenAPI spec.
string authorization_url = 5;
}
// OAuth scopes are a way to define data and permissions on data. For example,
// there are scopes defined for "Read-only access to Google Calendar" and
// "Access to Cloud Platform". Users can consent to a scope for an application,
// giving it permission to access that data on their behalf.
//
// OAuth scope specifications should be fairly coarse grained; a user will need
// to see and understand the text description of what your scope means.
//
// In most cases: use one or at most two OAuth scopes for an entire family of
// products. If your product has multiple APIs, you should probably be sharing
// the OAuth scope across all of those APIs.
//
// When you need finer grained OAuth consent screens: talk with your product
// management about how developers will use them in practice.
//
// 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.
//
// Example:
//
// canonical_scopes: https://www.googleapis.com/auth/calendar,
// https://www.googleapis.com/auth/calendar.read
string canonical_scopes = 1;
}
// User-defined authentication requirements, including support for
// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
message AuthRequirement {
// [id][google.api.AuthProvider.id] from authentication provider.
//
// Example:
//
// provider_id: bookstore_auth
string provider_id = 1;
// NOTE: This will be deprecated soon, once AuthProvider.audiences is
// implemented and accepted in all the runtime components.
//
// The list of JWT
// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
// that are allowed to access. A JWT containing any of these audiences will
// be accepted. When this setting is absent, only JWTs with audience
// "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]"
// will be accepted. For example, if no audiences are in the setting,
// LibraryService API will only accept JWTs with the following audience
// "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
//
// Example:
//
// audiences: bookstore_android.apps.googleusercontent.com,
// bookstore_web.apps.googleusercontent.com
string audiences = 2;
}

View File

@@ -0,0 +1,51 @@
// Copyright 2018 Google LLC.
//
// 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;
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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 API backend rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated BackendRule rules = 1;
}
// A backend rule provides configuration for an individual API element.
message BackendRule {
// Selects the methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
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 default
// deadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds.
double deadline = 3;
// Minimum deadline in seconds needed for this method. Calls having deadline
// value lower than this will be rejected.
double min_deadline = 4;
}

View File

@@ -0,0 +1,68 @@
// Copyright 2018 Google LLC.
//
// 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";
import "google/api/metric.proto";
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
option java_multiple_files = true;
option java_outer_classname = "BillingProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Billing related configuration of the service.
//
// The following example shows how to configure monitored resources and metrics
// for billing:
//
// monitored_resources:
// - type: library.googleapis.com/branch
// labels:
// - key: /city
// description: The city where the library branch is located in.
// - key: /name
// description: The name of the branch.
// metrics:
// - name: library.googleapis.com/book/borrowed_count
// metric_kind: DELTA
// value_type: INT64
// billing:
// consumer_destinations:
// - monitored_resource: library.googleapis.com/branch
// metrics:
// - library.googleapis.com/book/borrowed_count
message Billing {
// Configuration of a specific billing destination (Currently only support
// bill against consumer project).
message BillingDestination {
// The monitored resource type. The type must be defined in
// [Service.monitored_resources][google.api.Service.monitored_resources] section.
string monitored_resource = 1;
// Names of the metrics to report to this billing destination.
// Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
repeated string metrics = 2;
}
// Billing configurations for sending metrics to the consumer project.
// There can be multiple consumer destinations per service, each one must have
// a different monitored resource type. A metric can be used in at most
// one consumer destination.
repeated BillingDestination consumer_destinations = 8;
}

View File

@@ -0,0 +1,85 @@
// Copyright 2018 Google LLC.
//
// 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;
option go_package = "google.golang.org/genproto/googleapis/api/configchange;configchange";
option java_multiple_files = true;
option java_outer_classname = "ConfigChangeProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Output generated from semantically comparing two versions of a service
// configuration.
//
// Includes detailed information about a field that have changed with
// applicable advice about potential consequences for the change, such as
// backwards-incompatibility.
message ConfigChange {
// Object hierarchy path to the change, with levels separated by a '.'
// character. For repeated fields, an applicable unique identifier field is
// used for the index (usually selector, name, or id). For maps, the term
// 'key' is used. If the field has no unique identifier, the numeric index
// is used.
// Examples:
// - visibility.rules[selector=="google.LibraryService.CreateBook"].restriction
// - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value
// - logging.producer_destinations[0]
string element = 1;
// Value of the changed object in the old Service configuration,
// in JSON format. This field will not be populated if ChangeType == ADDED.
string old_value = 2;
// Value of the changed object in the new Service configuration,
// in JSON format. This field will not be populated if ChangeType == REMOVED.
string new_value = 3;
// The type for this change, either ADDED, REMOVED, or MODIFIED.
ChangeType change_type = 4;
// Collection of advice provided for this change, useful for determining the
// possible impact of this change.
repeated Advice advices = 5;
}
// Generated advice about this change, used for providing more
// information about how a change will affect the existing service.
message Advice {
// Useful description for why this advice was applied and what actions should
// be taken to mitigate any implied risks.
string description = 2;
}
// Classifies set of possible modifications to an object in the service
// configuration.
enum ChangeType {
// No value was provided.
CHANGE_TYPE_UNSPECIFIED = 0;
// The changed object exists in the 'new' service configuration, but not
// in the 'old' service configuration.
ADDED = 1;
// The changed object exists in the 'old' service configuration, but not
// in the 'new' service configuration.
REMOVED = 2;
// The changed object exists in both service configurations, but its value
// is different.
MODIFIED = 3;
}

View File

@@ -0,0 +1,83 @@
// 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;
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
option java_multiple_files = true;
option java_outer_classname = "ConsumerProto";
option java_package = "com.google.api";
// A descriptor for defining project properties for a service. One service may
// have many consumer projects, and the service may want to behave differently
// depending on some properties on the project. For example, a project may be
// associated with a school, or a business, or a government agency, a business
// type property on the project may affect how a service responds to the client.
// This descriptor defines which properties are allowed to be set on a project.
//
// Example:
//
// project_properties:
// properties:
// - name: NO_WATERMARK
// type: BOOL
// description: Allows usage of the API without watermarks.
// - name: EXTENDED_TILE_CACHE_PERIOD
// type: INT64
message ProjectProperties {
// List of per consumer project-specific properties.
repeated Property properties = 1;
}
// Defines project properties.
//
// API services can define properties that can be assigned to consumer projects
// so that backends can perform response customization without having to make
// additional calls or maintain additional storage. For example, Maps API
// defines properties that controls map tile cache period, or whether to embed a
// watermark in a result.
//
// These values can be set via API producer console. Only API providers can
// define and set these properties.
message Property {
// Supported data type of the property values
enum PropertyType {
// The type is unspecified, and will result in an error.
UNSPECIFIED = 0;
// The type is `int64`.
INT64 = 1;
// The type is `bool`.
BOOL = 2;
// The type is `string`.
STRING = 3;
// The type is 'double'.
DOUBLE = 4;
}
// The name of the property (a.k.a key).
string name = 1;
// The type of this property.
PropertyType type = 2;
// The description of the property
string description = 3;
}

View File

@@ -0,0 +1,63 @@
// Copyright 2017 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;
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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.
//
// Example:
//
// context:
// rules:
// - selector: "*"
// requested:
// - google.rpc.context.ProjectContext
// - google.rpc.context.OriginContext
//
// The above specifies that all methods in the API request
// `google.rpc.context.ProjectContext` and
// `google.rpc.context.OriginContext`.
//
// Available context types are defined in package
// `google.rpc.context`.
message Context {
// 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;
}
// A context rule provides information about the context for an individual API
// element.
message ContextRule {
// Selects the methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;
// A list of full type names of requested contexts.
repeated string requested = 2;
// A list of full type names of provided contexts.
repeated string provided = 3;
}

View File

@@ -0,0 +1,33 @@
// Copyright 2018 Google LLC.
//
// 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;
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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.
string environment = 1;
}

View File

@@ -0,0 +1,185 @@
// 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";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/api/distribution;distribution";
option java_multiple_files = true;
option java_outer_classname = "DistributionProto";
option java_package = "com.google.api";
// Distribution contains summary statistics for a population of values and,
// optionally, a histogram representing the distribution of those values across
// a specified set of histogram buckets.
//
// The summary statistics are the count, mean, sum of the squared deviation from
// the mean, the minimum, and the maximum of the set of population of values.
//
// The histogram is based on a sequence of buckets and gives a count of values
// that fall into each bucket. The boundaries of the buckets are given either
// explicitly or by specifying parameters for a method of computing them
// (buckets of fixed width or buckets of exponentially increasing width).
//
// Although it is not forbidden, it is generally a bad idea to include
// non-finite values (infinities or NaNs) in the population of values, as this
// will render the `mean` and `sum_of_squared_deviation` fields meaningless.
message Distribution {
// The range of the population values.
message Range {
// The minimum of the population values.
double min = 1;
// The maximum of the population values.
double max = 2;
}
// A Distribution may optionally contain a histogram of the values in the
// population. The histogram is given in `bucket_counts` as counts of values
// that fall into one of a sequence of non-overlapping buckets. The sequence
// of buckets is described by `bucket_options`.
//
// A bucket specifies an inclusive lower bound and exclusive upper bound for
// the values that are counted for that bucket. The upper bound of a bucket
// is strictly greater than the lower bound.
//
// The sequence of N buckets for a Distribution consists of an underflow
// bucket (number 0), zero or more finite buckets (number 1 through N - 2) and
// an overflow bucket (number N - 1). The buckets are contiguous: the lower
// bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1.
// The buckets span the whole range of finite values: lower bound of the
// underflow bucket is -infinity and the upper bound of the overflow bucket is
// +infinity. The finite buckets are so-called because both bounds are
// finite.
//
// `BucketOptions` describes bucket boundaries in one of three ways. Two
// describe the boundaries by giving parameters for a formula to generate
// boundaries and one gives the bucket boundaries explicitly.
//
// If `bucket_boundaries` is not given, then no `bucket_counts` may be given.
message BucketOptions {
// Specify a sequence of buckets that all have the same width (except
// overflow and underflow). Each bucket represents a constant absolute
// uncertainty on the specific value in the bucket.
//
// Defines `num_finite_buckets + 2` (= N) buckets with these boundaries for
// bucket `i`:
//
// Upper bound (0 <= i < N-1): offset + (width * i).
// Lower bound (1 <= i < N): offset + (width * (i - 1)).
message Linear {
// Must be greater than 0.
int32 num_finite_buckets = 1;
// Must be greater than 0.
double width = 2;
// Lower bound of the first bucket.
double offset = 3;
}
// Specify a sequence of buckets that have a width that is proportional to
// the value of the lower bound. Each bucket represents a constant relative
// uncertainty on a specific value in the bucket.
//
// Defines `num_finite_buckets + 2` (= N) buckets with these boundaries for
// bucket i:
//
// Upper bound (0 <= i < N-1): scale * (growth_factor ^ i).
// Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)).
message Exponential {
// Must be greater than 0.
int32 num_finite_buckets = 1;
// Must be greater than 1.
double growth_factor = 2;
// Must be greater than 0.
double scale = 3;
}
// A set of buckets with arbitrary widths.
//
// Defines `size(bounds) + 1` (= N) buckets with these boundaries for
// bucket i:
//
// Upper bound (0 <= i < N-1): bounds[i]
// Lower bound (1 <= i < N); bounds[i - 1]
//
// There must be at least one element in `bounds`. If `bounds` has only one
// element, there are no finite buckets, and that single element is the
// common boundary of the overflow and underflow buckets.
message Explicit {
// The values must be monotonically increasing.
repeated double bounds = 1;
}
// Exactly one of these three fields must be set.
oneof options {
// The linear bucket.
Linear linear_buckets = 1;
// The exponential buckets.
Exponential exponential_buckets = 2;
// The explicit buckets.
Explicit explicit_buckets = 3;
}
}
// The number of values in the population. Must be non-negative.
int64 count = 1;
// The arithmetic mean of the values in the population. If `count` is zero
// then this field must be zero.
double mean = 2;
// The sum of squared deviations from the mean of the values in the
// population. For values x_i this is:
//
// Sum[i=1..n]((x_i - mean)^2)
//
// Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition
// describes Welford's method for accumulating this sum in one pass.
//
// If `count` is zero then this field must be zero.
double sum_of_squared_deviation = 3;
// If specified, contains the range of the population values. The field
// must not be present if the `count` is zero.
Range range = 4;
// Defines the histogram bucket boundaries.
BucketOptions bucket_options = 6;
// If `bucket_options` is given, then the sum of the values in `bucket_counts`
// must equal the value in `count`. If `bucket_options` is not given, no
// `bucket_counts` fields may be given.
//
// Bucket counts are given in order under the numbering scheme described
// above (the underflow bucket has number 0; the finite buckets, if any,
// have numbers 1 through N-2; the overflow bucket has number N-1).
//
// The size of `bucket_counts` must be no greater than N as defined in
// `bucket_options`.
//
// Any suffix of trailing zero bucket_count fields may be omitted.
repeated int64 bucket_counts = 7;
}

View File

@@ -0,0 +1,157 @@
// Copyright 2018 Google LLC.
//
// 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;
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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.
//
// Example:
// <pre><code>documentation:
// summary: >
// The Google Calendar API gives access
// to most calendar features.
// pages:
// - name: Overview
// content: &#40;== include google/foo/overview.md ==&#41;
// - name: Tutorial
// content: &#40;== include google/foo/tutorial.md ==&#41;
// subpages;
// - name: Java
// content: &#40;== include google/foo/tutorial_java.md ==&#41;
// rules:
// - selector: google.calendar.Calendar.Get
// description: >
// ...
// - selector: google.calendar.Calendar.Put
// description: >
// ...
// </code></pre>
// Documentation is provided in markdown syntax. In addition to
// standard markdown features, definition lists, tables and fenced
// code blocks are supported. Section headers can be provided and are
// interpreted relative to the section nesting of the context where
// a documentation fragment is embedded.
//
// Documentation from the IDL is merged with documentation defined
// via the config at normalization time, where documentation provided
// by config rules overrides IDL provided.
//
// A number of constructs specific to the API platform are supported
// in documentation text.
//
// In order to reference a proto element, the following
// notation can be used:
// <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre>
// To override the display text used for the link, this can be used:
// <pre><code>&#91;display text]&#91;fully.qualified.proto.name]</code></pre>
// Text can be excluded from doc using the following notation:
// <pre><code>&#40;-- internal comment --&#41;</code></pre>
//
// A few directives are available in documentation. Note that
// directives must appear on a single line to be properly
// identified. The `include` directive includes a markdown file from
// an external source:
// <pre><code>&#40;== include path/to/file ==&#41;</code></pre>
// The `resource_for` directive marks a message to be the resource of
// a collection in REST view. If it is not specified, tools attempt
// to infer the resource from the operations in a collection:
// <pre><code>&#40;== resource_for v1.shelves.books ==&#41;</code></pre>
// The directive `suppress_warning` does not directly affect documentation
// and is documented together with service config validation.
message Documentation {
// A short summary of what the service does. Can only be provided by
// plain text.
string summary = 1;
// The top level pages for the documentation set.
repeated Page pages = 5;
// 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.
string documentation_root_url = 4;
// Declares a single overview page. For example:
// <pre><code>documentation:
// summary: ...
// overview: &#40;== include overview.md ==&#41;
// </code></pre>
// This is a shortcut for the following declaration (using pages style):
// <pre><code>documentation:
// summary: ...
// pages:
// - name: Overview
// content: &#40;== include overview.md ==&#41;
// </code></pre>
// Note: you cannot specify both `overview` field and `pages` field.
string overview = 2;
}
// A documentation rule provides information about individual API elements.
message DocumentationRule {
// The selector is a comma-separated list of patterns. Each pattern is a
// qualified name of the element which may end in "*", indicating a wildcard.
// Wildcards are only allowed at the end and for a whole component of the
// qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". To
// specify a default for all applicable elements, the whole pattern "*"
// is used.
string selector = 1;
// Description of the selected API(s).
string description = 2;
// Deprecation description of the selected element(s). It can be provided if an
// element is marked as `deprecated`.
string deprecation_description = 3;
}
// Represents a documentation page. A page can contain subpages to represent
// nested documentation set structure.
message Page {
// The name of the page. It will be used as an identity of the page to
// generate URI of the page, text of the link to this page in navigation,
// etc. The full page name (start from the root page name to this page
// concatenated with `.`) can be used as reference to the page in your
// documentation. For example:
// <pre><code>pages:
// - name: Tutorial
// content: &#40;== include tutorial.md ==&#41;
// subpages:
// - name: Java
// content: &#40;== include tutorial_java.md ==&#41;
// </code></pre>
// You can reference `Java` page using Markdown reference link syntax:
// `[Java][Tutorial.Java]`.
string name = 1;
// The Markdown content of the page. You can use <code>&#40;== include {path} ==&#41;</code>
// to include content from a Markdown file.
string content = 2;
// Subpages of this page. The order of subpages specified here will be
// honored in the generated docset.
repeated Page subpages = 3;
}

View File

@@ -0,0 +1,71 @@
// Copyright 2018 Google LLC.
//
// 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 go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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
// 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 intended
// aliases.
//
// Additional names that this endpoint will be hosted on.
repeated string aliases = 2;
// The list of features enabled on this endpoint.
repeated string features = 4;
// The specification of an Internet routable address of API frontend that will
// handle requests to this [API Endpoint](https://cloud.google.com/apis/design/glossary).
// It should be either a valid IPv4 address or a fully-qualified domain name.
// For example, "8.8.8.8" or "myservice.appspot.com".
string target = 101;
// 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

@@ -0,0 +1,40 @@
// Copyright 2018 Google LLC.
//
// 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;
option go_package = "google.golang.org/genproto/googleapis/api;api";
option java_multiple_files = true;
option java_outer_classname = "AuthorizationConfigProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Configuration of authorization.
//
// This section determines the authorization provider, if unspecified, then no
// authorization check will be done.
//
// Example:
//
// experimental:
// authorization:
// provider: firebaserules.googleapis.com
message AuthorizationConfig {
// The name of the authorization provider, such as
// firebaserules.googleapis.com.
string provider = 1;
}

View File

@@ -0,0 +1,34 @@
// Copyright 2018 Google LLC.
//
// 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";
import "google/api/experimental/authorization_config.proto";
option go_package = "google.golang.org/genproto/googleapis/api;api";
option java_multiple_files = true;
option java_outer_classname = "ExperimentalProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Experimental service configuration. These configuration options can
// only be used by whitelisted users.
message Experimental {
// Authorization configuration.
AuthorizationConfig authorization = 8;
}

View File

@@ -0,0 +1,313 @@
// Copyright 2018 Google LLC
//
// 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;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
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 an API 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 configuration rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated HttpRule rules = 1;
// When set to true, URL path parmeters will be fully URI-decoded except in
// cases of single segment matches in reserved expansion, where "%2F" will be
// left encoded.
//
// The default behavior is to not decode RFC 6570 reserved characters in multi
// segment matches.
bool fully_decode_reserved_expansion = 2;
}
// `HttpRule` defines the mapping of an RPC method to one or more HTTP
// REST API methods. The mapping specifies how different portions of the RPC
// request message are mapped to URL path, URL query parameters, and
// HTTP request body. The mapping is typically specified as an
// `google.api.http` annotation on the RPC method,
// see "google/api/annotations.proto" for details.
//
// The mapping consists of a field specifying the path template and
// method kind. The path template can refer to fields in the request
// message, as in the example below which describes a REST GET
// operation on a resource collection of messages:
//
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
// }
// }
// message GetMessageRequest {
// message SubMessage {
// string subfield = 1;
// }
// string message_id = 1; // mapped to the URL
// SubMessage sub = 2; // `sub.subfield` is url-mapped
// }
// message Message {
// string text = 1; // content of the resource
// }
//
// The same http annotation can alternatively be expressed inside the
// `GRPC API Configuration` YAML file.
//
// http:
// rules:
// - selector: <proto_package_name>.Messaging.GetMessage
// get: /v1/messages/{message_id}/{sub.subfield}
//
// This definition enables an automatic, bidrectional mapping of HTTP
// JSON to RPC. Example:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
//
// In general, not only fields but also field paths can be referenced
// from a path pattern. Fields mapped to the path pattern cannot be
// repeated and must have a primitive (non-message) type.
//
// Any fields in the request message which are not bound by the path
// pattern automatically become (optional) HTTP query
// parameters. Assume the following definition of the request message:
//
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http).get = "/v1/messages/{message_id}";
// }
// }
// message GetMessageRequest {
// message SubMessage {
// string subfield = 1;
// }
// string message_id = 1; // mapped to the URL
// int64 revision = 2; // becomes a parameter
// SubMessage sub = 3; // `sub.subfield` becomes a parameter
// }
//
//
// This enables a HTTP JSON to RPC mapping as below:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
//
// Note that fields which are mapped to HTTP parameters must have a
// primitive type or a repeated primitive type. Message types are not
// allowed. In the case of a repeated type, the parameter can be
// repeated in the URL, as in `...?param=A&param=B`.
//
// For HTTP method kinds which allow a request body, the `body` field
// specifies the mapping. Consider a REST update method on the
// message resource collection:
//
//
// service Messaging {
// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
// option (google.api.http) = {
// put: "/v1/messages/{message_id}"
// body: "message"
// };
// }
// }
// message UpdateMessageRequest {
// string message_id = 1; // mapped to the URL
// Message message = 2; // mapped to the body
// }
//
//
// The following HTTP JSON to RPC mapping is enabled, where the
// representation of the JSON in the request body is determined by
// protos JSON encoding:
//
// HTTP | RPC
// -----|-----
// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
//
// The special name `*` can be used in the body mapping to define that
// every field not bound by the path template should be mapped to the
// request body. This enables the following alternative definition of
// the update method:
//
// service Messaging {
// rpc UpdateMessage(Message) returns (Message) {
// option (google.api.http) = {
// put: "/v1/messages/{message_id}"
// body: "*"
// };
// }
// }
// message Message {
// string message_id = 1;
// string text = 2;
// }
//
//
// The following HTTP JSON to RPC mapping is enabled:
//
// HTTP | RPC
// -----|-----
// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
//
// Note that when using `*` in the body mapping, it is not possible to
// have HTTP parameters, as all fields not bound by the path end in
// the body. This makes this option more rarely used in practice of
// defining REST APIs. The common usage of `*` is in custom methods
// which don't use the URL at all for transferring data.
//
// It is possible to define multiple HTTP methods for one RPC by using
// the `additional_bindings` option. Example:
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http) = {
// get: "/v1/messages/{message_id}"
// additional_bindings {
// get: "/v1/users/{user_id}/messages/{message_id}"
// }
// };
// }
// }
// message GetMessageRequest {
// string message_id = 1;
// string user_id = 2;
// }
//
//
// This enables the following two alternative HTTP JSON to RPC
// mappings:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
//
// # Rules for HTTP mapping
//
// The rules for mapping HTTP path, query parameters, and body fields
// to the request message are as follows:
//
// 1. The `body` field specifies either `*` or a field path, or is
// omitted. If omitted, it indicates there is no HTTP request body.
// 2. Leaf fields (recursive expansion of nested messages in the
// request) can be classified into three types:
// (a) Matched in the URL template.
// (b) Covered by body (if body is `*`, everything except (a) fields;
// else everything under the body field)
// (c) All other fields.
// 3. URL query parameters found in the HTTP request are mapped to (c) fields.
// 4. Any body sent with an HTTP request can contain only (b) fields.
//
// The syntax of the path template is as follows:
//
// Template = "/" Segments [ Verb ] ;
// Segments = Segment { "/" Segment } ;
// Segment = "*" | "**" | LITERAL | Variable ;
// Variable = "{" FieldPath [ "=" Segments ] "}" ;
// FieldPath = IDENT { "." IDENT } ;
// Verb = ":" LITERAL ;
//
// The syntax `*` matches a single path segment. The syntax `**` matches zero
// or more path segments, which must be the last part of the path except the
// `Verb`. The syntax `LITERAL` matches literal text in the path.
//
// The syntax `Variable` matches part of the URL path as specified by its
// template. A variable template must not contain other variables. If a variable
// matches a single path segment, its template may be omitted, e.g. `{var}`
// is equivalent to `{var=*}`.
//
// If a variable contains exactly one path segment, such as `"{var}"` or
// `"{var=*}"`, when such a variable is expanded into a URL path, all characters
// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
// Discovery Document as `{var}`.
//
// If a variable contains one or more path segments, such as `"{var=foo/*}"`
// or `"{var=**}"`, when such a variable is expanded into a URL path, all
// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
// show up in the Discovery Document as `{+var}`.
//
// NOTE: While the single segment variable matches the semantics of
// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
// Simple String Expansion, the multi segment variable **does not** match
// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
// does not expand special characters like `?` and `#`, which would lead
// to invalid URLs.
//
// NOTE: the field paths in variables and in the `body` must not refer to
// repeated fields or map fields.
message HttpRule {
// Selects methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;
// Determines the URL pattern is matched by this rules. This pattern can be
// used with any of the {get|put|post|delete|patch} methods. A custom method
// can be defined using the 'custom' field.
oneof pattern {
// Used for listing and getting information about resources.
string get = 2;
// Used for updating a resource.
string put = 3;
// Used for creating a resource.
string post = 4;
// Used for deleting a resource.
string delete = 5;
// Used for updating a resource.
string patch = 6;
// The custom pattern is used for specifying an HTTP method that is not
// included in the `pattern` field, such as HEAD, or "*" to leave the
// HTTP method unspecified for this rule. The wild-card rule is useful
// for services that provide content to Web (HTML) clients.
CustomHttpPattern custom = 8;
}
// 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 and must be
// present at the top-level of request message type.
string body = 7;
// Additional HTTP bindings for the selector. Nested bindings must
// not contain an `additional_bindings` field themselves (that is,
// the nesting may only be one level deep).
repeated HttpRule additional_bindings = 11;
}
// A custom pattern is used for defining custom HTTP verb.
message CustomHttpPattern {
// The name of this custom HTTP verb.
string kind = 1;
// The path matched by this custom verb.
string path = 2;
}

View File

@@ -0,0 +1,76 @@
// Copyright 2018 Google LLC.
//
// 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/protobuf/any.proto";
option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody";
option java_multiple_files = true;
option java_outer_classname = "HttpBodyProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Message that represents an arbitrary HTTP body. It should only be used for
// payload formats that can't be represented as JSON, such as raw binary or
// an HTML page.
//
//
// This message can be used both in streaming and non-streaming API methods in
// the request as well as the response.
//
// It can be used as a top-level request field, which is convenient if one
// wants to extract parameters from either the URL or HTTP template into the
// request fields and also want access to the raw HTTP body.
//
// Example:
//
// message GetResourceRequest {
// // A unique request id.
// string request_id = 1;
//
// // The raw HTTP body is bound to this field.
// google.api.HttpBody http_body = 2;
// }
//
// service ResourceService {
// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
// rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty);
// }
//
// Example with streaming methods:
//
// service CaldavService {
// rpc GetCalendar(stream google.api.HttpBody)
// returns (stream google.api.HttpBody);
// rpc UpdateCalendar(stream google.api.HttpBody)
// returns (stream google.api.HttpBody);
// }
//
// Use of this type only changes how the request and response bodies are
// handled, all other features will continue to work unchanged.
message HttpBody {
// The HTTP Content-Type string representing the content type of the body.
string content_type = 1;
// HTTP body binary data.
bytes data = 2;
// Application specific response metadata. Must be set in the first response
// for streaming APIs.
repeated google.protobuf.Any extensions = 3;
}

View File

@@ -0,0 +1,49 @@
// Copyright 2018 Google LLC.
//
// 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;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/label;label";
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.
message LabelDescriptor {
// Value types that can be used as label values.
enum ValueType {
// A variable-length string. This is the default.
STRING = 0;
// Boolean; true or false.
BOOL = 1;
// A 64-bit signed integer.
INT64 = 2;
}
// The label key.
string key = 1;
// The type of data that can be assigned to the label.
ValueType value_type = 2;
// A human-readable description for the label.
string description = 3;
}

View File

@@ -0,0 +1,55 @@
// Copyright 2018 Google LLC.
//
// 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/label.proto";
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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:
//
// - name: library.googleapis.com/activity_history
// description: The history of borrowing and returning library items.
// display_name: Activity
// labels:
// - key: /customer_id
// description: Identifier of a library customer
message LogDescriptor {
// The name of the log. It must be less than 512 characters long and can
// include the following characters: upper- and lower-case alphanumeric
// characters [A-Za-z0-9], and punctuation characters including
// slash, underscore, hyphen, period [/_-.].
string name = 1;
// The set of labels that are available to describe a specific log entry.
// Runtime requests that contain labels not specified here are
// considered invalid.
repeated LabelDescriptor labels = 2;
// A human-readable description of this log. This information appears in
// the documentation and can contain details.
string description = 3;
// The human-readable name for this log. This information appears on
// the user interface and should be concise.
string display_name = 4;
}

View File

@@ -0,0 +1,83 @@
// Copyright 2018 Google LLC.
//
// 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 go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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.
//
// The following example shows how to configure logs to be sent to the
// producer and consumer projects. In the example, the `activity_history`
// log is sent to both the producer and consumer projects, whereas the
// `purchase_history` log is only sent to the producer project.
//
// monitored_resources:
// - type: library.googleapis.com/branch
// labels:
// - key: /city
// description: The city where the library branch is located in.
// - key: /name
// description: The name of the branch.
// logs:
// - name: activity_history
// labels:
// - key: /customer_id
// - name: purchase_history
// logging:
// producer_destinations:
// - monitored_resource: library.googleapis.com/branch
// logs:
// - activity_history
// - purchase_history
// consumer_destinations:
// - monitored_resource: library.googleapis.com/branch
// logs:
// - activity_history
message Logging {
// Configuration of a specific logging destination (the producer project
// or the consumer project).
message LoggingDestination {
// The monitored resource type. The type must be defined in the
// [Service.monitored_resources][google.api.Service.monitored_resources] section.
string monitored_resource = 3;
// Names of the logs to be sent to this destination. Each name must
// be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
// not a domain scoped name, it will be automatically prefixed with
// the service name followed by "/".
repeated string logs = 1;
}
// Logging configurations for sending logs to the producer project.
// There can be multiple producer destinations, each one must have a
// different monitored resource type. A log can be used in at most
// one producer destination.
repeated LoggingDestination producer_destinations = 1;
// Logging configurations for sending logs to the consumer project.
// There can be multiple consumer destinations, each one must have a
// different monitored resource type. A log can be used in at most
// one consumer destination.
repeated LoggingDestination consumer_destinations = 2;
}

View File

@@ -0,0 +1,192 @@
// Copyright 2018 Google LLC.
//
// 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/label.proto";
option go_package = "google.golang.org/genproto/googleapis/api/metric;metric";
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. Once a metric descriptor is created,
// deleting or altering it stops data collection and makes the metric type's
// existing data unusable.
message MetricDescriptor {
// The kind of measurement. It describes how the data is reported.
enum MetricKind {
// Do not use this default value.
METRIC_KIND_UNSPECIFIED = 0;
// An instantaneous measurement of a value.
GAUGE = 1;
// The change in a value during a time interval.
DELTA = 2;
// 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;
}
// The value type of a metric.
enum ValueType {
// Do not use this default value.
VALUE_TYPE_UNSPECIFIED = 0;
// The value is a boolean.
// This value type can be used only if the metric kind is `GAUGE`.
BOOL = 1;
// The value is a signed 64-bit integer.
INT64 = 2;
// The value is a double precision floating point number.
DOUBLE = 3;
// The value is a text string.
// This value type can be used only if the metric kind is `GAUGE`.
STRING = 4;
// The value is a [`Distribution`][google.api.Distribution].
DISTRIBUTION = 5;
// The value is money.
MONEY = 6;
}
// The resource name of the metric descriptor.
string name = 1;
// The metric type, including its DNS name prefix. The type is not
// URL-encoded. All user-defined custom metric types have the DNS name
// `custom.googleapis.com`. Metric types should use a natural hierarchical
// grouping. For example:
//
// "custom.googleapis.com/invoice/paid/amount"
// "appengine.googleapis.com/http/server/response_latencies"
string type = 8;
// The set of labels that can be used to describe a specific
// instance of this metric type. For example, the
// `appengine.googleapis.com/http/server/response_latencies` metric
// type has a label for the HTTP response code, `response_code`, so
// you can look at latencies for successful responses or just
// for responses that failed.
repeated LabelDescriptor labels = 2;
// Whether the metric records instantaneous values, changes to a value, etc.
// Some combinations of `metric_kind` and `value_type` might not be supported.
MetricKind metric_kind = 3;
// Whether the measurement is an integer, a floating-point number, etc.
// Some combinations of `metric_kind` and `value_type` might not be supported.
ValueType value_type = 4;
// The unit in which the metric value is reported. It is only applicable
// if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
// supported units are a subset of [The Unified Code for Units of
// Measure](http://unitsofmeasure.org/ucum.html) standard:
//
// **Basic units (UNIT)**
//
// * `bit` bit
// * `By` byte
// * `s` second
// * `min` minute
// * `h` hour
// * `d` day
//
// **Prefixes (PREFIX)**
//
// * `k` kilo (10**3)
// * `M` mega (10**6)
// * `G` giga (10**9)
// * `T` tera (10**12)
// * `P` peta (10**15)
// * `E` exa (10**18)
// * `Z` zetta (10**21)
// * `Y` yotta (10**24)
// * `m` milli (10**-3)
// * `u` micro (10**-6)
// * `n` nano (10**-9)
// * `p` pico (10**-12)
// * `f` femto (10**-15)
// * `a` atto (10**-18)
// * `z` zepto (10**-21)
// * `y` yocto (10**-24)
// * `Ki` kibi (2**10)
// * `Mi` mebi (2**20)
// * `Gi` gibi (2**30)
// * `Ti` tebi (2**40)
//
// **Grammar**
//
// The grammar also includes these connectors:
//
// * `/` division (as an infix operator, e.g. `1/s`).
// * `.` multiplication (as an infix operator, e.g. `GBy.d`)
//
// The grammar for a unit is as follows:
//
// Expression = Component { "." Component } { "/" Component } ;
//
// Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
// | Annotation
// | "1"
// ;
//
// Annotation = "{" NAME "}" ;
//
// Notes:
//
// * `Annotation` is just a comment if it follows a `UNIT` and is
// equivalent to `1` if it is used alone. For examples,
// `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
// * `NAME` is a sequence of non-blank printable ASCII characters not
// containing '{' or '}'.
// * `1` represents dimensionless value 1, such as in `1/s`.
// * `%` represents dimensionless value 1/100, and annotates values giving
// a percentage.
string unit = 5;
// A detailed description of the metric, which can be used in documentation.
string description = 6;
// A concise name for the metric, which can be displayed in user interfaces.
// Use sentence case without an ending period, for example "Request count".
// This field is optional but it is recommended to be set for any metrics
// associated with user-visible concepts, such as Quota.
string display_name = 7;
}
// A specific metric, identified by specifying values for all of the
// labels of a [`MetricDescriptor`][google.api.MetricDescriptor].
message Metric {
// An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
// For example, `custom.googleapis.com/invoice/paid/amount`.
string type = 3;
// The set of label values that uniquely identify this metric. All
// labels listed in the `MetricDescriptor` must be assigned values.
map<string, string> labels = 2;
}

View File

@@ -0,0 +1,116 @@
// Copyright 2018 Google LLC.
//
// 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/label.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/monitoredres;monitoredres";
option java_multiple_files = true;
option java_outer_classname = "MonitoredResourceProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// 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
// descriptor for Google Compute Engine VM instances has a type of
// `"gce_instance"` and specifies the use of the labels `"instance_id"` and
// `"zone"` to identify particular VM instances.
//
// Different APIs can support different monitored resource types. APIs generally
// provide a `list` method that returns the monitored resource descriptors used
// by the API.
message MonitoredResourceDescriptor {
// Optional. The resource name of the monitored resource descriptor:
// `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where
// {type} is the value of the `type` field in this object and
// {project_id} is a project ID that provides API-specific context for
// accessing the type. APIs that do not use project information can use the
// resource name format `"monitoredResourceDescriptors/{type}"`.
string name = 5;
// 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. 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
// be used in documentation.
string description = 3;
// Required. A set of labels used to describe instances of this monitored
// resource type. For example, an individual Google Cloud SQL database is
// identified by values for the labels `"database_id"` and `"zone"`.
repeated LabelDescriptor labels = 4;
}
// An object representing a resource that can be used for monitoring, logging,
// billing, or other purposes. Examples include virtual machine instances,
// databases, and storage devices such as disks. The `type` field identifies a
// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object that describes the resource's
// schema. Information in the `labels` field identifies the actual resource and
// its attributes according to the schema. For example, a particular Compute
// Engine VM instance could be represented by the following object, because the
// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for `"gce_instance"` has labels
// `"instance_id"` and `"zone"`:
//
// { "type": "gce_instance",
// "labels": { "instance_id": "12345678901234",
// "zone": "us-central1-a" }}
message MonitoredResource {
// Required. The monitored resource type. This field must match
// the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
// example, the type of a Compute Engine VM instance is `gce_instance`.
string type = 1;
// Required. Values for all of the labels listed in the associated monitored
// resource descriptor. For example, Compute Engine VM instances use the
// labels `"project_id"`, `"instance_id"`, and `"zone"`.
map<string, string> labels = 2;
}
// Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] object.
// [MonitoredResource][google.api.MonitoredResource] objects contain the minimum set of information to
// uniquely identify a monitored resource instance. There is some other useful
// auxiliary metadata. Google Stackdriver Monitoring & Logging uses an ingestion
// pipeline to extract metadata for cloud resources of all types , and stores
// the metadata in this message.
message MonitoredResourceMetadata {
// Output only. Values for predefined system metadata labels.
// System labels are a kind of metadata extracted by Google Stackdriver.
// Stackdriver determines what system labels are useful and how to obtain
// their values. Some examples: "machine_image", "vpc", "subnet_id",
// "security_group", "name", etc.
// System label values can be only strings, Boolean values, or a list of
// strings. For example:
//
// { "name": "my-test-instance",
// "security_group": ["a", "b", "c"],
// "spot_instance": false }
google.protobuf.Struct system_labels = 1;
// Output only. A map of user-defined metadata labels.
map<string, string> user_labels = 2;
}

View File

@@ -0,0 +1,89 @@
// Copyright 2018 Google LLC.
//
// 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 go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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.
//
// The example below shows how to configure monitored resources and metrics
// for monitoring. In the example, a monitored resource and two metrics are
// defined. The `library.googleapis.com/book/returned_count` metric is sent
// to both producer and consumer projects, whereas the
// `library.googleapis.com/book/overdue_count` metric is only sent to the
// consumer project.
//
// monitored_resources:
// - type: library.googleapis.com/branch
// labels:
// - key: /city
// description: The city where the library branch is located in.
// - key: /name
// description: The name of the branch.
// metrics:
// - name: library.googleapis.com/book/returned_count
// metric_kind: DELTA
// value_type: INT64
// labels:
// - key: /customer_id
// - name: library.googleapis.com/book/overdue_count
// metric_kind: GAUGE
// value_type: INT64
// labels:
// - key: /customer_id
// monitoring:
// producer_destinations:
// - monitored_resource: library.googleapis.com/branch
// metrics:
// - library.googleapis.com/book/returned_count
// consumer_destinations:
// - monitored_resource: library.googleapis.com/branch
// 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).
message MonitoringDestination {
// The monitored resource type. The type must be defined in
// [Service.monitored_resources][google.api.Service.monitored_resources] section.
string monitored_resource = 1;
// Names of the metrics to report to this monitoring destination.
// Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
repeated string metrics = 2;
}
// Monitoring configurations for sending metrics to the producer project.
// There can be multiple producer destinations, each one must have a
// different monitored resource type. A metric can be used in at most
// one producer destination.
repeated MonitoringDestination producer_destinations = 1;
// Monitoring configurations for sending metrics to the consumer project.
// There can be multiple consumer destinations, each one must have a
// different monitored resource type. A metric can be used in at most
// one consumer destination.
repeated MonitoringDestination consumer_destinations = 2;
}

View File

@@ -0,0 +1,259 @@
// Copyright 2017 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 go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
option java_multiple_files = true;
option java_outer_classname = "QuotaProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Quota configuration helps to achieve fairness and budgeting in service
// usage.
//
// The quota configuration works this way:
// - The service configuration defines a set of metrics.
// - For API calls, the quota.metric_rules maps methods to metrics with
// corresponding costs.
// - The quota.limits defines limits on the metrics, which will be used for
// quota checks at runtime.
//
// An example quota configuration in yaml format:
//
// quota:
// limits:
//
// - name: apiWriteQpsPerProject
// metric: library.googleapis.com/write_calls
// unit: "1/min/{project}" # rate limit for consumer projects
// values:
// STANDARD: 10000
//
// # The metric rules bind all methods to the read_calls metric,
// # except for the UpdateBook and DeleteBook methods. These two methods
// # are mapped to the write_calls metric, with the UpdateBook method
// # consuming at twice rate as the DeleteBook method.
// metric_rules:
// - selector: "*"
// metric_costs:
// library.googleapis.com/read_calls: 1
// - selector: google.example.library.v1.LibraryService.UpdateBook
// metric_costs:
// library.googleapis.com/write_calls: 2
// - selector: google.example.library.v1.LibraryService.DeleteBook
// metric_costs:
// library.googleapis.com/write_calls: 1
//
// Corresponding Metric definition:
//
// metrics:
// - name: library.googleapis.com/read_calls
// display_name: Read requests
// metric_kind: DELTA
// value_type: INT64
//
// - name: library.googleapis.com/write_calls
// display_name: Write requests
// metric_kind: DELTA
// value_type: INT64
//
message Quota {
// List of `QuotaLimit` definitions for the service.
//
// Used by metric-based quotas only.
repeated QuotaLimit limits = 3;
// List of `MetricRule` definitions, each one mapping a selected method to one
// or more metrics.
//
// Used by metric-based quotas only.
repeated MetricRule metric_rules = 4;
}
// Bind API methods to metrics. Binding a method to a metric causes that
// metric's configured quota, billing, and monitoring behaviors to apply to the
// method call.
//
// Used by metric-based quotas only.
message MetricRule {
// Selects the methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;
// Metrics to update when the selected methods are called, and the associated
// cost applied to each metric.
//
// The key of the map is the metric name, and the values are the amount
// increased for the metric against which the quota limits are defined.
// The value must not be negative.
map<string, int64> metric_costs = 2;
}
// `QuotaLimit` defines a specific limit that applies over a specified duration
// for a limit type. There can be at most one limit for a duration and limit
// type combination defined within a `QuotaGroup`.
message QuotaLimit {
// Name of the quota limit. The name is used to refer to the limit when
// overriding the default limit on per-consumer basis.
//
// For group-based quota limits, the name must be unique within the quota
// group. If a name is not provided, it will be generated from the limit_by
// and duration fields.
//
// For metric-based quota limits, the name must be provided, and it must be
// unique within the service. The name can only include alphanumeric
// characters as well as '-'.
//
// The maximum length of the limit name is 64 characters.
//
// The name of a limit is used as a unique identifier for this limit.
// Therefore, once a limit has been put into use, its name should be
// immutable. You can use the display_name field to provide a user-friendly
// name for the limit. The display name can be evolved over time without
// affecting the identity of the limit.
string name = 6;
// Optional. User-visible, extended description for this quota limit.
// Should be used only when more context is needed to understand this limit
// than provided by the limit's display name (see: `display_name`).
string description = 2;
// Default number of tokens that can be consumed during the specified
// duration. This is the number of tokens assigned when a client
// application developer activates the service for his/her project.
//
// Specifying a value of 0 will block all requests. This can be used if you
// are provisioning quota to selected consumers and blocking others.
// Similarly, a value of -1 will indicate an unlimited quota. No other
// negative values are allowed.
//
// Used by group-based quotas only.
int64 default_limit = 3;
// Maximum number of tokens that can be consumed during the specified
// duration. Client application developers can override the default limit up
// to this maximum. If specified, this value cannot be set to a value less
// than the default limit. If not specified, it is set to the default limit.
//
// To allow clients to apply overrides with no upper bound, set this to -1,
// indicating unlimited maximum quota.
//
// Used by group-based quotas only.
int64 max_limit = 4;
// Free tier value displayed in the Developers Console for this limit.
// The free tier is the number of tokens that will be subtracted from the
// billed amount when billing is enabled.
// This field can only be set on a limit with duration "1d", in a billable
// group; it is invalid on any other limit. If this field is not set, it
// defaults to 0, indicating that there is no free tier for this service.
//
// Used by group-based quotas only.
int64 free_tier = 7;
// Duration of this limit in textual notation. Example: "100s", "24h", "1d".
// For duration longer than a day, only multiple of days is supported. We
// support only "100s" and "1d" for now. Additional support will be added in
// the future. "0" indicates indefinite duration.
//
// Used by group-based quotas only.
string duration = 5;
// The name of the metric this quota limit applies to. The quota limits with
// the same metric will be checked together during runtime. The metric must be
// defined within the service config.
//
// Used by metric-based quotas only.
string metric = 8;
// Specify the unit of the quota limit. It uses the same syntax as
// [Metric.unit][]. The supported unit kinds are determined by the quota
// backend system.
//
// The [Google Service Control](https://cloud.google.com/service-control)
// supports the following unit components:
// * One of the time intevals:
// * "/min" for quota every minute.
// * "/d" for quota every 24 hours, starting 00:00 US Pacific Time.
// * Otherwise the quota won't be reset by time, such as storage limit.
// * One and only one of the granted containers:
// * "/{organization}" quota for an organization.
// * "/{project}" quota for a project.
// * "/{folder}" quota for a folder.
// * "/{resource}" quota for a universal resource.
// * Zero or more quota segmentation dimension. Not all combos are valid.
// * "/{region}" quota for every region. Not to be used with time intervals.
// * Otherwise the resources granted on the target is not segmented.
// * "/{zone}" quota for every zone. Not to be used with time intervals.
// * Otherwise the resources granted on the target is not segmented.
// * "/{resource}" quota for a resource associated with a project or org.
//
// Here are some examples:
// * "1/min/{project}" for quota per minute per project.
// * "1/min/{user}" for quota per minute per user.
// * "1/min/{organization}" for quota per minute per organization.
//
// Note: the order of unit components is insignificant.
// The "1" at the beginning is required to follow the metric unit syntax.
//
// Used by metric-based quotas only.
string unit = 9;
// Tiered limit values. Also allows for regional or zone overrides for these
// values if "/{region}" or "/{zone}" is specified in the unit field.
//
// Currently supported tiers from low to high:
// VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH
//
// To apply different limit values for users according to their tiers, specify
// the values for the tiers you want to differentiate. For example:
// {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}
//
// The limit value for each tier is optional except for the tier STANDARD.
// The limit value for an unspecified tier falls to the value of its next
// tier towards tier STANDARD. For the above example, the limit value for tier
// STANDARD is 500.
//
// To apply the same limit value for all users, just specify limit value for
// tier STANDARD. For example: {STANDARD:500}.
//
// To apply a regional overide for a tier, add a map entry with key
// "<TIER>/<region>", where <region> is a region name. Similarly, for a zone
// override, add a map entry with key "<TIER>/{zone}".
// Further, a wildcard can be used at the end of a zone name in order to
// specify zone level overrides. For example:
// LOW: 10, STANDARD: 50, HIGH: 100,
// LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,
// LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80
//
// The regional overrides tier set for each region must be the same as
// the tier set for default limit values. Same rule applies for zone overrides
// tier as well.
//
// Used by metric-based quotas only.
map<string, int64> values = 10;
// User-visible display name for this limit.
// Optional. If not set, the UI will provide a default display name based on
// the quota configuration. This field can be used to override the default
// display name generated from the configuration.
string display_name = 12;
}

View File

@@ -0,0 +1,178 @@
// Copyright 2017 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";
import "google/api/auth.proto";
import "google/api/backend.proto";
import "google/api/billing.proto";
import "google/api/context.proto";
import "google/api/control.proto";
import "google/api/documentation.proto";
import "google/api/endpoint.proto";
import "google/api/experimental/experimental.proto";
import "google/api/http.proto";
import "google/api/label.proto";
import "google/api/log.proto";
import "google/api/logging.proto";
import "google/api/metric.proto";
import "google/api/monitored_resource.proto";
import "google/api/monitoring.proto";
import "google/api/quota.proto";
import "google/api/source_info.proto";
import "google/api/system_parameter.proto";
import "google/api/usage.proto";
import "google/protobuf/any.proto";
import "google/protobuf/api.proto";
import "google/protobuf/type.proto";
import "google/protobuf/wrappers.proto";
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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 Google service configuration schema. It
// describes basic information about a service, such as the name and the
// title, and delegates other aspects to sub-sections. Each sub-section is
// either a proto message or a repeated proto message that configures a
// specific aspect, such as auth. See each proto message definition for details.
//
// Example:
//
// type: google.api.Service
// config_version: 3
// name: calendar.googleapis.com
// title: Google Calendar API
// apis:
// - name: google.calendar.v3.Calendar
// authentication:
// providers:
// - id: google_calendar_auth
// jwks_uri: https://www.googleapis.com/oauth2/v1/certs
// issuer: https://securetoken.google.com
// rules:
// - selector: "*"
// requirements:
// provider_id: google_calendar_auth
message Service {
// The semantic version of the service configuration. The config version
// affects the interpretation of the service configuration. For example,
// certain features are enabled by default for certain config versions.
// The latest config version is `3`.
google.protobuf.UInt32Value config_version = 20;
// The DNS address at which this service is available,
// e.g. `calendar.googleapis.com`.
string name = 1;
// A unique ID for a specific instance of this message, typically assigned
// by the client for tracking purpose. If empty, the server may choose to
// generate one instead.
string id = 33;
// The product title for this service.
string title = 2;
// The Google project that owns this service.
string producer_project_id = 22;
// A list of API interfaces exported by this service. Only the `name` field
// of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
// author, as the remaining fields will be derived from the IDL during the
// normalization process. It is an error to specify an API interface here
// which cannot be resolved against the associated IDL files.
repeated google.protobuf.Api apis = 3;
// A list of all proto message types included in this API service.
// Types referenced directly or indirectly by the `apis` are
// automatically included. Messages which are not referenced but
// shall be included, such as types used by the `google.protobuf.Any` type,
// should be listed here by name. Example:
//
// types:
// - name: google.protobuf.Int32
repeated google.protobuf.Type types = 4;
// A list of all enum types included in this API service. Enums
// referenced directly or indirectly by the `apis` are automatically
// included. Enums which are not referenced but shall be included
// should be listed here by name. Example:
//
// enums:
// - name: google.someapi.v1.SomeEnum
repeated google.protobuf.Enum enums = 5;
// Additional API documentation.
Documentation documentation = 6;
// API backend configuration.
Backend backend = 8;
// HTTP configuration.
Http http = 9;
// Quota configuration.
Quota quota = 10;
// Auth configuration.
Authentication authentication = 11;
// Context configuration.
Context context = 12;
// Configuration controlling usage of this service.
Usage usage = 15;
// 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;
// Defines the logs used by this service.
repeated LogDescriptor logs = 23;
// Defines the metrics used by this service.
repeated MetricDescriptor metrics = 24;
// 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.
Billing billing = 26;
// Logging configuration.
Logging logging = 27;
// Monitoring configuration.
Monitoring monitoring = 28;
// System parameter configuration.
SystemParameters system_parameters = 29;
// Output only. The source information for this configuration if available.
SourceInfo source_info = 37;
// Experimental configuration.
Experimental experimental = 101;
}

View File

@@ -0,0 +1,95 @@
// Copyright 2017 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.servicecontrol.v1;
import "google/api/annotations.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
option java_multiple_files = true;
option java_outer_classname = "CheckErrorProto";
option java_package = "com.google.api.servicecontrol.v1";
// Defines the errors to be returned in
// [google.api.servicecontrol.v1.CheckResponse.check_errors][google.api.servicecontrol.v1.CheckResponse.check_errors].
message CheckError {
// Error codes for Check responses.
enum Code {
// This is never used in `CheckResponse`.
ERROR_CODE_UNSPECIFIED = 0;
// The consumer's project id was not found.
// Same as [google.rpc.Code.NOT_FOUND][].
NOT_FOUND = 5;
// The consumer doesn't have access to the specified resource.
// Same as [google.rpc.Code.PERMISSION_DENIED][].
PERMISSION_DENIED = 7;
// Quota check failed. Same as [google.rpc.Code.RESOURCE_EXHAUSTED][].
RESOURCE_EXHAUSTED = 8;
// The consumer hasn't activated the service.
SERVICE_NOT_ACTIVATED = 104;
// The consumer cannot access the service because billing is disabled.
BILLING_DISABLED = 107;
// The consumer's project has been marked as deleted (soft deletion).
PROJECT_DELETED = 108;
// The consumer's project number or id does not represent a valid project.
PROJECT_INVALID = 114;
// The IP address of the consumer is invalid for the specific consumer
// project.
IP_ADDRESS_BLOCKED = 109;
// The referer address of the consumer request is invalid for the specific
// consumer project.
REFERER_BLOCKED = 110;
// The client application of the consumer request is invalid for the
// specific consumer project.
CLIENT_APP_BLOCKED = 111;
// The consumer's API key is invalid.
API_KEY_INVALID = 105;
// The consumer's API Key has expired.
API_KEY_EXPIRED = 112;
// The consumer's API Key was not found in config record.
API_KEY_NOT_FOUND = 113;
// The backend server for looking up project id/number is unavailable.
NAMESPACE_LOOKUP_UNAVAILABLE = 300;
// The backend server for checking service status is unavailable.
SERVICE_STATUS_UNAVAILABLE = 301;
// The backend server for checking billing status is unavailable.
BILLING_STATUS_UNAVAILABLE = 302;
}
// The error code.
Code code = 1;
// Free-form text providing details on the error cause of the error.
string detail = 2;
}

View File

@@ -0,0 +1,159 @@
// Copyright 2017 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.servicecontrol.v1;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
option java_multiple_files = true;
option java_outer_classname = "DistributionProto";
option java_package = "com.google.api.servicecontrol.v1";
// Distribution represents a frequency distribution of double-valued sample
// points. It contains the size of the population of sample points plus
// additional optional information:
//
// - the arithmetic mean of the samples
// - the minimum and maximum of the samples
// - the sum-squared-deviation of the samples, used to compute variance
// - a histogram of the values of the sample points
message Distribution {
// Describing buckets with constant width.
message LinearBuckets {
// The number of finite buckets. With the underflow and overflow buckets,
// the total number of buckets is `num_finite_buckets` + 2.
// See comments on `bucket_options` for details.
int32 num_finite_buckets = 1;
// The i'th linear bucket covers the interval
// [offset + (i-1) * width, offset + i * width)
// where i ranges from 1 to num_finite_buckets, inclusive.
// Must be strictly positive.
double width = 2;
// The i'th linear bucket covers the interval
// [offset + (i-1) * width, offset + i * width)
// where i ranges from 1 to num_finite_buckets, inclusive.
double offset = 3;
}
// Describing buckets with exponentially growing width.
message ExponentialBuckets {
// The number of finite buckets. With the underflow and overflow buckets,
// the total number of buckets is `num_finite_buckets` + 2.
// See comments on `bucket_options` for details.
int32 num_finite_buckets = 1;
// The i'th exponential bucket covers the interval
// [scale * growth_factor^(i-1), scale * growth_factor^i)
// where i ranges from 1 to num_finite_buckets inclusive.
// Must be larger than 1.0.
double growth_factor = 2;
// The i'th exponential bucket covers the interval
// [scale * growth_factor^(i-1), scale * growth_factor^i)
// where i ranges from 1 to num_finite_buckets inclusive.
// Must be > 0.
double scale = 3;
}
// Describing buckets with arbitrary user-provided width.
message ExplicitBuckets {
// 'bound' is a list of strictly increasing boundaries between
// buckets. Note that a list of length N-1 defines N buckets because
// of fenceposting. See comments on `bucket_options` for details.
//
// The i'th finite bucket covers the interval
// [bound[i-1], bound[i])
// where i ranges from 1 to bound_size() - 1. Note that there are no
// finite buckets at all if 'bound' only contains a single element; in
// that special case the single bound defines the boundary between the
// underflow and overflow buckets.
//
// bucket number lower bound upper bound
// i == 0 (underflow) -inf bound[i]
// 0 < i < bound_size() bound[i-1] bound[i]
// i == bound_size() (overflow) bound[i-1] +inf
repeated double bounds = 1;
}
// The total number of samples in the distribution. Must be >= 0.
int64 count = 1;
// The arithmetic mean of the samples in the distribution. If `count` is
// zero then this field must be zero.
double mean = 2;
// The minimum of the population of values. Ignored if `count` is zero.
double minimum = 3;
// The maximum of the population of values. Ignored if `count` is zero.
double maximum = 4;
// The sum of squared deviations from the mean:
// Sum[i=1..count]((x_i - mean)^2)
// where each x_i is a sample values. If `count` is zero then this field
// must be zero, otherwise validation of the request fails.
double sum_of_squared_deviation = 5;
// The number of samples in each histogram bucket. `bucket_counts` are
// optional. If present, they must sum to the `count` value.
//
// The buckets are defined below in `bucket_option`. There are N buckets.
// `bucket_counts[0]` is the number of samples in the underflow bucket.
// `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
// in each of the finite buckets. And `bucket_counts[N] is the number
// of samples in the overflow bucket. See the comments of `bucket_option`
// below for more details.
//
// Any suffix of trailing zeros may be omitted.
repeated int64 bucket_counts = 6;
// Defines the buckets in the histogram. `bucket_option` and `bucket_counts`
// must be both set, or both unset.
//
// Buckets are numbered in the range of [0, N], with a total of N+1 buckets.
// There must be at least two buckets (a single-bucket histogram gives
// no information that isn't already provided by `count`).
//
// The first bucket is the underflow bucket which has a lower bound
// of -inf. The last bucket is the overflow bucket which has an
// upper bound of +inf. All other buckets (if any) are called "finite"
// buckets because they have finite lower and upper bounds. As described
// below, there are three ways to define the finite buckets.
//
// (1) Buckets with constant width.
// (2) Buckets with exponentially growing widths.
// (3) Buckets with arbitrary user-provided widths.
//
// In all cases, the buckets cover the entire real number line (-inf,
// +inf). Bucket upper bounds are exclusive and lower bounds are
// inclusive. The upper bound of the underflow bucket is equal to the
// lower bound of the smallest finite bucket; the lower bound of the
// overflow bucket is equal to the upper bound of the largest finite
// bucket.
oneof bucket_option {
// Buckets with constant width.
LinearBuckets linear_buckets = 7;
// Buckets with exponentially growing width.
ExponentialBuckets exponential_buckets = 8;
// Buckets with arbitrary user-provided width.
ExplicitBuckets explicit_buckets = 9;
}
}

View File

@@ -0,0 +1,67 @@
// Copyright 2017 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.servicecontrol.v1;
import "google/api/annotations.proto";
import "google/logging/type/log_severity.proto";
import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
option java_multiple_files = true;
option java_outer_classname = "LogEntryProto";
option java_package = "com.google.api.servicecontrol.v1";
// An individual log entry.
message LogEntry {
// Required. The log to which this log entry belongs. Examples: `"syslog"`,
// `"book_log"`.
string name = 10;
// The time the event described by the log entry occurred. If
// omitted, defaults to operation start time.
google.protobuf.Timestamp timestamp = 11;
// The severity of the log entry. The default value is
// `LogSeverity.DEFAULT`.
google.logging.type.LogSeverity severity = 12;
// A unique ID for the log entry used for deduplication. If omitted,
// the implementation will generate one based on operation_id.
string insert_id = 4;
// A set of user-defined (key, value) data that provides additional
// information about the log entry.
map<string, string> labels = 13;
// The log entry payload, which can be one of multiple types.
oneof payload {
// The log entry payload, represented as a protocol buffer that is
// expressed as a JSON object. The only accepted type currently is
// [AuditLog][google.cloud.audit.AuditLog].
google.protobuf.Any proto_payload = 2;
// The log entry payload, represented as a Unicode string (UTF-8).
string text_payload = 3;
// The log entry payload, represented as a structure that
// is expressed as a JSON object.
google.protobuf.Struct struct_payload = 6;
}
}

View File

@@ -0,0 +1,78 @@
// Copyright 2017 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.servicecontrol.v1;
import "google/api/annotations.proto";
import "google/api/servicecontrol/v1/distribution.proto";
import "google/protobuf/timestamp.proto";
import "google/type/money.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
option java_multiple_files = true;
option java_outer_classname = "MetricValueSetProto";
option java_package = "com.google.api.servicecontrol.v1";
// Represents a single metric value.
message MetricValue {
// The labels describing the metric value.
// See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
// the overriding relationship.
map<string, string> labels = 1;
// The start of the time period over which this metric value's measurement
// applies. The time period has different semantics for different metric
// types (cumulative, delta, and gauge). See the metric definition
// documentation in the service configuration for details.
google.protobuf.Timestamp start_time = 2;
// The end of the time period over which this metric value's measurement
// applies.
google.protobuf.Timestamp end_time = 3;
// The value. The type of value used in the request must
// agree with the metric definition in the service configuration, otherwise
// the MetricValue is rejected.
oneof value {
// A boolean value.
bool bool_value = 4;
// A signed 64-bit integer value.
int64 int64_value = 5;
// A double precision floating point value.
double double_value = 6;
// A text string value.
string string_value = 7;
// A distribution value.
Distribution distribution_value = 8;
}
}
// Represents a set of metric values in the same metric.
// Each metric value in the set should have a unique combination of start time,
// end time, and label values.
message MetricValueSet {
// The metric name defined in the service configuration.
string metric_name = 1;
// The values in this metric.
repeated MetricValue metric_values = 2;
}

View File

@@ -0,0 +1,112 @@
// Copyright 2017 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.servicecontrol.v1;
import "google/api/annotations.proto";
import "google/api/servicecontrol/v1/log_entry.proto";
import "google/api/servicecontrol/v1/metric_value.proto";
import "google/protobuf/timestamp.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
option java_multiple_files = true;
option java_outer_classname = "OperationProto";
option java_package = "com.google.api.servicecontrol.v1";
// Represents information regarding an operation.
message Operation {
// Defines the importance of the data contained in the operation.
enum Importance {
// The API implementation may cache and aggregate the data.
// The data may be lost when rare and unexpected system failures occur.
LOW = 0;
// The API implementation doesn't cache and aggregate the data.
// If the method returns successfully, it's guaranteed that the data has
// been persisted in durable storage.
HIGH = 1;
}
// Identity of the operation. This must be unique within the scope of the
// service that generated the operation. If the service calls
// Check() and Report() on the same operation, the two calls should carry
// the same id.
//
// UUID version 4 is recommended, though not required.
// In scenarios where an operation is computed from existing information
// and an idempotent id is desirable for deduplication purpose, UUID version 5
// is recommended. See RFC 4122 for details.
string operation_id = 1;
// Fully qualified name of the operation. Reserved for future use.
string operation_name = 2;
// Identity of the consumer who is using the service.
// This field should be filled in for the operations initiated by a
// consumer, but not for service-initiated operations that are
// not related to a specific consumer.
//
// This can be in one of the following formats:
// project:<project_id>,
// project_number:<project_number>,
// api_key:<api_key>.
string consumer_id = 3;
// Required. Start time of the operation.
google.protobuf.Timestamp start_time = 4;
// End time of the operation.
// Required when the operation is used in [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
// but optional when the operation is used in [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
google.protobuf.Timestamp end_time = 5;
// Labels describing the operation. Only the following labels are allowed:
//
// - Labels describing monitored resources as defined in
// the service configuration.
// - Default labels of metric values. When specified, labels defined in the
// metric value override these default.
// - The following labels defined by Google Cloud Platform:
// - `cloud.googleapis.com/location` describing the location where the
// operation happened,
// - `servicecontrol.googleapis.com/user_agent` describing the user agent
// of the API request,
// - `servicecontrol.googleapis.com/service_agent` describing the service
// used to handle the API request (e.g. ESP),
// - `servicecontrol.googleapis.com/platform` describing the platform
// where the API is served (e.g. GAE, GCE, GKE).
map<string, string> labels = 6;
// Represents information about this operation. Each MetricValueSet
// corresponds to a metric defined in the service configuration.
// The data type used in the MetricValueSet must agree with
// the data type specified in the metric definition.
//
// Within a single operation, it is not allowed to have more than one
// MetricValue instances that have the same metric names and identical
// label value combinations. If a request has such duplicated MetricValue
// instances, the entire request is rejected with
// an invalid argument error.
repeated MetricValueSet metric_value_sets = 7;
// Represents information to be logged.
repeated LogEntry log_entries = 8;
// DO NOT USE. This is an experimental field.
Importance importance = 11;
}

View File

@@ -0,0 +1,202 @@
// Copyright 2017 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.servicecontrol.v1;
import "google/api/annotations.proto";
import "google/api/servicecontrol/v1/metric_value.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
option java_multiple_files = true;
option java_outer_classname = "QuotaControllerProto";
option java_package = "com.google.api.servicecontrol.v1";
// [Google Quota Control API](/service-control/overview)
//
// Allows clients to allocate and release quota against a [managed
// service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
service QuotaController {
// Attempts to allocate quota for the specified consumer. It should be called
// before the operation is executed.
//
// This method requires the `servicemanagement.services.quota`
// permission on the specified service. For more information, see
// [Cloud IAM](https://cloud.google.com/iam).
//
// **NOTE:** The client **must** fail-open on server errors `INTERNAL`,
// `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system
// reliability, the server may inject these errors to prohibit any hard
// dependency on the quota functionality.
rpc AllocateQuota(AllocateQuotaRequest) returns (AllocateQuotaResponse) {
option (google.api.http) = { post: "/v1/services/{service_name}:allocateQuota" body: "*" };
}
}
// Request message for the AllocateQuota method.
message AllocateQuotaRequest {
// Name of the service as specified in the service configuration. For example,
// `"pubsub.googleapis.com"`.
//
// See [google.api.Service][google.api.Service] for the definition of a service name.
string service_name = 1;
// Operation that describes the quota allocation.
QuotaOperation allocate_operation = 2;
// Specifies which version of service configuration should be used to process
// the request. If unspecified or no matching version can be found, the latest
// one will be used.
string service_config_id = 4;
}
// Represents information regarding a quota operation.
message QuotaOperation {
// Supported quota modes.
enum QuotaMode {
// Guard against implicit default. Must not be used.
UNSPECIFIED = 0;
// For AllocateQuota request, allocates quota for the amount specified in
// the service configuration or specified using the quota metrics. If the
// amount is higher than the available quota, allocation error will be
// returned and no quota will be allocated.
NORMAL = 1;
// The operation allocates quota for the amount specified in the service
// configuration or specified using the quota metrics. If the amount is
// higher than the available quota, request does not fail but all available
// quota will be allocated.
BEST_EFFORT = 2;
// For AllocateQuota request, only checks if there is enough quota
// available and does not change the available quota. No lock is placed on
// the available quota either.
CHECK_ONLY = 3;
}
// Identity of the operation. This is expected to be unique within the scope
// of the service that generated the operation, and guarantees idempotency in
// case of retries.
//
// UUID version 4 is recommended, though not required. In scenarios where an
// operation is computed from existing information and an idempotent id is
// desirable for deduplication purpose, UUID version 5 is recommended. See
// RFC 4122 for details.
string operation_id = 1;
// Fully qualified name of the API method for which this quota operation is
// requested. This name is used for matching quota rules or metric rules and
// billing status rules defined in service configuration. This field is not
// required if the quota operation is performed on non-API resources.
//
// Example of an RPC method name:
// google.example.library.v1.LibraryService.CreateShelf
string method_name = 2;
// Identity of the consumer for whom this quota operation is being performed.
//
// This can be in one of the following formats:
// project:<project_id>,
// project_number:<project_number>,
// api_key:<api_key>.
string consumer_id = 3;
// Labels describing the operation.
map<string, string> labels = 4;
// Represents information about this operation. Each MetricValueSet
// corresponds to a metric defined in the service configuration.
// The data type used in the MetricValueSet must agree with
// the data type specified in the metric definition.
//
// Within a single operation, it is not allowed to have more than one
// MetricValue instances that have the same metric names and identical
// label value combinations. If a request has such duplicated MetricValue
// instances, the entire request is rejected with
// an invalid argument error.
repeated MetricValueSet quota_metrics = 5;
// Quota mode for this operation.
QuotaMode quota_mode = 6;
}
// Response message for the AllocateQuota method.
message AllocateQuotaResponse {
// The same operation_id value used in the AllocateQuotaRequest. Used for
// logging and diagnostics purposes.
string operation_id = 1;
// Indicates the decision of the allocate.
repeated QuotaError allocate_errors = 2;
// Quota metrics to indicate the result of allocation. Depending on the
// request, one or more of the following metrics will be included:
//
// 1. Per quota group or per quota metric incremental usage will be specified
// using the following delta metric :
// "serviceruntime.googleapis.com/api/consumer/quota_used_count"
//
// 2. The quota limit reached condition will be specified using the following
// boolean metric :
// "serviceruntime.googleapis.com/quota/exceeded"
repeated MetricValueSet quota_metrics = 3;
// ID of the actual config used to process the request.
string service_config_id = 4;
}
// Represents error information for [QuotaOperation][google.api.servicecontrol.v1.QuotaOperation].
message QuotaError {
// Error codes related to project config validations are deprecated since the
// quota controller methods do not perform these validations. Instead services
// have to call the Check method, without quota_properties field, to perform
// these validations before calling the quota controller methods. These
// methods check only for project deletion to be wipe out compliant.
enum Code {
// This is never used.
UNSPECIFIED = 0;
// Quota allocation failed.
// Same as [google.rpc.Code.RESOURCE_EXHAUSTED][].
RESOURCE_EXHAUSTED = 8;
// Consumer cannot access the service because the service requires active
// billing.
BILLING_NOT_ACTIVE = 107;
// Consumer's project has been marked as deleted (soft deletion).
PROJECT_DELETED = 108;
// Specified API key is invalid.
API_KEY_INVALID = 105;
// Specified API Key has expired.
API_KEY_EXPIRED = 112;
}
// Error code.
Code code = 1;
// Subject to whom this error applies. See the specific enum for more details
// on this field. For example, "clientip:<ip address of client>" or
// "project:<Google developer project id>".
string subject = 2;
// Free-form text that provides details on the cause of the error.
string description = 3;
}

View File

@@ -0,0 +1,185 @@
// Copyright 2017 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.servicecontrol.v1;
import "google/api/annotations.proto";
import "google/api/servicecontrol/v1/check_error.proto";
import "google/api/servicecontrol/v1/operation.proto";
import "google/rpc/status.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
option java_multiple_files = true;
option java_outer_classname = "ServiceControllerProto";
option java_package = "com.google.api.servicecontrol.v1";
option objc_class_prefix = "GASC";
// [Google Service Control API](/service-control/overview)
//
// Lets clients check and report operations against a [managed
// service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
service ServiceController {
// Checks an operation with Google Service Control to decide whether
// the given operation should proceed. It should be called before the
// operation is executed.
//
// If feasible, the client should cache the check results and reuse them for
// 60 seconds. In case of server errors, the client can rely on the cached
// results for longer time.
//
// NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the size limit of 64KB.
//
// This method requires the `servicemanagement.services.check` permission
// on the specified service. For more information, see
// [Google Cloud IAM](https://cloud.google.com/iam).
rpc Check(CheckRequest) returns (CheckResponse) {
option (google.api.http) = { post: "/v1/services/{service_name}:check" body: "*" };
}
// Reports operation results to Google Service Control, such as logs and
// metrics. It should be called after an operation is completed.
//
// If feasible, the client should aggregate reporting data for up to 5
// seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
// reduce data loss during client crashes. Clients should carefully choose
// the aggregation time window to avoid data loss risk more than 0.01%
// for business and compliance reasons.
//
// NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has the size limit of 1MB.
//
// This method requires the `servicemanagement.services.report` permission
// on the specified service. For more information, see
// [Google Cloud IAM](https://cloud.google.com/iam).
rpc Report(ReportRequest) returns (ReportResponse) {
option (google.api.http) = { post: "/v1/services/{service_name}:report" body: "*" };
}
}
// Request message for the Check method.
message CheckRequest {
// The service name as specified in its service configuration. For example,
// `"pubsub.googleapis.com"`.
//
// See
// [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
// for the definition of a service name.
string service_name = 1;
// The operation to be checked.
Operation operation = 2;
// Specifies which version of service configuration should be used to process
// the request.
//
// If unspecified or no matching version can be found, the
// latest one will be used.
string service_config_id = 4;
}
// Response message for the Check method.
message CheckResponse {
message CheckInfo {
// Consumer info of this check.
ConsumerInfo consumer_info = 2;
}
// `ConsumerInfo` provides information about the consumer project.
message ConsumerInfo {
// The Google cloud project number, e.g. 1234567890. A value of 0 indicates
// no project number is found.
int64 project_number = 1;
}
// The same operation_id value used in the [CheckRequest][google.api.servicecontrol.v1.CheckRequest].
// Used for logging and diagnostics purposes.
string operation_id = 1;
// Indicate the decision of the check.
//
// If no check errors are present, the service should process the operation.
// Otherwise the service should use the list of errors to determine the
// appropriate action.
repeated CheckError check_errors = 2;
// The actual config id used to process the request.
string service_config_id = 5;
// Feedback data returned from the server during processing a Check request.
CheckInfo check_info = 6;
}
// Request message for the Report method.
message ReportRequest {
// The service name as specified in its service configuration. For example,
// `"pubsub.googleapis.com"`.
//
// See
// [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
// for the definition of a service name.
string service_name = 1;
// Operations to be reported.
//
// Typically the service should report one operation per request.
// Putting multiple operations into a single request is allowed, but should
// be used only when multiple operations are natually available at the time
// of the report.
//
// If multiple operations are in a single request, the total request size
// should be no larger than 1MB. See [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors] for
// partial failure behavior.
repeated Operation operations = 2;
// Specifies which version of service config should be used to process the
// request.
//
// If unspecified or no matching version can be found, the
// latest one will be used.
string service_config_id = 3;
}
// Response message for the Report method.
message ReportResponse {
// Represents the processing error of one [Operation][google.api.servicecontrol.v1.Operation] in the request.
message ReportError {
// The [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id] value from the request.
string operation_id = 1;
// Details of the error when processing the [Operation][google.api.servicecontrol.v1.Operation].
google.rpc.Status status = 2;
}
// Partial failures, one for each `Operation` in the request that failed
// processing. There are three possible combinations of the RPC status:
//
// 1. The combination of a successful RPC status and an empty `report_errors`
// list indicates a complete success where all `Operations` in the
// request are processed successfully.
// 2. The combination of a successful RPC status and a non-empty
// `report_errors` list indicates a partial success where some
// `Operations` in the request succeeded. Each
// `Operation` that failed processing has a corresponding item
// in this list.
// 3. A failed RPC status indicates a general non-deterministic failure.
// When this happens, it's impossible to know which of the
// 'Operations' in the request succeeded or failed.
repeated ReportError report_errors = 1;
// The actual config id used to process the request.
string service_config_id = 2;
}

View File

@@ -0,0 +1,302 @@
// Copyright 2018 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.servicemanagement.v1;
import "google/api/annotations.proto";
import "google/api/config_change.proto";
import "google/api/metric.proto";
import "google/api/service.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.Cloud.ServiceManagement.V1";
option go_package = "google.golang.org/genproto/googleapis/api/servicemanagement/v1;servicemanagement";
option java_multiple_files = true;
option java_outer_classname = "ResourcesProto";
option java_package = "com.google.api.servicemanagement.v1";
option objc_class_prefix = "GASM";
option php_namespace = "Google\\Cloud\\ServiceManagement\\V1";
// The full representation of a Service that is managed by
// Google Service Management.
message ManagedService {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements.
string service_name = 2;
// ID of the project that produces and owns this service.
string producer_project_id = 3;
}
// The metadata associated with a long running operation resource.
message OperationMetadata {
// Represents the status of one operation step.
message Step {
// The short description of the step.
string description = 2;
// The status code.
Status status = 4;
}
// Code describes the status of the operation (or one of its steps).
enum Status {
// Unspecifed code.
STATUS_UNSPECIFIED = 0;
// The operation or step has completed without errors.
DONE = 1;
// The operation or step has not started yet.
NOT_STARTED = 2;
// The operation or step is in progress.
IN_PROGRESS = 3;
// The operation or step has completed with errors. If the operation is
// rollbackable, the rollback completed with errors too.
FAILED = 4;
// The operation or step has completed with cancellation.
CANCELLED = 5;
}
// The full name of the resources that this operation is directly
// associated with.
repeated string resource_names = 1;
// Detailed status information for each step. The order is undetermined.
repeated Step steps = 2;
// Percentage of completion of this operation, ranging from 0 to 100.
int32 progress_percentage = 3;
// The start time of the operation.
google.protobuf.Timestamp start_time = 4;
}
// Represents a diagnostic message (error or warning)
message Diagnostic {
// The kind of diagnostic information possible.
enum Kind {
// Warnings and errors
WARNING = 0;
// Only errors
ERROR = 1;
}
// File name and line number of the error or warning.
string location = 1;
// The kind of diagnostic information provided.
Kind kind = 2;
// Message describing the error or warning.
string message = 3;
}
// Represents a source file which is used to generate the service configuration
// defined by `google.api.Service`.
message ConfigSource {
// A unique ID for a specific instance of this message, typically assigned
// by the client for tracking purpose. If empty, the server may choose to
// generate one instead.
string id = 5;
// Set of source configuration files that are used to generate a service
// configuration (`google.api.Service`).
repeated ConfigFile files = 2;
}
// Generic specification of a source configuration file
message ConfigFile {
enum FileType {
// Unknown file type.
FILE_TYPE_UNSPECIFIED = 0;
// YAML-specification of service.
SERVICE_CONFIG_YAML = 1;
// OpenAPI specification, serialized in JSON.
OPEN_API_JSON = 2;
// OpenAPI specification, serialized in YAML.
OPEN_API_YAML = 3;
// FileDescriptorSet, generated by protoc.
//
// To generate, use protoc with imports and source info included.
// For an example test.proto file, the following command would put the value
// in a new file named out.pb.
//
// $protoc --include_imports --include_source_info test.proto -o out.pb
FILE_DESCRIPTOR_SET_PROTO = 4;
// Uncompiled Proto file. Used for storage and display purposes only,
// currently server-side compilation is not supported. Should match the
// inputs to 'protoc' command used to generated FILE_DESCRIPTOR_SET_PROTO. A
// file of this type can only be included if at least one file of type
// FILE_DESCRIPTOR_SET_PROTO is included.
PROTO_FILE = 6;
}
// The file name of the configuration file (full or relative path).
string file_path = 1;
// The bytes that constitute the file.
bytes file_contents = 3;
// The type of configuration file this represents.
FileType file_type = 4;
}
// Represents a service configuration with its name and id.
message ConfigRef {
// Resource name of a service config. It must have the following
// format: "services/{service name}/configs/{config id}".
string name = 1;
}
// Change report associated with a particular service configuration.
//
// It contains a list of ConfigChanges based on the comparison between
// two service configurations.
message ChangeReport {
// List of changes between two service configurations.
// The changes will be alphabetically sorted based on the identifier
// of each change.
// A ConfigChange identifier is a dot separated path to the configuration.
// Example: visibility.rules[selector='LibraryService.CreateBook'].restriction
repeated google.api.ConfigChange config_changes = 1;
}
// A rollout resource that defines how service configuration versions are pushed
// to control plane systems. Typically, you create a new version of the
// service config, and then create a Rollout to push the service config.
message Rollout {
// Strategy that specifies how clients of Google Service Controller want to
// send traffic to use different config versions. This is generally
// used by API proxy to split traffic based on your configured precentage for
// each config version.
//
// One example of how to gradually rollout a new service configuration using
// this
// strategy:
// Day 1
//
// Rollout {
// id: "example.googleapis.com/rollout_20160206"
// traffic_percent_strategy {
// percentages: {
// "example.googleapis.com/20160201": 70.00
// "example.googleapis.com/20160206": 30.00
// }
// }
// }
//
// Day 2
//
// Rollout {
// id: "example.googleapis.com/rollout_20160207"
// traffic_percent_strategy: {
// percentages: {
// "example.googleapis.com/20160206": 100.00
// }
// }
// }
message TrafficPercentStrategy {
// Maps service configuration IDs to their corresponding traffic percentage.
// Key is the service configuration ID, Value is the traffic percentage
// which must be greater than 0.0 and the sum must equal to 100.0.
map<string, double> percentages = 1;
}
// Strategy used to delete a service. This strategy is a placeholder only
// used by the system generated rollout to delete a service.
message DeleteServiceStrategy {
}
// Status of a Rollout.
enum RolloutStatus {
// No status specified.
ROLLOUT_STATUS_UNSPECIFIED = 0;
// The Rollout is in progress.
IN_PROGRESS = 1;
// The Rollout has completed successfully.
SUCCESS = 2;
// The Rollout has been cancelled. This can happen if you have overlapping
// Rollout pushes, and the previous ones will be cancelled.
CANCELLED = 3;
// The Rollout has failed and the rollback attempt has failed too.
FAILED = 4;
// The Rollout has not started yet and is pending for execution.
PENDING = 5;
// The Rollout has failed and rolled back to the previous successful
// Rollout.
FAILED_ROLLED_BACK = 6;
}
// Optional unique identifier of this Rollout. Only lower case letters, digits
// and '-' are allowed.
//
// If not specified by client, the server will generate one. The generated id
// will have the form of <date><revision number>, where "date" is the create
// date in ISO 8601 format. "revision number" is a monotonically increasing
// positive number that is reset every day for each service.
// An example of the generated rollout_id is '2016-02-16r1'
string rollout_id = 1;
// Creation time of the rollout. Readonly.
google.protobuf.Timestamp create_time = 2;
// The user who created the Rollout. Readonly.
string created_by = 3;
// The status of this rollout. Readonly. In case of a failed rollout,
// the system will automatically rollback to the current Rollout
// version. Readonly.
RolloutStatus status = 4;
// Strategy that defines which versions of service configurations should be
// pushed
// and how they should be used at runtime.
oneof strategy {
// Google Service Control selects service configurations based on
// traffic percentage.
TrafficPercentStrategy traffic_percent_strategy = 5;
// The strategy associated with a rollout to delete a `ManagedService`.
// Readonly.
DeleteServiceStrategy delete_service_strategy = 200;
}
// The name of the service associated with this Rollout.
string service_name = 8;
}

View File

@@ -0,0 +1,491 @@
// Copyright 2018 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.servicemanagement.v1;
import "google/api/annotations.proto";
import "google/api/service.proto";
import "google/api/servicemanagement/v1/resources.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.Cloud.ServiceManagement.V1";
option go_package = "google.golang.org/genproto/googleapis/api/servicemanagement/v1;servicemanagement";
option java_multiple_files = true;
option java_outer_classname = "ServiceManagerProto";
option java_package = "com.google.api.servicemanagement.v1";
option objc_class_prefix = "GASM";
option php_namespace = "Google\\Cloud\\ServiceManagement\\V1";
// [Google Service Management API](/service-management/overview)
service ServiceManager {
// Lists managed services.
//
// Returns all public services. For authenticated users, also returns all
// services the calling user has "servicemanagement.services.get" permission
// for.
//
// **BETA:** If the caller specifies the `consumer_id`, it returns only the
// services enabled on the consumer. The `consumer_id` must have the format
// of "project:{PROJECT-ID}".
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
option (google.api.http) = {
get: "/v1/services"
};
}
// Gets a managed service. Authentication is required unless the service is
// public.
rpc GetService(GetServiceRequest) returns (ManagedService) {
option (google.api.http) = {
get: "/v1/services/{service_name}"
};
}
// Creates a new managed service.
// Please note one producer project can own no more than 20 services.
//
// Operation<response: ManagedService>
rpc CreateService(CreateServiceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/services"
body: "service"
};
}
// Deletes a managed service. This method will change the service to the
// `Soft-Delete` state for 30 days. Within this period, service producers may
// call [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] to restore the service.
// After 30 days, the service will be permanently deleted.
//
// Operation<response: google.protobuf.Empty>
rpc DeleteService(DeleteServiceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/services/{service_name}"
};
}
// Revives a previously deleted managed service. The method restores the
// service using the configuration at the time the service was deleted.
// The target service must exist and must have been deleted within the
// last 30 days.
//
// Operation<response: UndeleteServiceResponse>
rpc UndeleteService(UndeleteServiceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/services/{service_name}:undelete"
};
}
// Lists the history of the service configuration for a managed service,
// from the newest to the oldest.
rpc ListServiceConfigs(ListServiceConfigsRequest) returns (ListServiceConfigsResponse) {
option (google.api.http) = {
get: "/v1/services/{service_name}/configs"
};
}
// Gets a service configuration (version) for a managed service.
rpc GetServiceConfig(GetServiceConfigRequest) returns (google.api.Service) {
option (google.api.http) = {
get: "/v1/services/{service_name}/configs/{config_id}"
additional_bindings {
get: "/v1/services/{service_name}/config"
}
};
}
// Creates a new service configuration (version) for a managed service.
// This method only stores the service configuration. To roll out the service
// configuration to backend systems please call
// [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout].
//
// Only the 100 most recent service configurations and ones referenced by
// existing rollouts are kept for each service. The rest will be deleted
// eventually.
rpc CreateServiceConfig(CreateServiceConfigRequest) returns (google.api.Service) {
option (google.api.http) = {
post: "/v1/services/{service_name}/configs"
body: "service_config"
};
}
// Creates a new service configuration (version) for a managed service based
// on
// user-supplied configuration source files (for example: OpenAPI
// Specification). This method stores the source configurations as well as the
// generated service configuration. To rollout the service configuration to
// other services,
// please call [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout].
//
// Only the 100 most recent configuration sources and ones referenced by
// existing service configurtions are kept for each service. The rest will be
// deleted eventually.
//
// Operation<response: SubmitConfigSourceResponse>
rpc SubmitConfigSource(SubmitConfigSourceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/services/{service_name}/configs:submit"
body: "*"
};
}
// Lists the history of the service configuration rollouts for a managed
// service, from the newest to the oldest.
rpc ListServiceRollouts(ListServiceRolloutsRequest) returns (ListServiceRolloutsResponse) {
option (google.api.http) = {
get: "/v1/services/{service_name}/rollouts"
};
}
// Gets a service configuration [rollout][google.api.servicemanagement.v1.Rollout].
rpc GetServiceRollout(GetServiceRolloutRequest) returns (Rollout) {
option (google.api.http) = {
get: "/v1/services/{service_name}/rollouts/{rollout_id}"
};
}
// Creates a new service configuration rollout. Based on rollout, the
// Google Service Management will roll out the service configurations to
// different backend services. For example, the logging configuration will be
// pushed to Google Cloud Logging.
//
// Please note that any previous pending and running Rollouts and associated
// Operations will be automatically cancelled so that the latest Rollout will
// not be blocked by previous Rollouts.
//
// Only the 100 most recent (in any state) and the last 10 successful (if not
// already part of the set of 100 most recent) rollouts are kept for each
// service. The rest will be deleted eventually.
//
// Operation<response: Rollout>
rpc CreateServiceRollout(CreateServiceRolloutRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/services/{service_name}/rollouts"
body: "rollout"
};
}
// Generates and returns a report (errors, warnings and changes from
// existing configurations) associated with
// GenerateConfigReportRequest.new_value
//
// If GenerateConfigReportRequest.old_value is specified,
// GenerateConfigReportRequest will contain a single ChangeReport based on the
// comparison between GenerateConfigReportRequest.new_value and
// GenerateConfigReportRequest.old_value.
// If GenerateConfigReportRequest.old_value is not specified, this method
// will compare GenerateConfigReportRequest.new_value with the last pushed
// service configuration.
rpc GenerateConfigReport(GenerateConfigReportRequest) returns (GenerateConfigReportResponse) {
option (google.api.http) = {
post: "/v1/services:generateConfigReport"
body: "*"
};
}
// Enables a [service][google.api.servicemanagement.v1.ManagedService] for a project, so it can be used
// for the project. See
// [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for
// more information.
//
// Operation<response: EnableServiceResponse>
rpc EnableService(EnableServiceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/services/{service_name}:enable"
body: "*"
};
}
// Disables a [service][google.api.servicemanagement.v1.ManagedService] for a project, so it can no longer be
// be used for the project. It prevents accidental usage that may cause
// unexpected billing charges or security leaks.
//
// Operation<response: DisableServiceResponse>
rpc DisableService(DisableServiceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/services/{service_name}:disable"
body: "*"
};
}
}
// Request message for `ListServices` method.
message ListServicesRequest {
// Include services produced by the specified project.
string producer_project_id = 1;
// Requested size of the next page of data.
int32 page_size = 5;
// Token identifying which result to start with; returned by a previous list
// call.
string page_token = 6;
// Include services consumed by the specified consumer.
//
// The Google Service Management implementation accepts the following
// forms:
// - project:<project_id>
string consumer_id = 7;
}
// Response message for `ListServices` method.
message ListServicesResponse {
// The returned services will only have the name field set.
repeated ManagedService services = 1;
// Token that can be passed to `ListServices` to resume a paginated query.
string next_page_token = 2;
}
// Request message for `GetService` method.
message GetServiceRequest {
// The name of the service. See the `ServiceManager` overview for naming
// requirements. For example: `example.googleapis.com`.
string service_name = 1;
}
// Request message for CreateService method.
message CreateServiceRequest {
// Initial values for the service resource.
ManagedService service = 1;
}
// Request message for DeleteService method.
message DeleteServiceRequest {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
}
// Request message for UndeleteService method.
message UndeleteServiceRequest {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
}
// Response message for UndeleteService method.
message UndeleteServiceResponse {
// Revived service resource.
ManagedService service = 1;
}
// Request message for GetServiceConfig method.
message GetServiceConfigRequest {
enum ConfigView {
// Server response includes all fields except SourceInfo.
BASIC = 0;
// Server response includes all fields including SourceInfo.
// SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile'
// and are only available for configs created using the
// SubmitConfigSource method.
FULL = 1;
}
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
// The id of the service configuration resource.
string config_id = 2;
// Specifies which parts of the Service Config should be returned in the
// response.
ConfigView view = 3;
}
// Request message for ListServiceConfigs method.
message ListServiceConfigsRequest {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
// The token of the page to retrieve.
string page_token = 2;
// The max number of items to include in the response list.
int32 page_size = 3;
}
// Response message for ListServiceConfigs method.
message ListServiceConfigsResponse {
// The list of service configuration resources.
repeated google.api.Service service_configs = 1;
// The token of the next page of results.
string next_page_token = 2;
}
// Request message for CreateServiceConfig method.
message CreateServiceConfigRequest {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
// The service configuration resource.
google.api.Service service_config = 2;
}
// Request message for SubmitConfigSource method.
message SubmitConfigSourceRequest {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
// The source configuration for the service.
ConfigSource config_source = 2;
// Optional. If set, this will result in the generation of a
// `google.api.Service` configuration based on the `ConfigSource` provided,
// but the generated config and the sources will NOT be persisted.
bool validate_only = 3;
}
// Response message for SubmitConfigSource method.
message SubmitConfigSourceResponse {
// The generated service configuration.
google.api.Service service_config = 1;
}
// Request message for 'CreateServiceRollout'
message CreateServiceRolloutRequest {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
// The rollout resource. The `service_name` field is output only.
Rollout rollout = 2;
}
// Request message for 'ListServiceRollouts'
message ListServiceRolloutsRequest {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
// The token of the page to retrieve.
string page_token = 2;
// The max number of items to include in the response list.
int32 page_size = 3;
// Use `filter` to return subset of rollouts.
// The following filters are supported:
// -- To limit the results to only those in
// [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS',
// use filter='status=SUCCESS'
// -- To limit the results to those in
// [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED'
// or 'FAILED', use filter='status=CANCELLED OR status=FAILED'
string filter = 4;
}
// Response message for ListServiceRollouts method.
message ListServiceRolloutsResponse {
// The list of rollout resources.
repeated Rollout rollouts = 1;
// The token of the next page of results.
string next_page_token = 2;
}
// Request message for GetServiceRollout method.
message GetServiceRolloutRequest {
// The name of the service. See the [overview](/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1;
// The id of the rollout resource.
string rollout_id = 2;
}
// Request message for EnableService method.
message EnableServiceRequest {
// Name of the service to enable. Specifying an unknown service name will
// cause the request to fail.
string service_name = 1;
// The identity of consumer resource which service enablement will be
// applied to.
//
// The Google Service Management implementation accepts the following
// forms:
// - "project:<project_id>"
//
// Note: this is made compatible with
// google.api.servicecontrol.v1.Operation.consumer_id.
string consumer_id = 2;
}
// Request message for DisableService method.
message DisableServiceRequest {
// Name of the service to disable. Specifying an unknown service name
// will cause the request to fail.
string service_name = 1;
// The identity of consumer resource which service disablement will be
// applied to.
//
// The Google Service Management implementation accepts the following
// forms:
// - "project:<project_id>"
//
// Note: this is made compatible with
// google.api.servicecontrol.v1.Operation.consumer_id.
string consumer_id = 2;
}
// Request message for GenerateConfigReport method.
message GenerateConfigReportRequest {
// Service configuration for which we want to generate the report.
// For this version of API, the supported types are
// [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef],
// [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource],
// and [google.api.Service][google.api.Service]
google.protobuf.Any new_config = 1;
// Service configuration against which the comparison will be done.
// For this version of API, the supported types are
// [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef],
// [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource],
// and [google.api.Service][google.api.Service]
google.protobuf.Any old_config = 2;
}
// Response message for GenerateConfigReport method.
message GenerateConfigReportResponse {
// Name of the service this report belongs to.
string service_name = 1;
// ID of the service configuration this report belongs to.
string id = 2;
// list of ChangeReport, each corresponding to comparison between two
// service configurations.
repeated ChangeReport change_reports = 3;
// Errors / Linter warnings associated with the service definition this
// report
// belongs to.
repeated Diagnostic diagnostics = 4;
}

View File

@@ -0,0 +1,32 @@
// Copyright 2018 Google LLC.
//
// 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/protobuf/any.proto";
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
option java_multiple_files = true;
option java_outer_classname = "SourceInfoProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Source information used to create a Service Config
message SourceInfo {
// All files used during config generation.
repeated google.protobuf.Any source_files = 1;
}

View File

@@ -0,0 +1,96 @@
// Copyright 2018 Google LLC.
//
// 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;
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
option java_multiple_files = true;
option java_outer_classname = "SystemParameterProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// ### System parameter configuration
//
// A system parameter is a special kind of parameter defined by the API
// system, not by an individual API. It is typically mapped to an HTTP header
// and/or a URL query parameter. This configuration specifies which methods
// change the names of the system parameters.
message SystemParameters {
// Define system parameters.
//
// The parameters defined here will override the default parameters
// implemented by the system. If this field is missing from the service
// config, default system parameters will be used. Default system parameters
// and names is implementation-dependent.
//
// Example: define api key for all methods
//
// system_parameters
// rules:
// - selector: "*"
// parameters:
// - name: api_key
// url_query_parameter: api_key
//
//
// Example: define 2 api key names for a specific method.
//
// system_parameters
// rules:
// - selector: "/ListShelves"
// parameters:
// - name: api_key
// 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;
}
// Define a system parameter rule mapping system parameter definitions to
// methods.
message SystemParameterRule {
// Selects the methods to which this rule applies. Use '*' to indicate all
// methods in all APIs.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;
// Define parameters. Multiple names may be defined for a parameter.
// For a given method call, only one of them should be used. If multiple
// names are used the behavior is implementation-dependent.
// If none of the specified names are present the behavior is
// parameter-dependent.
repeated SystemParameter parameters = 2;
}
// Define a parameter's name and location. The parameter may be passed as either
// an HTTP header or a URL query parameter, and if both are passed the behavior
// is implementation-dependent.
message SystemParameter {
// Define the name of the parameter, such as "api_key" . It is case sensitive.
string name = 1;
// Define the HTTP header name to use for the parameter. It is case
// insensitive.
string http_header = 2;
// Define the URL query parameter name to use for the parameter. It is case
// sensitive.
string url_query_parameter = 3;
}

View File

@@ -0,0 +1,92 @@
// Copyright 2018 Google LLC.
//
// 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 go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
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 {
// 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;
// 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;
// The full resource name of a channel used for sending notifications to the
// service producer.
//
// Google Service Management currently only supports
// [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
// channel. To use Google Cloud Pub/Sub as the channel, this must be the name
// of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
// documented in https://cloud.google.com/pubsub/docs/overview.
string producer_notification_channel = 7;
}
// Usage configuration rules for the service.
//
// NOTE: Under development.
//
//
// Use this rule to configure unregistered calls for the service. Unregistered
// calls are calls that do not contain consumer project identity.
// (Example: calls that do not contain an API key).
// By default, API methods do not allow unregistered calls, and each method call
// must be identified by a consumer project identity. Use this rule to
// allow/disallow unregistered calls.
//
// Example of an API that wants to allow unregistered calls for entire service.
//
// usage:
// rules:
// - selector: "*"
// allow_unregistered_calls: true
//
// Example of a method that wants to allow unregistered calls.
//
// usage:
// rules:
// - selector: "google.example.library.v1.LibraryService.CreateBook"
// allow_unregistered_calls: true
message UsageRule {
// Selects the methods to which this rule applies. Use '*' to indicate all
// methods in all APIs.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;
// If true, the selected method allows unregistered calls, e.g. calls
// that don't identify any user or application.
bool allow_unregistered_calls = 2;
// If true, the selected method should skip service control and the control
// plane features, such as quota and billing, will not be available.
// This flag is used by Google Cloud Endpoints to bypass checks for internal
// methods, such as service health check methods.
bool skip_service_control = 3;
}

View File

@@ -0,0 +1,34 @@
// 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.appengine.legacy;
option go_package = "google.golang.org/genproto/googleapis/appengine/legacy;legacy";
option java_multiple_files = true;
option java_outer_classname = "AuditDataProto";
option java_package = "com.google.appengine.legacy";
// Admin Console legacy audit log.
message AuditData {
// Text description of the admin event.
// This is the "Event" column in Admin Console's Admin Logs.
string event_message = 1;
// Arbitrary event data.
// This is the "Result" column in Admin Console's Admin Logs.
map<string, string> event_data = 2;
}

View File

@@ -0,0 +1,190 @@
// 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.appengine.logging.v1;
import "google/logging/type/log_severity.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/logging/v1;logging";
option java_multiple_files = true;
option java_outer_classname = "RequestLogProto";
option java_package = "com.google.appengine.logging.v1";
// Application log line emitted while processing a request.
message LogLine {
// Approximate time when this log entry was made.
google.protobuf.Timestamp time = 1;
// Severity of this log entry.
google.logging.type.LogSeverity severity = 2;
// App-provided log message.
string log_message = 3;
// Where in the source code this log message was written.
SourceLocation source_location = 4;
}
// Specifies a location in a source code file.
message SourceLocation {
// Source file name. Depending on the runtime environment, this might be a
// simple name or a fully-qualified name.
string file = 1;
// Line within the source file.
int64 line = 2;
// Human-readable name of the function or method being invoked, with optional
// context such as the class or package name. This information is used in
// contexts such as the logs viewer, where a file and line number are less
// meaningful. The format can vary by language. For example:
// `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
// (Python).
string function_name = 3;
}
// A reference to a particular snapshot of the source tree used to build and
// deploy an application.
message SourceReference {
// Optional. A URI string identifying the repository.
// Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
string repository = 1;
// The canonical and persistent identifier of the deployed revision.
// Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
string revision_id = 2;
}
// Complete log information about a single HTTP request to an App Engine
// application.
message RequestLog {
// Application that handled this request.
string app_id = 1;
// Module of the application that handled this request.
string module_id = 37;
// Version of the application that handled this request.
string version_id = 2;
// Globally unique identifier for a request, which is based on the request
// start time. Request IDs for requests which started later will compare
// greater as strings than those for requests which started earlier.
string request_id = 3;
// Origin IP address.
string ip = 4;
// Time when the request started.
google.protobuf.Timestamp start_time = 6;
// Time when the request finished.
google.protobuf.Timestamp end_time = 7;
// Latency of the request.
google.protobuf.Duration latency = 8;
// Number of CPU megacycles used to process request.
int64 mega_cycles = 9;
// Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
string method = 10;
// Contains the path and query portion of the URL that was requested. For
// example, if the URL was "http://example.com/app?name=val", the resource
// would be "/app?name=val". The fragment identifier, which is identified by
// the `#` character, is not included.
string resource = 11;
// HTTP version of request. Example: `"HTTP/1.1"`.
string http_version = 12;
// HTTP response status code. Example: 200, 404.
int32 status = 13;
// Size in bytes sent back to client by request.
int64 response_size = 14;
// Referrer URL of request.
string referrer = 15;
// User agent that made the request.
string user_agent = 16;
// The logged-in user who made the request.
//
// Most likely, this is the part of the user's email before the `@` sign. The
// field value is the same for different requests from the same user, but
// different users can have similar names. This information is also
// available to the application via the App Engine Users API.
//
// This field will be populated starting with App Engine 1.9.21.
string nickname = 40;
// File or class that handled the request.
string url_map_entry = 17;
// Internet host and port number of the resource being requested.
string host = 20;
// An indication of the relative cost of serving this request.
double cost = 21;
// Queue name of the request, in the case of an offline request.
string task_queue_name = 22;
// Task name of the request, in the case of an offline request.
string task_name = 23;
// Whether this was a loading request for the instance.
bool was_loading_request = 24;
// Time this request spent in the pending request queue.
google.protobuf.Duration pending_time = 25;
// If the instance processing this request belongs to a manually scaled
// module, then this is the 0-based index of the instance. Otherwise, this
// value is -1.
int32 instance_index = 26;
// Whether this request is finished or active.
bool finished = 27;
// Whether this is the first `RequestLog` entry for this request. If an
// active request has several `RequestLog` entries written to Stackdriver
// Logging, then this field will be set for one of them.
bool first = 42;
// An identifier for the instance that handled the request.
string instance_id = 28;
// A list of log lines emitted by the application while serving this request.
repeated LogLine line = 29;
// App Engine release version.
string app_engine_release = 38;
// Stackdriver Trace identifier for this request.
string trace_id = 39;
// Source code for the application that handled this request. There can be
// more than one source reference per deployed application if source code is
// distributed among multiple repositories.
repeated SourceReference source_reference = 41;
}

View File

@@ -0,0 +1,285 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "AppYamlProto";
option java_package = "com.google.appengine.v1";
// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/)
// configuration for API handlers.
message ApiConfigHandler {
// Action to take when users access resources that require
// authentication. Defaults to `redirect`.
AuthFailAction auth_fail_action = 1;
// Level of login required to access this resource. Defaults to
// `optional`.
LoginRequirement login = 2;
// Path to the script from the application root directory.
string script = 3;
// Security (HTTPS) enforcement for this URL.
SecurityLevel security_level = 4;
// URL to serve the endpoint at.
string url = 5;
}
// Custom static error page to be served when an error occurs.
message ErrorHandler {
// Error codes.
enum ErrorCode {
option allow_alias = true;
// Not specified. ERROR_CODE_DEFAULT is assumed.
ERROR_CODE_UNSPECIFIED = 0;
// All other error types.
ERROR_CODE_DEFAULT = 0;
// Application has exceeded a resource quota.
ERROR_CODE_OVER_QUOTA = 1;
// Client blocked by the application's Denial of Service protection
// configuration.
ERROR_CODE_DOS_API_DENIAL = 2;
// Deadline reached before the application responds.
ERROR_CODE_TIMEOUT = 3;
}
// Error condition this handler applies to.
ErrorCode error_code = 1;
// Static file content to be served for this error.
string static_file = 2;
// MIME type of file. Defaults to `text/html`.
string mime_type = 3;
}
// URL pattern and description of how the URL should be handled. App Engine can
// handle URLs by executing application code or by serving static files
// uploaded with the version, such as images, CSS, or JavaScript.
message UrlMap {
// Redirect codes.
enum RedirectHttpResponseCode {
// Not specified. `302` is assumed.
REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED = 0;
// `301 Moved Permanently` code.
REDIRECT_HTTP_RESPONSE_CODE_301 = 1;
// `302 Moved Temporarily` code.
REDIRECT_HTTP_RESPONSE_CODE_302 = 2;
// `303 See Other` code.
REDIRECT_HTTP_RESPONSE_CODE_303 = 3;
// `307 Temporary Redirect` code.
REDIRECT_HTTP_RESPONSE_CODE_307 = 4;
}
// URL prefix. Uses regular expression syntax, which means regexp
// special characters must be escaped, but should not contain groupings.
// All URLs that begin with this prefix are handled by this handler, using the
// portion of the URL after the prefix as part of the file path.
string url_regex = 1;
// Type of handler for this URL pattern.
oneof handler_type {
// Returns the contents of a file, such as an image, as the response.
StaticFilesHandler static_files = 2;
// Executes a script to handle the request that matches this URL
// pattern.
ScriptHandler script = 3;
// Uses API Endpoints to handle requests.
ApiEndpointHandler api_endpoint = 4;
}
// Security (HTTPS) enforcement for this URL.
SecurityLevel security_level = 5;
// Level of login required to access this resource.
LoginRequirement login = 6;
// Action to take when users access resources that require
// authentication. Defaults to `redirect`.
AuthFailAction auth_fail_action = 7;
// `30x` code to use when performing redirects for the `secure` field.
// Defaults to `302`.
RedirectHttpResponseCode redirect_http_response_code = 8;
}
// Files served directly to the user for a given URL, such as images, CSS
// stylesheets, or JavaScript source files. Static file handlers describe which
// files in the application directory are static files, and which URLs serve
// them.
message StaticFilesHandler {
// Path to the static files matched by the URL pattern, from the
// application root directory. The path can refer to text matched in groupings
// in the URL pattern.
string path = 1;
// Regular expression that matches the file paths for all files that should be
// referenced by this handler.
string upload_path_regex = 2;
// HTTP headers to use for all responses from these URLs.
map<string, string> http_headers = 3;
// MIME type used to serve all files served by this handler.
//
// Defaults to file-specific MIME types, which are derived from each file's
// filename extension.
string mime_type = 4;
// Time a static file served by this handler should be cached
// by web proxies and browsers.
google.protobuf.Duration expiration = 5;
// Whether this handler should match the request if the file
// referenced by the handler does not exist.
bool require_matching_file = 6;
// Whether files should also be uploaded as code data. By default, files
// declared in static file handlers are uploaded as static
// data and are only served to end users; they cannot be read by the
// application. If enabled, uploads are charged against both your code and
// static data storage resource quotas.
bool application_readable = 7;
}
// Executes a script to handle the request that matches the URL pattern.
message ScriptHandler {
// Path to the script from the application root directory.
string script_path = 1;
}
// Uses Google Cloud Endpoints to handle requests.
message ApiEndpointHandler {
// Path to the script from the application root directory.
string script_path = 1;
}
// Health checking configuration for VM instances. Unhealthy instances
// are killed and replaced with new instances. Only applicable for
// instances in App Engine flexible environment.
message HealthCheck {
// Whether to explicitly disable health checks for this instance.
bool disable_health_check = 1;
// Host header to send when performing an HTTP health check.
// Example: "myapp.appspot.com"
string host = 2;
// Number of consecutive successful health checks required before receiving
// traffic.
uint32 healthy_threshold = 3;
// Number of consecutive failed health checks required before removing
// traffic.
uint32 unhealthy_threshold = 4;
// Number of consecutive failed health checks required before an instance is
// restarted.
uint32 restart_threshold = 5;
// Interval between health checks.
google.protobuf.Duration check_interval = 6;
// Time before the health check is considered failed.
google.protobuf.Duration timeout = 7;
}
// Third-party Python runtime library that is required by the application.
message Library {
// Name of the library. Example: "django".
string name = 1;
// Version of the library to select, or "latest".
string version = 2;
}
// Actions to take when the user is not logged in.
enum AuthFailAction {
// Not specified. `AUTH_FAIL_ACTION_REDIRECT` is assumed.
AUTH_FAIL_ACTION_UNSPECIFIED = 0;
// Redirects user to "accounts.google.com". The user is redirected back to the
// application URL after signing in or creating an account.
AUTH_FAIL_ACTION_REDIRECT = 1;
// Rejects request with a `401` HTTP status code and an error
// message.
AUTH_FAIL_ACTION_UNAUTHORIZED = 2;
}
// Methods to restrict access to a URL based on login status.
enum LoginRequirement {
// Not specified. `LOGIN_OPTIONAL` is assumed.
LOGIN_UNSPECIFIED = 0;
// Does not require that the user is signed in.
LOGIN_OPTIONAL = 1;
// If the user is not signed in, the `auth_fail_action` is taken.
// In addition, if the user is not an administrator for the
// application, they are given an error message regardless of
// `auth_fail_action`. If the user is an administrator, the handler
// proceeds.
LOGIN_ADMIN = 2;
// If the user has signed in, the handler proceeds normally. Otherwise, the
// auth_fail_action is taken.
LOGIN_REQUIRED = 3;
}
// Methods to enforce security (HTTPS) on a URL.
enum SecurityLevel {
option allow_alias = true;
// Not specified.
SECURE_UNSPECIFIED = 0;
// Both HTTP and HTTPS requests with URLs that match the handler succeed
// without redirects. The application can examine the request to determine
// which protocol was used, and respond accordingly.
SECURE_DEFAULT = 0;
// Requests for a URL that match this handler that use HTTPS are automatically
// redirected to the HTTP equivalent URL.
SECURE_NEVER = 1;
// Both HTTP and HTTPS requests with URLs that match the handler succeed
// without redirects. The application can examine the request to determine
// which protocol was used and respond accordingly.
SECURE_OPTIONAL = 2;
// Requests for a URL that match this handler that do not use HTTPS are
// automatically redirected to the HTTPS URL with the same path. Query
// parameters are reserved for the redirect.
SECURE_ALWAYS = 3;
}

View File

@@ -0,0 +1,341 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
import "google/appengine/v1/application.proto";
import "google/appengine/v1/instance.proto";
import "google/appengine/v1/service.proto";
import "google/appengine/v1/version.proto";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "AppengineProto";
option java_package = "com.google.appengine.v1";
// Manages instances of a version.
service Instances {
// Lists the instances of a version.
rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
option (google.api.http) = { get: "/v1/{parent=apps/*/services/*/versions/*}/instances" };
}
// Gets instance information.
rpc GetInstance(GetInstanceRequest) returns (Instance) {
option (google.api.http) = { get: "/v1/{name=apps/*/services/*/versions/*/instances/*}" };
}
// Stops a running instance.
rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { delete: "/v1/{name=apps/*/services/*/versions/*/instances/*}" };
}
// Enables debugging on a VM instance. This allows you to use the SSH
// command to connect to the virtual machine where the instance lives.
// While in "debug mode", the instance continues to serve live traffic.
// You should delete the instance when you are done debugging and then
// allow the system to take over and determine if another instance
// should be started.
//
// Only applicable for instances in App Engine flexible environment.
rpc DebugInstance(DebugInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/{name=apps/*/services/*/versions/*/instances/*}:debug" body: "*" };
}
}
// Manages versions of a service.
service Versions {
// Lists the versions of a service.
rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) {
option (google.api.http) = { get: "/v1/{parent=apps/*/services/*}/versions" };
}
// Gets the specified Version resource.
// By default, only a `BASIC_VIEW` will be returned.
// Specify the `FULL_VIEW` parameter to get the full resource.
rpc GetVersion(GetVersionRequest) returns (Version) {
option (google.api.http) = { get: "/v1/{name=apps/*/services/*/versions/*}" };
}
// Deploys code and resource files to a new version.
rpc CreateVersion(CreateVersionRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/{parent=apps/*/services/*}/versions" body: "version" };
}
// Updates the specified Version resource.
// You can specify the following fields depending on the App Engine
// environment and type of scaling that the version resource uses:
//
// * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status):
// For Version resources that use basic scaling, manual scaling, or run in
// the App Engine flexible environment.
// * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class):
// For Version resources that run in the App Engine standard environment.
// * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling):
// For Version resources that use automatic scaling and run in the App
// Engine standard environment.
// * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling):
// For Version resources that use automatic scaling and run in the App
// Engine standard environment.
rpc UpdateVersion(UpdateVersionRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { patch: "/v1/{name=apps/*/services/*/versions/*}" body: "version" };
}
// Deletes an existing Version resource.
rpc DeleteVersion(DeleteVersionRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { delete: "/v1/{name=apps/*/services/*/versions/*}" };
}
}
// Manages services of an application.
service Services {
// Lists all the services in the application.
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
option (google.api.http) = { get: "/v1/{parent=apps/*}/services" };
}
// Gets the current configuration of the specified service.
rpc GetService(GetServiceRequest) returns (Service) {
option (google.api.http) = { get: "/v1/{name=apps/*/services/*}" };
}
// Updates the configuration of the specified service.
rpc UpdateService(UpdateServiceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { patch: "/v1/{name=apps/*/services/*}" body: "service" };
}
// Deletes the specified service and all enclosed versions.
rpc DeleteService(DeleteServiceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { delete: "/v1/{name=apps/*/services/*}" };
}
}
// Manages App Engine applications.
service Applications {
// Gets information about an application.
rpc GetApplication(GetApplicationRequest) returns (Application) {
option (google.api.http) = { get: "/v1/{name=apps/*}" };
}
// Recreates the required App Engine features for the application in your
// project, for example a Cloud Storage bucket or App Engine service account.
// Use this method if you receive an error message about a missing feature,
// for example "*Error retrieving the App Engine service account*".
rpc RepairApplication(RepairApplicationRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/{name=apps/*}:repair" body: "*" };
}
}
// Request message for `Applications.GetApplication`.
message GetApplicationRequest {
// Name of the Application resource to get. Example: `apps/myapp`.
string name = 1;
}
// Request message for 'Applications.RepairApplication'.
message RepairApplicationRequest {
// Name of the application to repair. Example: `apps/myapp`
string name = 1;
}
// Request message for `Services.ListServices`.
message ListServicesRequest {
// Name of the parent Application resource. Example: `apps/myapp`.
string parent = 1;
// Maximum results to return per page.
int32 page_size = 2;
// Continuation token for fetching the next page of results.
string page_token = 3;
}
// Response message for `Services.ListServices`.
message ListServicesResponse {
// The services belonging to the requested application.
repeated Service services = 1;
// Continuation token for fetching the next page of results.
string next_page_token = 2;
}
// Request message for `Services.GetService`.
message GetServiceRequest {
// Name of the resource requested. Example: `apps/myapp/services/default`.
string name = 1;
}
// Request message for `Services.UpdateService`.
message UpdateServiceRequest {
// Name of the resource to update. Example: `apps/myapp/services/default`.
string name = 1;
// A Service resource containing the updated service. Only fields set in the
// field mask will be updated.
Service service = 2;
// Standard field mask for the set of fields to be updated.
google.protobuf.FieldMask update_mask = 3;
// Set to `true` to gradually shift traffic from one version to another
// single version. By default, traffic is shifted immediately.
// For gradual traffic migration, the target version
// must be located within instances that are configured for both
// [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype)
// and
// [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling).
// You must specify the
// [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby)
// field in the Service resource. Gradual traffic migration is not
// supported in the App Engine flexible environment. For examples, see
// [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
bool migrate_traffic = 4;
}
// Request message for `Services.DeleteService`.
message DeleteServiceRequest {
// Name of the resource requested. Example: `apps/myapp/services/default`.
string name = 1;
}
// Request message for `Versions.ListVersions`.
message ListVersionsRequest {
// Name of the parent Service resource. Example:
// `apps/myapp/services/default`.
string parent = 1;
// Controls the set of fields returned in the `List` response.
VersionView view = 2;
// Maximum results to return per page.
int32 page_size = 3;
// Continuation token for fetching the next page of results.
string page_token = 4;
}
// Response message for `Versions.ListVersions`.
message ListVersionsResponse {
// The versions belonging to the requested service.
repeated Version versions = 1;
// Continuation token for fetching the next page of results.
string next_page_token = 2;
}
// Request message for `Versions.GetVersion`.
message GetVersionRequest {
// Name of the resource requested. Example:
// `apps/myapp/services/default/versions/v1`.
string name = 1;
// Controls the set of fields returned in the `Get` response.
VersionView view = 2;
}
// Request message for `Versions.CreateVersion`.
message CreateVersionRequest {
// Name of the parent resource to create this version under. Example:
// `apps/myapp/services/default`.
string parent = 1;
// Application deployment configuration.
Version version = 2;
}
// Request message for `Versions.UpdateVersion`.
message UpdateVersionRequest {
// Name of the resource to update. Example:
// `apps/myapp/services/default/versions/1`.
string name = 1;
// A Version containing the updated resource. Only fields set in the field
// mask will be updated.
Version version = 2;
// Standard field mask for the set of fields to be updated.
google.protobuf.FieldMask update_mask = 3;
}
// Request message for `Versions.DeleteVersion`.
message DeleteVersionRequest {
// Name of the resource requested. Example:
// `apps/myapp/services/default/versions/v1`.
string name = 1;
}
// Request message for `Instances.ListInstances`.
message ListInstancesRequest {
// Name of the parent Version resource. Example:
// `apps/myapp/services/default/versions/v1`.
string parent = 1;
// Maximum results to return per page.
int32 page_size = 2;
// Continuation token for fetching the next page of results.
string page_token = 3;
}
// Response message for `Instances.ListInstances`.
message ListInstancesResponse {
// The instances belonging to the requested version.
repeated Instance instances = 1;
// Continuation token for fetching the next page of results.
string next_page_token = 2;
}
// Request message for `Instances.GetInstance`.
message GetInstanceRequest {
// Name of the resource requested. Example:
// `apps/myapp/services/default/versions/v1/instances/instance-1`.
string name = 1;
}
// Request message for `Instances.DeleteInstance`.
message DeleteInstanceRequest {
// Name of the resource requested. Example:
// `apps/myapp/services/default/versions/v1/instances/instance-1`.
string name = 1;
}
// Request message for `Instances.DebugInstance`.
message DebugInstanceRequest {
// Name of the resource requested. Example:
// `apps/myapp/services/default/versions/v1/instances/instance-1`.
string name = 1;
}
// Fields that should be returned when [Version][google.appengine.v1.Version] resources
// are retreived.
enum VersionView {
// Basic version information including scaling and inbound services,
// but not detailed deployment information.
BASIC = 0;
// The information from `BASIC`, plus detailed information about the
// deployment. This format is required when creating resources, but
// is not returned in `Get` or `List` by default.
FULL = 1;
}

View File

@@ -0,0 +1,112 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "ApplicationProto";
option java_package = "com.google.appengine.v1";
// An Application resource contains the top-level configuration of an App
// Engine application.
message Application {
// Full path to the Application resource in the API.
// Example: `apps/myapp`.
//
// @OutputOnly
string name = 1;
// Identifier of the Application resource. This identifier is equivalent
// to the project ID of the Google Cloud Platform project where you want to
// deploy your application.
// Example: `myapp`.
string id = 2;
// HTTP path dispatch rules for requests to the application that do not
// explicitly target a service or version. Rules are order-dependent.
//
// @OutputOnly
repeated UrlDispatchRule dispatch_rules = 3;
// Google Apps authentication domain that controls which users can access
// this application.
//
// Defaults to open access for any Google Account.
string auth_domain = 6;
// Location from which this application will be run. Application instances
// will run out of data centers in the chosen location, which is also where
// all of the application's end user content is stored.
//
// Defaults to `us-central`.
//
// Options are:
//
// `us-central` - Central US
//
// `europe-west` - Western Europe
//
// `us-east1` - Eastern US
string location_id = 7;
// Google Cloud Storage bucket that can be used for storing files
// associated with this application. This bucket is associated with the
// application and can be used by the gcloud deployment commands.
//
// @OutputOnly
string code_bucket = 8;
// Cookie expiration policy for this application.
//
// @OutputOnly
google.protobuf.Duration default_cookie_expiration = 9;
// Hostname used to reach this application, as resolved by App Engine.
//
// @OutputOnly
string default_hostname = 11;
// Google Cloud Storage bucket that can be used by this application to store
// content.
//
// @OutputOnly
string default_bucket = 12;
}
// Rules to match an HTTP request and dispatch that request to a service.
message UrlDispatchRule {
// Domain name to match against. The wildcard "`*`" is supported if
// specified before a period: "`*.`".
//
// Defaults to matching all domains: "`*`".
string domain = 1;
// Pathname within the host. Must start with a "`/`". A
// single "`*`" can be included at the end of the path. The sum
// of the lengths of the domain and path may not exceed 100
// characters.
string path = 2;
// Resource ID of a service in this application that should
// serve the matched request. The service must already
// exist. Example: `default`.
string service = 3;
}

View File

@@ -0,0 +1,53 @@
// Copyright 2017 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.appengine.v1;
import "google/appengine/v1/appengine.proto";
import "google/iam/v1/iam_policy.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "AuditDataProto";
option java_package = "com.google.appengine.v1";
// App Engine admin service audit log.
message AuditData {
// Detailed information about methods that require it. Does not include
// simple Get, List or Delete methods because all significant information
// (resource name, number of returned elements for List operations) is already
// included in parent audit log message.
oneof method {
// Detailed information about UpdateService call.
UpdateServiceMethod update_service = 1;
// Detailed information about CreateVersion call.
CreateVersionMethod create_version = 2;
}
}
// Detailed information about UpdateService call.
message UpdateServiceMethod {
// Update service request.
google.appengine.v1.UpdateServiceRequest request = 1;
}
// Detailed information about CreateVersion call.
message CreateVersionMethod {
// Create version request.
google.appengine.v1.CreateVersionRequest request = 1;
}

View File

@@ -0,0 +1,78 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "DeployProto";
option java_package = "com.google.appengine.v1";
// Code and application artifacts used to deploy a version to App Engine.
message Deployment {
// Manifest of the files stored in Google Cloud Storage that are included
// as part of this version. All files must be readable using the
// credentials supplied with this call.
map<string, FileInfo> files = 1;
// A Docker image that App Engine uses to run the version.
// Only applicable for instances in App Engine flexible environment.
ContainerInfo container = 2;
// The zip file for this deployment, if this is a zip deployment.
ZipInfo zip = 3;
}
// Single source file that is part of the version to be deployed. Each source
// file that is deployed must be specified separately.
message FileInfo {
// URL source to use to fetch this file. Must be a URL to a resource in
// Google Cloud Storage in the form
// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
string source_url = 1;
// The SHA1 hash of the file, in hex.
string sha1_sum = 2;
// The MIME type of the file.
//
// Defaults to the value from Google Cloud Storage.
string mime_type = 3;
}
// Docker image that is used to start a VM container for the version you
// deploy.
message ContainerInfo {
// URI to the hosted container image in a Docker repository. The URI must be
// fully qualified and include a tag or digest.
// Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest"
string image = 1;
}
message ZipInfo {
// URL of the zip file to deploy from. Must be a URL to a resource in
// Google Cloud Storage in the form
// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
string source_url = 3;
// An estimate of the number of files in a zip for a zip deployment.
// If set, must be greater than or equal to the actual number of files.
// Used for optimizing performance; if not provided, deployment may be slow.
int32 files_count = 4;
}

View File

@@ -0,0 +1,121 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "InstanceProto";
option java_package = "com.google.appengine.v1";
// An Instance resource is the computing unit that App Engine uses to
// automatically scale an application.
message Instance {
// Availability of the instance.
enum Availability {
UNSPECIFIED = 0;
RESIDENT = 1;
DYNAMIC = 2;
}
// Full path to the Instance resource in the API.
// Example: `apps/myapp/services/default/versions/v1/instances/instance-1`.
//
// @OutputOnly
string name = 1;
// Relative name of the instance within the version.
// Example: `instance-1`.
//
// @OutputOnly
string id = 2;
// App Engine release this instance is running on.
//
// @OutputOnly
string app_engine_release = 3;
// Availability of the instance.
//
// @OutputOnly
Availability availability = 4;
// Name of the virtual machine where this instance lives. Only applicable
// for instances in App Engine flexible environment.
//
// @OutputOnly
string vm_name = 5;
// Zone where the virtual machine is located. Only applicable for instances
// in App Engine flexible environment.
//
// @OutputOnly
string vm_zone_name = 6;
// Virtual machine ID of this instance. Only applicable for instances in
// App Engine flexible environment.
//
// @OutputOnly
string vm_id = 7;
// Time that this instance was started.
//
// @OutputOnly
google.protobuf.Timestamp start_time = 8;
// Number of requests since this instance was started.
//
// @OutputOnly
int32 requests = 9;
// Number of errors since this instance was started.
//
// @OutputOnly
int32 errors = 10;
// Average queries per second (QPS) over the last minute.
//
// @OutputOnly
float qps = 11;
// Average latency (ms) over the last minute.
//
// @OutputOnly
int32 average_latency = 12;
// Total memory in use (bytes).
//
// @OutputOnly
int64 memory_usage = 13;
// Status of the virtual machine where this instance lives. Only applicable
// for instances in App Engine flexible environment.
//
// @OutputOnly
string vm_status = 14;
// Whether this instance is in debug mode. Only applicable for instances in
// App Engine flexible environment.
//
// @OutputOnly
bool vm_debug_enabled = 15;
}

View File

@@ -0,0 +1,39 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
import "google/type/latlng.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "LocationProto";
option java_package = "com.google.appengine.v1";
// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location].
message LocationMetadata {
// App Engine Standard Environment is available in the given location.
//
// @OutputOnly
bool standard_environment_available = 2;
// App Engine Flexible Environment is available in the given location.
//
// @OutputOnly
bool flexible_environment_available = 4;
}

View File

@@ -0,0 +1,56 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "OperationProto";
option java_package = "com.google.appengine.v1";
// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation].
message OperationMetadataV1 {
// API method that initiated this operation. Example:
// `google.appengine.v1.Versions.CreateVersion`.
//
// @OutputOnly
string method = 1;
// Time that this operation was created.
//
// @OutputOnly
google.protobuf.Timestamp insert_time = 2;
// Time that this operation completed.
//
// @OutputOnly
google.protobuf.Timestamp end_time = 3;
// User who requested this operation.
//
// @OutputOnly
string user = 4;
// Name of the resource that this operation is acting on. Example:
// `apps/myapp/services/default`.
//
// @OutputOnly
string target = 5;
}

View File

@@ -0,0 +1,83 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "ServiceProto";
option java_package = "com.google.appengine.v1";
// A Service resource is a logical component of an application that can share
// state and communicate in a secure fashion with other services.
// For example, an application that handles customer requests might
// include separate services to handle tasks such as backend data
// analysis or API requests from mobile devices. Each service has a
// collection of versions that define a specific set of code used to
// implement the functionality of that service.
message Service {
// Full path to the Service resource in the API.
// Example: `apps/myapp/services/default`.
//
// @OutputOnly
string name = 1;
// Relative name of the service within the application.
// Example: `default`.
//
// @OutputOnly
string id = 2;
// Mapping that defines fractional HTTP traffic diversion to
// different versions within the service.
TrafficSplit split = 3;
}
// Traffic routing configuration for versions within a single service. Traffic
// splits define how traffic directed to the service is assigned to versions.
message TrafficSplit {
// Available sharding mechanisms.
enum ShardBy {
// Diversion method unspecified.
UNSPECIFIED = 0;
// Diversion based on a specially named cookie, "GOOGAPPUID." The cookie
// must be set by the application itself or no diversion will occur.
COOKIE = 1;
// Diversion based on applying the modulus operation to a fingerprint
// of the IP address.
IP = 2;
}
// Mechanism used to determine which version a request is sent to.
// The traffic selection algorithm will
// be stable for either type until allocations are changed.
ShardBy shard_by = 1;
// Mapping from version IDs within the service to fractional
// (0.000, 1] allocations of traffic for that version. Each version can
// be specified only once, but some versions in the service may not
// have any traffic allocation. Services that have traffic allocated
// cannot be deleted until either the service is deleted or
// their traffic allocation is removed. Allocations must sum to 1.
// Up to two decimal place precision is supported for IP-based splits and
// up to three decimal places is supported for cookie-based splits.
map<string, double> allocations = 2;
}

View File

@@ -0,0 +1,378 @@
// 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.appengine.v1;
import "google/api/annotations.proto";
import "google/appengine/v1/app_yaml.proto";
import "google/appengine/v1/deploy.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
option java_multiple_files = true;
option java_outer_classname = "VersionProto";
option java_package = "com.google.appengine.v1";
// A Version resource is a specific set of source code and configuration files
// that are deployed into a service.
message Version {
// Full path to the Version resource in the API. Example:
// `apps/myapp/services/default/versions/v1`.
//
// @OutputOnly
string name = 1;
// Relative name of the version within the service. Example: `v1`.
// Version names can contain only lowercase letters, numbers, or hyphens.
// Reserved names: "default", "latest", and any name with the prefix "ah-".
string id = 2;
// Controls how instances are created.
//
// Defaults to `AutomaticScaling`.
oneof scaling {
// Automatic scaling is based on request rate, response latencies, and other
// application metrics.
AutomaticScaling automatic_scaling = 3;
// A service with basic scaling will create an instance when the application
// receives a request. The instance will be turned down when the app becomes
// idle. Basic scaling is ideal for work that is intermittent or driven by
// user activity.
BasicScaling basic_scaling = 4;
// A service with manual scaling runs continuously, allowing you to perform
// complex initialization and rely on the state of its memory over time.
ManualScaling manual_scaling = 5;
}
// Before an application can receive email or XMPP messages, the application
// must be configured to enable the service.
repeated InboundServiceType inbound_services = 6;
// Instance class that is used to run this version. Valid values are:
// * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G`
// * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
//
// Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
// BasicScaling.
string instance_class = 7;
// Extra network settings. Only applicable for VM runtimes.
Network network = 8;
// Machine resources for this version. Only applicable for VM runtimes.
Resources resources = 9;
// Desired runtime. Example: `python27`.
string runtime = 10;
// Whether multiple requests can be dispatched to this version at once.
bool threadsafe = 11;
// Whether to deploy this version in a container on a virtual machine.
bool vm = 12;
// Metadata settings that are supplied to this version to enable
// beta runtime features.
map<string, string> beta_settings = 13;
// App Engine execution environment for this version.
//
// Defaults to `standard`.
string env = 14;
// Current serving status of this version. Only the versions with a
// `SERVING` status create instances and can be billed.
//
// `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`.
ServingStatus serving_status = 15;
// Email address of the user who created this version.
//
// @OutputOnly
string created_by = 16;
// Time that this version was created.
//
// @OutputOnly
google.protobuf.Timestamp create_time = 17;
// Total size in bytes of all the files that are included in this version
// and curerntly hosted on the App Engine disk.
//
// @OutputOnly
int64 disk_usage_bytes = 18;
// An ordered list of URL-matching patterns that should be applied to incoming
// requests. The first matching URL handles the request and other request
// handlers are not attempted.
//
// Only returned in `GET` requests if `view=FULL` is set.
repeated UrlMap handlers = 100;
// Custom static error pages. Limited to 10KB per page.
//
// Only returned in `GET` requests if `view=FULL` is set.
repeated ErrorHandler error_handlers = 101;
// Configuration for third-party Python runtime libraries that are required
// by the application.
//
// Only returned in `GET` requests if `view=FULL` is set.
repeated Library libraries = 102;
// Serving configuration for
// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
//
// Only returned in `GET` requests if `view=FULL` is set.
ApiConfigHandler api_config = 103;
// Environment variables available to the application.
//
// Only returned in `GET` requests if `view=FULL` is set.
map<string, string> env_variables = 104;
// Duration that static files should be cached by web proxies and browsers.
// Only applicable if the corresponding
// [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler)
// does not specify its own expiration time.
//
// Only returned in `GET` requests if `view=FULL` is set.
google.protobuf.Duration default_expiration = 105;
// Configures health checking for VM instances. Unhealthy instances are
// stopped and replaced with new instances. Only applicable for VM
// runtimes.
//
// Only returned in `GET` requests if `view=FULL` is set.
HealthCheck health_check = 106;
// Files that match this pattern will not be built into this version.
// Only applicable for Go runtimes.
//
// Only returned in `GET` requests if `view=FULL` is set.
string nobuild_files_regex = 107;
// Code and application artifacts that make up this version.
//
// Only returned in `GET` requests if `view=FULL` is set.
Deployment deployment = 108;
// Serving URL for this version. Example:
// "https://myversion-dot-myservice-dot-myapp.appspot.com"
//
// @OutputOnly
string version_url = 109;
}
// Automatic scaling is based on request rate, response latencies, and other
// application metrics.
message AutomaticScaling {
// Amount of time that the
// [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
// should wait between changes to the number of virtual machines.
// Only applicable for VM runtimes.
google.protobuf.Duration cool_down_period = 1;
// Target scaling by CPU usage.
CpuUtilization cpu_utilization = 2;
// Number of concurrent requests an automatic scaling instance can accept
// before the scheduler spawns a new instance.
//
// Defaults to a runtime-specific value.
int32 max_concurrent_requests = 3;
// Maximum number of idle instances that should be maintained for this
// version.
int32 max_idle_instances = 4;
// Maximum number of instances that should be started to handle requests.
int32 max_total_instances = 5;
// Maximum amount of time that a request should wait in the pending queue
// before starting a new instance to handle it.
google.protobuf.Duration max_pending_latency = 6;
// Minimum number of idle instances that should be maintained for
// this version. Only applicable for the default version of a service.
int32 min_idle_instances = 7;
// Minimum number of instances that should be maintained for this version.
int32 min_total_instances = 8;
// Minimum amount of time a request should wait in the pending queue before
// starting a new instance to handle it.
google.protobuf.Duration min_pending_latency = 9;
// Target scaling by request utilization.
RequestUtilization request_utilization = 10;
// Target scaling by disk usage.
DiskUtilization disk_utilization = 11;
// Target scaling by network usage.
NetworkUtilization network_utilization = 12;
}
// A service with basic scaling will create an instance when the application
// receives a request. The instance will be turned down when the app becomes
// idle. Basic scaling is ideal for work that is intermittent or driven by
// user activity.
message BasicScaling {
// Duration of time after the last request that an instance must wait before
// the instance is shut down.
google.protobuf.Duration idle_timeout = 1;
// Maximum number of instances to create for this version.
int32 max_instances = 2;
}
// A service with manual scaling runs continuously, allowing you to perform
// complex initialization and rely on the state of its memory over time.
message ManualScaling {
// Number of instances to assign to the service at the start. This number
// can later be altered by using the
// [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions)
// `set_num_instances()` function.
int32 instances = 1;
}
// Target scaling by CPU usage.
message CpuUtilization {
// Period of time over which CPU utilization is calculated.
google.protobuf.Duration aggregation_window_length = 1;
// Target CPU utilization ratio to maintain when scaling. Must be between 0
// and 1.
double target_utilization = 2;
}
// Target scaling by request utilization. Only applicable for VM runtimes.
message RequestUtilization {
// Target requests per second.
int32 target_request_count_per_second = 1;
// Target number of concurrent requests.
int32 target_concurrent_requests = 2;
}
// Target scaling by disk usage. Only applicable for VM runtimes.
message DiskUtilization {
// Target bytes written per second.
int32 target_write_bytes_per_second = 14;
// Target ops written per second.
int32 target_write_ops_per_second = 15;
// Target bytes read per second.
int32 target_read_bytes_per_second = 16;
// Target ops read per seconds.
int32 target_read_ops_per_second = 17;
}
// Target scaling by network usage. Only applicable for VM runtimes.
message NetworkUtilization {
// Target bytes sent per second.
int32 target_sent_bytes_per_second = 1;
// Target packets sent per second.
int32 target_sent_packets_per_second = 11;
// Target bytes received per second.
int32 target_received_bytes_per_second = 12;
// Target packets received per second.
int32 target_received_packets_per_second = 13;
}
// Extra network settings. Only applicable for VM runtimes.
message Network {
// List of ports, or port pairs, to forward from the virtual machine to the
// application container.
repeated string forwarded_ports = 1;
// Tag to apply to the VM instance during creation.
string instance_tag = 2;
// Google Cloud Platform network where the virtual machines are created.
// Specify the short name, not the resource path.
//
// Defaults to `default`.
string name = 3;
}
// Machine resources for a version.
message Resources {
// Number of CPU cores needed.
double cpu = 1;
// Disk size (GB) needed.
double disk_gb = 2;
// Memory (GB) needed.
double memory_gb = 3;
}
// Available inbound services.
enum InboundServiceType {
// Not specified.
INBOUND_SERVICE_UNSPECIFIED = 0;
// Allows an application to receive mail.
INBOUND_SERVICE_MAIL = 1;
// Allows an application to receive email-bound notifications.
INBOUND_SERVICE_MAIL_BOUNCE = 2;
// Allows an application to receive error stanzas.
INBOUND_SERVICE_XMPP_ERROR = 3;
// Allows an application to receive instant messages.
INBOUND_SERVICE_XMPP_MESSAGE = 4;
// Allows an application to receive user subscription POSTs.
INBOUND_SERVICE_XMPP_SUBSCRIBE = 5;
// Allows an application to receive a user's chat presence.
INBOUND_SERVICE_XMPP_PRESENCE = 6;
// Registers an application for notifications when a client connects or
// disconnects from a channel.
INBOUND_SERVICE_CHANNEL_PRESENCE = 7;
// Enables warmup requests.
INBOUND_SERVICE_WARMUP = 9;
}
// Run states of a version.
enum ServingStatus {
// Not specified.
SERVING_STATUS_UNSPECIFIED = 0;
// Currently serving. Instances are created according to the
// scaling settings of the version.
SERVING = 1;
// Disabled. No instances will be created and the scaling
// settings are ignored until the state of the version changes
// to `SERVING`.
STOPPED = 2;
}

View File

@@ -0,0 +1,281 @@
// Copyright 2017 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.assistant.embedded.v1alpha1;
import "google/api/annotations.proto";
import "google/rpc/status.proto";
option go_package = "google.golang.org/genproto/googleapis/assistant/embedded/v1alpha1;embedded";
option java_multiple_files = true;
option java_outer_classname = "AssistantProto";
option java_package = "com.google.assistant.embedded.v1alpha1";
// Service that implements Google Assistant API.
service EmbeddedAssistant {
// Initiates or continues a conversation with the embedded assistant service.
// Each call performs one round-trip, sending an audio request to the service
// and receiving the audio response. Uses bidirectional streaming to receive
// results, such as the `END_OF_UTTERANCE` event, while sending audio.
//
// A conversation is one or more gRPC connections, each consisting of several
// streamed requests and responses.
// For example, the user says *Add to my shopping list* and the assistant
// responds *What do you want to add?*. The sequence of streamed requests and
// responses in the first gRPC message could be:
//
// * ConverseRequest.config
// * ConverseRequest.audio_in
// * ConverseRequest.audio_in
// * ConverseRequest.audio_in
// * ConverseRequest.audio_in
// * ConverseResponse.event_type.END_OF_UTTERANCE
// * ConverseResponse.result.microphone_mode.DIALOG_FOLLOW_ON
// * ConverseResponse.audio_out
// * ConverseResponse.audio_out
// * ConverseResponse.audio_out
//
// The user then says *bagels* and the assistant responds
// *OK, I've added bagels to your shopping list*. This is sent as another gRPC
// connection call to the `Converse` method, again with streamed requests and
// responses, such as:
//
// * ConverseRequest.config
// * ConverseRequest.audio_in
// * ConverseRequest.audio_in
// * ConverseRequest.audio_in
// * ConverseResponse.event_type.END_OF_UTTERANCE
// * ConverseResponse.result.microphone_mode.CLOSE_MICROPHONE
// * ConverseResponse.audio_out
// * ConverseResponse.audio_out
// * ConverseResponse.audio_out
// * ConverseResponse.audio_out
//
// Although the precise order of responses is not guaranteed, sequential
// ConverseResponse.audio_out messages will always contain sequential portions
// of audio.
rpc Converse(stream ConverseRequest) returns (stream ConverseResponse);
}
// Specifies how to process the `ConverseRequest` messages.
message ConverseConfig {
// *Required* Specifies how to process the subsequent incoming audio.
AudioInConfig audio_in_config = 1;
// *Required* Specifies how to format the audio that will be returned.
AudioOutConfig audio_out_config = 2;
// *Required* Represents the current dialog state.
ConverseState converse_state = 3;
}
// Specifies how to process the `audio_in` data that will be provided in
// subsequent requests. For recommended settings, see the Google Assistant SDK
// [best practices](https://developers.google.com/assistant/sdk/develop/grpc/best-practices/audio).
message AudioInConfig {
// Audio encoding of the data sent in the audio message.
// Audio must be one-channel (mono). The only language supported is "en-US".
enum Encoding {
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
ENCODING_UNSPECIFIED = 0;
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
// This encoding includes no header, only the raw audio bytes.
LINEAR16 = 1;
// [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
// Codec) is the recommended encoding because it is
// lossless--therefore recognition is not compromised--and
// requires only about half the bandwidth of `LINEAR16`. This encoding
// includes the `FLAC` stream header followed by audio data. It supports
// 16-bit and 24-bit samples, however, not all fields in `STREAMINFO` are
// supported.
FLAC = 2;
}
// *Required* Encoding of audio data sent in all `audio_in` messages.
Encoding encoding = 1;
// *Required* Sample rate (in Hertz) of the audio data sent in all `audio_in`
// messages. Valid values are from 16000-24000, but 16000 is optimal.
// For best results, set the sampling rate of the audio source to 16000 Hz.
// If that's not possible, use the native sample rate of the audio source
// (instead of re-sampling).
int32 sample_rate_hertz = 2;
}
// Specifies the desired format for the server to use when it returns
// `audio_out` messages.
message AudioOutConfig {
// Audio encoding of the data returned in the audio message. All encodings are
// raw audio bytes with no header, except as indicated below.
enum Encoding {
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
ENCODING_UNSPECIFIED = 0;
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
LINEAR16 = 1;
// MP3 audio encoding. The sample rate is encoded in the payload.
MP3 = 2;
// Opus-encoded audio wrapped in an ogg container. The result will be a
// file which can be played natively on Android and in some browsers (such
// as Chrome). The quality of the encoding is considerably higher than MP3
// while using the same bitrate. The sample rate is encoded in the payload.
OPUS_IN_OGG = 3;
}
// *Required* The encoding of audio data to be returned in all `audio_out`
// messages.
Encoding encoding = 1;
// *Required* The sample rate in Hertz of the audio data returned in
// `audio_out` messages. Valid values are: 16000-24000.
int32 sample_rate_hertz = 2;
// *Required* Current volume setting of the device's audio output.
// Valid values are 1 to 100 (corresponding to 1% to 100%).
int32 volume_percentage = 3;
}
// Provides information about the current dialog state.
message ConverseState {
// *Required* The `conversation_state` value returned in the prior
// `ConverseResponse`. Omit (do not set the field) if there was no prior
// `ConverseResponse`. If there was a prior `ConverseResponse`, do not omit
// this field; doing so will end that conversation (and this new request will
// start a new conversation).
bytes conversation_state = 1;
}
// The audio containing the assistant's response to the query. Sequential chunks
// of audio data are received in sequential `ConverseResponse` messages.
message AudioOut {
// *Output-only* The audio data containing the assistant's response to the
// query. Sequential chunks of audio data are received in sequential
// `ConverseResponse` messages.
bytes audio_data = 1;
}
// The semantic result for the user's spoken query.
message ConverseResult {
// Possible states of the microphone after a `Converse` RPC completes.
enum MicrophoneMode {
// No mode specified.
MICROPHONE_MODE_UNSPECIFIED = 0;
// The service is not expecting a follow-on question from the user.
// The microphone should remain off until the user re-activates it.
CLOSE_MICROPHONE = 1;
// The service is expecting a follow-on question from the user. The
// microphone should be re-opened when the `AudioOut` playback completes
// (by starting a new `Converse` RPC call to send the new audio).
DIALOG_FOLLOW_ON = 2;
}
// *Output-only* The recognized transcript of what the user said.
string spoken_request_text = 1;
// *Output-only* The text of the assistant's spoken response. This is only
// returned for an IFTTT action.
string spoken_response_text = 2;
// *Output-only* State information for subsequent `ConverseRequest`. This
// value should be saved in the client and returned in the
// `conversation_state` with the next `ConverseRequest`. (The client does not
// need to interpret or otherwise use this value.) There is no need to save
// this information across device restarts.
bytes conversation_state = 3;
// *Output-only* Specifies the mode of the microphone after this `Converse`
// RPC is processed.
MicrophoneMode microphone_mode = 4;
// *Output-only* Updated volume level. The value will be 0 or omitted
// (indicating no change) unless a voice command such as "Increase the volume"
// or "Set volume level 4" was recognized, in which case the value will be
// between 1 and 100 (corresponding to the new volume level of 1% to 100%).
// Typically, a client should use this volume level when playing the
// `audio_out` data, and retain this value as the current volume level and
// supply it in the `AudioOutConfig` of the next `ConverseRequest`. (Some
// clients may also implement other ways to allow the current volume level to
// be changed, for example, by providing a knob that the user can turn.)
int32 volume_percentage = 5;
}
// The top-level message sent by the client. Clients must send at least two, and
// typically numerous `ConverseRequest` messages. The first message must
// contain a `config` message and must not contain `audio_in` data. All
// subsequent messages must contain `audio_in` data and must not contain a
// `config` message.
message ConverseRequest {
// Exactly one of these fields must be specified in each `ConverseRequest`.
oneof converse_request {
// The `config` message provides information to the recognizer that
// specifies how to process the request.
// The first `ConverseRequest` message must contain a `config` message.
ConverseConfig config = 1;
// The audio data to be recognized. Sequential chunks of audio data are sent
// in sequential `ConverseRequest` messages. The first `ConverseRequest`
// message must not contain `audio_in` data and all subsequent
// `ConverseRequest` messages must contain `audio_in` data. The audio bytes
// must be encoded as specified in `AudioInConfig`.
// Audio must be sent at approximately real-time (16000 samples per second).
// An error will be returned if audio is sent significantly faster or
// slower.
bytes audio_in = 2;
}
}
// The top-level message received by the client. A series of one or more
// `ConverseResponse` messages are streamed back to the client.
message ConverseResponse {
// Indicates the type of event.
enum EventType {
// No event specified.
EVENT_TYPE_UNSPECIFIED = 0;
// This event indicates that the server has detected the end of the user's
// speech utterance and expects no additional speech. Therefore, the server
// will not process additional audio (although it may subsequently return
// additional results). The client should stop sending additional audio
// data, half-close the gRPC connection, and wait for any additional results
// until the server closes the gRPC connection.
END_OF_UTTERANCE = 1;
}
// Exactly one of these fields will be populated in each `ConverseResponse`.
oneof converse_response {
// *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
// specifies the error for the operation.
// If an error occurs during processing, this message will be set and there
// will be no further messages sent.
google.rpc.Status error = 1;
// *Output-only* Indicates the type of event.
EventType event_type = 2;
// *Output-only* The audio containing the assistant's response to the query.
AudioOut audio_out = 3;
// *Output-only* The semantic result for the user's spoken query.
ConverseResult result = 5;
}
}

View File

@@ -0,0 +1,462 @@
// Copyright 2018 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.assistant.embedded.v1alpha2;
import "google/api/annotations.proto";
import "google/type/latlng.proto";
option go_package = "google.golang.org/genproto/googleapis/assistant/embedded/v1alpha2;embedded";
option java_multiple_files = true;
option java_outer_classname = "AssistantProto";
option java_package = "com.google.assistant.embedded.v1alpha2";
option objc_class_prefix = "ASTSDK";
// Service that implements the Google Assistant API.
service EmbeddedAssistant {
// Initiates or continues a conversation with the embedded Assistant Service.
// Each call performs one round-trip, sending an audio request to the service
// and receiving the audio response. Uses bidirectional streaming to receive
// results, such as the `END_OF_UTTERANCE` event, while sending audio.
//
// A conversation is one or more gRPC connections, each consisting of several
// streamed requests and responses.
// For example, the user says *Add to my shopping list* and the Assistant
// responds *What do you want to add?*. The sequence of streamed requests and
// responses in the first gRPC message could be:
//
// * AssistRequest.config
// * AssistRequest.audio_in
// * AssistRequest.audio_in
// * AssistRequest.audio_in
// * AssistRequest.audio_in
// * AssistResponse.event_type.END_OF_UTTERANCE
// * AssistResponse.speech_results.transcript "add to my shopping list"
// * AssistResponse.dialog_state_out.microphone_mode.DIALOG_FOLLOW_ON
// * AssistResponse.audio_out
// * AssistResponse.audio_out
// * AssistResponse.audio_out
//
//
// The user then says *bagels* and the Assistant responds
// *OK, I've added bagels to your shopping list*. This is sent as another gRPC
// connection call to the `Assist` method, again with streamed requests and
// responses, such as:
//
// * AssistRequest.config
// * AssistRequest.audio_in
// * AssistRequest.audio_in
// * AssistRequest.audio_in
// * AssistResponse.event_type.END_OF_UTTERANCE
// * AssistResponse.dialog_state_out.microphone_mode.CLOSE_MICROPHONE
// * AssistResponse.audio_out
// * AssistResponse.audio_out
// * AssistResponse.audio_out
// * AssistResponse.audio_out
//
// Although the precise order of responses is not guaranteed, sequential
// `AssistResponse.audio_out` messages will always contain sequential portions
// of audio.
rpc Assist(stream AssistRequest) returns (stream AssistResponse);
}
// The top-level message sent by the client. Clients must send at least two, and
// typically numerous `AssistRequest` messages. The first message must
// contain a `config` message and must not contain `audio_in` data. All
// subsequent messages must contain `audio_in` data and must not contain a
// `config` message.
message AssistRequest {
// Exactly one of these fields must be specified in each `AssistRequest`.
oneof type {
// The `config` message provides information to the recognizer that
// specifies how to process the request.
// The first `AssistRequest` message must contain a `config` message.
AssistConfig config = 1;
// The audio data to be recognized. Sequential chunks of audio data are sent
// in sequential `AssistRequest` messages. The first `AssistRequest`
// message must not contain `audio_in` data and all subsequent
// `AssistRequest` messages must contain `audio_in` data. The audio bytes
// must be encoded as specified in `AudioInConfig`.
// Audio must be sent at approximately real-time (16000 samples per second).
// An error will be returned if audio is sent significantly faster or
// slower.
bytes audio_in = 2;
}
}
// The top-level message received by the client. A series of one or more
// `AssistResponse` messages are streamed back to the client.
message AssistResponse {
// Indicates the type of event.
enum EventType {
// No event specified.
EVENT_TYPE_UNSPECIFIED = 0;
// This event indicates that the server has detected the end of the user's
// speech utterance and expects no additional speech. Therefore, the server
// will not process additional audio (although it may subsequently return
// additional results). The client should stop sending additional audio
// data, half-close the gRPC connection, and wait for any additional results
// until the server closes the gRPC connection.
END_OF_UTTERANCE = 1;
}
// *Output-only* Indicates the type of event.
EventType event_type = 1;
// *Output-only* The audio containing the Assistant's response to the query.
AudioOut audio_out = 3;
// *Output-only* Contains the Assistant's visual response to the query.
ScreenOut screen_out = 4;
// *Output-only* Contains the action triggered by the query with the
// appropriate payloads and semantic parsing.
DeviceAction device_action = 6;
// *Output-only* This repeated list contains zero or more speech recognition
// results that correspond to consecutive portions of the audio currently
// being processed, starting with the portion corresponding to the earliest
// audio (and most stable portion) to the portion corresponding to the most
// recent audio. The strings can be concatenated to view the full
// in-progress response. When the speech recognition completes, this list
// will contain one item with `stability` of `1.0`.
repeated SpeechRecognitionResult speech_results = 2;
// *Output-only* Contains output related to the user's query.
DialogStateOut dialog_state_out = 5;
// *Output-only* Debugging info for developer. Only returned if request set
// `return_debug_info` to true.
DebugInfo debug_info = 8;
}
// Debug info for developer. Only returned if request set `return_debug_info`
// to true.
message DebugInfo {
// The original JSON response from an Action-on-Google agent to Google server.
// See
// https://developers.google.com/actions/reference/rest/Shared.Types/AppResponse.
// It will only be populated if the request maker owns the AoG project and the
// AoG project is in preview mode.
string aog_agent_to_assistant_json = 1;
}
// Specifies how to process the `AssistRequest` messages.
message AssistConfig {
oneof type {
// Specifies how to process the subsequent incoming audio. Required if
// [AssistRequest.audio_in][google.assistant.embedded.v1alpha2.AssistRequest.audio_in] bytes will be provided in subsequent requests.
AudioInConfig audio_in_config = 1;
// The text input to be sent to the Assistant. This can be populated from a
// text interface if audio input is not available.
string text_query = 6;
}
// *Required* Specifies how to format the audio that will be returned.
AudioOutConfig audio_out_config = 2;
// *Optional* Specifies the desired format to use when server returns a
// visual screen response.
ScreenOutConfig screen_out_config = 8;
// *Required* Represents the current dialog state.
DialogStateIn dialog_state_in = 3;
// Device configuration that uniquely identifies a specific device.
DeviceConfig device_config = 4;
// *Optional* Debugging parameters for the whole `Assist` RPC.
DebugConfig debug_config = 5;
}
// Specifies how to process the `audio_in` data that will be provided in
// subsequent requests. For recommended settings, see the Google Assistant SDK
// [best practices](https://developers.google.com/assistant/sdk/guides/service/python/best-practices/audio).
message AudioInConfig {
// Audio encoding of the data sent in the audio message.
// Audio must be one-channel (mono).
enum Encoding {
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
ENCODING_UNSPECIFIED = 0;
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
// This encoding includes no header, only the raw audio bytes.
LINEAR16 = 1;
// [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
// Codec) is the recommended encoding because it is
// lossless--therefore recognition is not compromised--and
// requires only about half the bandwidth of `LINEAR16`. This encoding
// includes the `FLAC` stream header followed by audio data. It supports
// 16-bit and 24-bit samples, however, not all fields in `STREAMINFO` are
// supported.
FLAC = 2;
}
// *Required* Encoding of audio data sent in all `audio_in` messages.
Encoding encoding = 1;
// *Required* Sample rate (in Hertz) of the audio data sent in all `audio_in`
// messages. Valid values are from 16000-24000, but 16000 is optimal.
// For best results, set the sampling rate of the audio source to 16000 Hz.
// If that's not possible, use the native sample rate of the audio source
// (instead of re-sampling).
int32 sample_rate_hertz = 2;
}
// Specifies the desired format for the server to use when it returns
// `audio_out` messages.
message AudioOutConfig {
// Audio encoding of the data returned in the audio message. All encodings are
// raw audio bytes with no header, except as indicated below.
enum Encoding {
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
ENCODING_UNSPECIFIED = 0;
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
LINEAR16 = 1;
// MP3 audio encoding. The sample rate is encoded in the payload.
MP3 = 2;
// Opus-encoded audio wrapped in an ogg container. The result will be a
// file which can be played natively on Android and in some browsers (such
// as Chrome). The quality of the encoding is considerably higher than MP3
// while using the same bitrate. The sample rate is encoded in the payload.
OPUS_IN_OGG = 3;
}
// *Required* The encoding of audio data to be returned in all `audio_out`
// messages.
Encoding encoding = 1;
// *Required* The sample rate in Hertz of the audio data returned in
// `audio_out` messages. Valid values are: 16000-24000.
int32 sample_rate_hertz = 2;
// *Required* Current volume setting of the device's audio output.
// Valid values are 1 to 100 (corresponding to 1% to 100%).
int32 volume_percentage = 3;
}
// Specifies the desired format for the server to use when it returns
// `screen_out` response.
message ScreenOutConfig {
// Possible modes for visual screen-output on the device.
enum ScreenMode {
// No video mode specified.
// The Assistant may respond as if in `OFF` mode.
SCREEN_MODE_UNSPECIFIED = 0;
// Screen is off (or has brightness or other settings set so low it is
// not visible). The Assistant will typically not return a screen response
// in this mode.
OFF = 1;
// The Assistant will typically return a partial-screen response in this
// mode.
PLAYING = 3;
}
// Current visual screen-mode for the device while issuing the query.
ScreenMode screen_mode = 1;
}
// Provides information about the current dialog state.
message DialogStateIn {
// *Required* This field must always be set to the
// [DialogStateOut.conversation_state][google.assistant.embedded.v1alpha2.DialogStateOut.conversation_state] value that was returned in the prior
// `Assist` RPC. It should only be omitted (field not set) if there was no
// prior `Assist` RPC because this is the first `Assist` RPC made by this
// device after it was first setup and/or a factory-default reset.
bytes conversation_state = 1;
// *Required* Language of the request in
// [IETF BCP 47 syntax](https://tools.ietf.org/html/bcp47) (for example,
// "en-US"). See [Language Support](https://developers.google.com/assistant/sdk/reference/rpc/languages)
// for more information. If you have selected a language for this `device_id`
// using the [Settings](https://developers.google.com/assistant/sdk/reference/assistant-app/assistant-settings)
// menu in your phone's Google Assistant app, that selection will override
// this value.
string language_code = 2;
// *Optional* Location of the device where the query originated.
DeviceLocation device_location = 5;
// *Optional* If true, the server will treat the request as a new conversation
// and not use state from the prior request. Set this field to true when the
// conversation should be restarted, such as after a device reboot, or after a
// significant lapse of time since the prior query.
bool is_new_conversation = 7;
}
// *Required* Fields that identify the device to the Assistant.
//
// See also:
//
// * [Register a Device - REST
// API](https://developers.google.com/assistant/sdk/reference/device-registration/register-device-manual)
// * [Device Model and Instance
// Schemas](https://developers.google.com/assistant/sdk/reference/device-registration/model-and-instance-schemas)
// * [Device
// Proto](https://developers.google.com/assistant/sdk/reference/rpc/google.assistant.devices.v1alpha2#device)
message DeviceConfig {
// *Required* Unique identifier for the device. The id length must be 128
// characters or less. Example: DBCDW098234. This MUST match the device_id
// returned from device registration. This device_id is used to match against
// the user's registered devices to lookup the supported traits and
// capabilities of this device. This information should not change across
// device reboots. However, it should not be saved across
// factory-default resets.
string device_id = 1;
// *Required* Unique identifier for the device model. The combination of
// device_model_id and device_id must have been previously associated through
// device registration.
string device_model_id = 3;
}
// The audio containing the Assistant's response to the query. Sequential chunks
// of audio data are received in sequential `AssistResponse` messages.
message AudioOut {
// *Output-only* The audio data containing the Assistant's response to the
// query. Sequential chunks of audio data are received in sequential
// `AssistResponse` messages.
bytes audio_data = 1;
}
// The Assistant's visual output response to query. Enabled by
// `screen_out_config`.
message ScreenOut {
// Possible formats of the screen data.
enum Format {
// No format specified.
FORMAT_UNSPECIFIED = 0;
// Data will contain a fully-formed HTML5 layout encoded in UTF-8, e.g.
// `<html><body><div>...</div></body></html>`. It is intended to be rendered
// along with the audio response. Note that HTML5 doctype should be included
// in the actual HTML data.
HTML = 1;
}
// *Output-only* The format of the provided screen data.
Format format = 1;
// *Output-only* The raw screen data to be displayed as the result of the
// Assistant query.
bytes data = 2;
}
// The response returned to the device if the user has triggered a Device
// Action. For example, a device which supports the query *Turn on the light*
// would receive a `DeviceAction` with a JSON payload containing the semantics
// of the request.
message DeviceAction {
// JSON containing the device command response generated from the triggered
// Device Action grammar. The format is given by the
// `action.devices.EXECUTE` intent for a given
// [trait](https://developers.google.com/assistant/sdk/reference/traits/).
string device_request_json = 1;
}
// The estimated transcription of a phrase the user has spoken. This could be
// a single segment or the full guess of the user's spoken query.
message SpeechRecognitionResult {
// *Output-only* Transcript text representing the words that the user spoke.
string transcript = 1;
// *Output-only* An estimate of the likelihood that the Assistant will not
// change its guess about this result. Values range from 0.0 (completely
// unstable) to 1.0 (completely stable and final). The default of 0.0 is a
// sentinel value indicating `stability` was not set.
float stability = 2;
}
// The dialog state resulting from the user's query. Multiple of these messages
// may be received.
message DialogStateOut {
// Possible states of the microphone after a `Assist` RPC completes.
enum MicrophoneMode {
// No mode specified.
MICROPHONE_MODE_UNSPECIFIED = 0;
// The service is not expecting a follow-on question from the user.
// The microphone should remain off until the user re-activates it.
CLOSE_MICROPHONE = 1;
// The service is expecting a follow-on question from the user. The
// microphone should be re-opened when the `AudioOut` playback completes
// (by starting a new `Assist` RPC call to send the new audio).
DIALOG_FOLLOW_ON = 2;
}
// *Output-only* Supplemental display text from the Assistant. This could be
// the same as the speech spoken in `AssistResponse.audio_out` or it could
// be some additional information which aids the user's understanding.
string supplemental_display_text = 1;
// *Output-only* State information for the subsequent `Assist` RPC. This
// value should be saved in the client and returned in the
// [`DialogStateIn.conversation_state`](#dialogstatein) field with the next
// `Assist` RPC. (The client does not need to interpret or otherwise use this
// value.) This information should be saved across device reboots. However,
// this value should be cleared (not saved in the client) during a
// factory-default reset.
bytes conversation_state = 2;
// *Output-only* Specifies the mode of the microphone after this `Assist`
// RPC is processed.
MicrophoneMode microphone_mode = 3;
// *Output-only* Updated volume level. The value will be 0 or omitted
// (indicating no change) unless a voice command such as *Increase the volume*
// or *Set volume level 4* was recognized, in which case the value will be
// between 1 and 100 (corresponding to the new volume level of 1% to 100%).
// Typically, a client should use this volume level when playing the
// `audio_out` data, and retain this value as the current volume level and
// supply it in the `AudioOutConfig` of the next `AssistRequest`. (Some
// clients may also implement other ways to allow the current volume level to
// be changed, for example, by providing a knob that the user can turn.)
int32 volume_percentage = 4;
}
// Debugging parameters for the current request.
message DebugConfig {
// When this field is set to true, the `debug_info` field in `AssistResponse`
// may be populated. However it will significantly increase latency of
// responses. Do not set this field true in production code.
bool return_debug_info = 6;
}
// There are three sources of locations. They are used with this precedence:
//
// 1. This `DeviceLocation`, which is primarily used for mobile devices with
// GPS .
// 2. Location specified by the user during device setup; this is per-user, per
// device. This location is used if `DeviceLocation` is not specified.
// 3. Inferred location based on IP address. This is used only if neither of the
// above are specified.
message DeviceLocation {
oneof type {
// Latitude and longitude of device.
google.type.LatLng coordinates = 1;
}
}

View File

@@ -0,0 +1,94 @@
// Copyright 2017 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.bigtable.admin.cluster.v1;
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1;cluster";
option java_multiple_files = true;
option java_outer_classname = "BigtableClusterDataProto";
option java_package = "com.google.bigtable.admin.cluster.v1";
// A physical location in which a particular project can allocate Cloud BigTable
// resources.
message Zone {
// Possible states of a zone.
enum Status {
// The state of the zone is unknown or unspecified.
UNKNOWN = 0;
// The zone is in a good state.
OK = 1;
// The zone is down for planned maintenance.
PLANNED_MAINTENANCE = 2;
// The zone is down for emergency or unplanned maintenance.
EMERGENCY_MAINENANCE = 3;
}
// A permanent unique identifier for the zone.
// Values are of the form projects/<project>/zones/[a-z][-a-z0-9]*
string name = 1;
// The name of this zone as it appears in UIs.
string display_name = 2;
// The current state of this zone.
Status status = 3;
}
// An isolated set of Cloud BigTable resources on which tables can be hosted.
message Cluster {
// A permanent unique identifier for the cluster. For technical reasons, the
// zone in which the cluster resides is included here.
// Values are of the form
// projects/<project>/zones/<zone>/clusters/[a-z][-a-z0-9]*
string name = 1;
// The operation currently running on the cluster, if any.
// This cannot be set directly, only through CreateCluster, UpdateCluster,
// or UndeleteCluster. Calls to these methods will be rejected if
// "current_operation" is already set.
google.longrunning.Operation current_operation = 3;
// The descriptive name for this cluster as it appears in UIs.
// Must be unique per zone.
string display_name = 4;
// The number of serve nodes allocated to this cluster.
int32 serve_nodes = 5;
// What storage type to use for tables in this cluster. Only configurable at
// cluster creation time. If unspecified, STORAGE_SSD will be used.
StorageType default_storage_type = 8;
}
enum StorageType {
// The storage type used is unspecified.
STORAGE_UNSPECIFIED = 0;
// Data will be stored in SSD, providing low and consistent latencies.
STORAGE_SSD = 1;
// Data will be stored in HDD, providing high and less predictable
// latencies.
STORAGE_HDD = 2;
}

View File

@@ -0,0 +1,130 @@
// Copyright 2017 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.bigtable.admin.cluster.v1;
import "google/api/annotations.proto";
import "google/bigtable/admin/cluster/v1/bigtable_cluster_data.proto";
import "google/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1;cluster";
option java_multiple_files = true;
option java_outer_classname = "BigtableClusterServicesProto";
option java_package = "com.google.bigtable.admin.cluster.v1";
// Service for managing zonal Cloud Bigtable resources.
service BigtableClusterService {
// Lists the supported zones for the given project.
rpc ListZones(ListZonesRequest) returns (ListZonesResponse) {
option (google.api.http) = { get: "/v1/{name=projects/*}/zones" };
}
// Gets information about a particular cluster.
rpc GetCluster(GetClusterRequest) returns (Cluster) {
option (google.api.http) = { get: "/v1/{name=projects/*/zones/*/clusters/*}" };
}
// Lists all clusters in the given project, along with any zones for which
// cluster information could not be retrieved.
rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
option (google.api.http) = { get: "/v1/{name=projects/*}/aggregated/clusters" };
}
// Creates a cluster and begins preparing it to begin serving. The returned
// cluster embeds as its "current_operation" a long-running operation which
// can be used to track the progress of turning up the new cluster.
// Immediately upon completion of this request:
// * The cluster will be readable via the API, with all requested attributes
// but no allocated resources.
// Until completion of the embedded operation:
// * Cancelling the operation will render the cluster immediately unreadable
// via the API.
// * All other attempts to modify or delete the cluster will be rejected.
// Upon completion of the embedded operation:
// * Billing for all successfully-allocated resources will begin (some types
// may have lower than the requested levels).
// * New tables can be created in the cluster.
// * The cluster's allocated resource levels will be readable via the API.
// The embedded operation's "metadata" field type is
// [CreateClusterMetadata][google.bigtable.admin.cluster.v1.CreateClusterMetadata] The embedded operation's "response" field type is
// [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful.
rpc CreateCluster(CreateClusterRequest) returns (Cluster) {
option (google.api.http) = { post: "/v1/{name=projects/*/zones/*}/clusters" body: "*" };
}
// Updates a cluster, and begins allocating or releasing resources as
// requested. The returned cluster embeds as its "current_operation" a
// long-running operation which can be used to track the progress of updating
// the cluster.
// Immediately upon completion of this request:
// * For resource types where a decrease in the cluster's allocation has been
// requested, billing will be based on the newly-requested level.
// Until completion of the embedded operation:
// * Cancelling the operation will set its metadata's "cancelled_at_time",
// and begin restoring resources to their pre-request values. The operation
// is guaranteed to succeed at undoing all resource changes, after which
// point it will terminate with a CANCELLED status.
// * All other attempts to modify or delete the cluster will be rejected.
// * Reading the cluster via the API will continue to give the pre-request
// resource levels.
// Upon completion of the embedded operation:
// * Billing will begin for all successfully-allocated resources (some types
// may have lower than the requested levels).
// * All newly-reserved resources will be available for serving the cluster's
// tables.
// * The cluster's new resource levels will be readable via the API.
// [UpdateClusterMetadata][google.bigtable.admin.cluster.v1.UpdateClusterMetadata] The embedded operation's "response" field type is
// [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful.
rpc UpdateCluster(Cluster) returns (Cluster) {
option (google.api.http) = { put: "/v1/{name=projects/*/zones/*/clusters/*}" body: "*" };
}
// Marks a cluster and all of its tables for permanent deletion in 7 days.
// Immediately upon completion of the request:
// * Billing will cease for all of the cluster's reserved resources.
// * The cluster's "delete_time" field will be set 7 days in the future.
// Soon afterward:
// * All tables within the cluster will become unavailable.
// Prior to the cluster's "delete_time":
// * The cluster can be recovered with a call to UndeleteCluster.
// * All other attempts to modify or delete the cluster will be rejected.
// At the cluster's "delete_time":
// * The cluster and *all of its tables* will immediately and irrevocably
// disappear from the API, and their data will be permanently deleted.
rpc DeleteCluster(DeleteClusterRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v1/{name=projects/*/zones/*/clusters/*}" };
}
// Cancels the scheduled deletion of an cluster and begins preparing it to
// resume serving. The returned operation will also be embedded as the
// cluster's "current_operation".
// Immediately upon completion of this request:
// * The cluster's "delete_time" field will be unset, protecting it from
// automatic deletion.
// Until completion of the returned operation:
// * The operation cannot be cancelled.
// Upon completion of the returned operation:
// * Billing for the cluster's resources will resume.
// * All tables within the cluster will be available.
// [UndeleteClusterMetadata][google.bigtable.admin.cluster.v1.UndeleteClusterMetadata] The embedded operation's "response" field type is
// [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful.
rpc UndeleteCluster(UndeleteClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/{name=projects/*/zones/*/clusters/*}:undelete" body: "" };
}
}

View File

@@ -0,0 +1,141 @@
// Copyright 2017 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.bigtable.admin.cluster.v1;
import "google/bigtable/admin/cluster/v1/bigtable_cluster_data.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1;cluster";
option java_multiple_files = true;
option java_outer_classname = "BigtableClusterServiceMessagesProto";
option java_package = "com.google.bigtable.admin.cluster.v1";
// Request message for BigtableClusterService.ListZones.
message ListZonesRequest {
// The unique name of the project for which a list of supported zones is
// requested.
// Values are of the form projects/<project>
string name = 1;
}
// Response message for BigtableClusterService.ListZones.
message ListZonesResponse {
// The list of requested zones.
repeated Zone zones = 1;
}
// Request message for BigtableClusterService.GetCluster.
message GetClusterRequest {
// The unique name of the requested cluster.
// Values are of the form projects/<project>/zones/<zone>/clusters/<cluster>
string name = 1;
}
// Request message for BigtableClusterService.ListClusters.
message ListClustersRequest {
// The unique name of the project for which a list of clusters is requested.
// Values are of the form projects/<project>
string name = 1;
}
// Response message for BigtableClusterService.ListClusters.
message ListClustersResponse {
// The list of requested Clusters.
repeated Cluster clusters = 1;
// The zones for which clusters could not be retrieved.
repeated Zone failed_zones = 2;
}
// Request message for BigtableClusterService.CreateCluster.
message CreateClusterRequest {
// The unique name of the zone in which to create the cluster.
// Values are of the form projects/<project>/zones/<zone>
string name = 1;
// The id to be used when referring to the new cluster within its zone,
// e.g. just the "test-cluster" section of the full name
// "projects/<project>/zones/<zone>/clusters/test-cluster".
string cluster_id = 2;
// The cluster to create.
// The "name", "delete_time", and "current_operation" fields must be left
// blank.
Cluster cluster = 3;
}
// Metadata type for the operation returned by
// BigtableClusterService.CreateCluster.
message CreateClusterMetadata {
// The request which prompted the creation of this operation.
CreateClusterRequest original_request = 1;
// The time at which original_request was received.
google.protobuf.Timestamp request_time = 2;
// The time at which this operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 3;
}
// Metadata type for the operation returned by
// BigtableClusterService.UpdateCluster.
message UpdateClusterMetadata {
// The request which prompted the creation of this operation.
Cluster original_request = 1;
// The time at which original_request was received.
google.protobuf.Timestamp request_time = 2;
// The time at which this operation was cancelled. If set, this operation is
// in the process of undoing itself (which is guaranteed to succeed) and
// cannot be cancelled again.
google.protobuf.Timestamp cancel_time = 3;
// The time at which this operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 4;
}
// Request message for BigtableClusterService.DeleteCluster.
message DeleteClusterRequest {
// The unique name of the cluster to be deleted.
// Values are of the form projects/<project>/zones/<zone>/clusters/<cluster>
string name = 1;
}
// Request message for BigtableClusterService.UndeleteCluster.
message UndeleteClusterRequest {
// The unique name of the cluster to be un-deleted.
// Values are of the form projects/<project>/zones/<zone>/clusters/<cluster>
string name = 1;
}
// Metadata type for the operation returned by
// BigtableClusterService.UndeleteCluster.
message UndeleteClusterMetadata {
// The time at which the original request was received.
google.protobuf.Timestamp request_time = 1;
// The time at which this operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 2;
}
// Metadata type for operations initiated by the V2 BigtableAdmin service.
// More complete information for such operations is available via the V2 API.
message V2OperationMetadata {
}

View File

@@ -0,0 +1,126 @@
// Copyright 2017 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.bigtable.admin.table.v1;
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/table/v1;table";
option java_multiple_files = true;
option java_outer_classname = "BigtableTableDataProto";
option java_package = "com.google.bigtable.admin.table.v1";
// A collection of user data indexed by row, column, and timestamp.
// Each table is served using the resources of its parent cluster.
message Table {
enum TimestampGranularity {
MILLIS = 0;
}
// A unique identifier of the form
// <cluster_name>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*
string name = 1;
// If this Table is in the process of being created, the Operation used to
// track its progress. As long as this operation is present, the Table will
// not accept any Table Admin or Read/Write requests.
google.longrunning.Operation current_operation = 2;
// The column families configured for this table, mapped by column family id.
map<string, ColumnFamily> column_families = 3;
// The granularity (e.g. MILLIS, MICROS) at which timestamps are stored in
// this table. Timestamps not matching the granularity will be rejected.
// Cannot be changed once the table is created.
TimestampGranularity granularity = 4;
}
// A set of columns within a table which share a common configuration.
message ColumnFamily {
// A unique identifier of the form <table_name>/columnFamilies/[-_.a-zA-Z0-9]+
// The last segment is the same as the "name" field in
// google.bigtable.v1.Family.
string name = 1;
// Garbage collection expression specified by the following grammar:
// GC = EXPR
// | "" ;
// EXPR = EXPR, "||", EXPR (* lowest precedence *)
// | EXPR, "&&", EXPR
// | "(", EXPR, ")" (* highest precedence *)
// | PROP ;
// PROP = "version() >", NUM32
// | "age() >", NUM64, [ UNIT ] ;
// NUM32 = non-zero-digit { digit } ; (* # NUM32 <= 2^32 - 1 *)
// NUM64 = non-zero-digit { digit } ; (* # NUM64 <= 2^63 - 1 *)
// UNIT = "d" | "h" | "m" (* d=days, h=hours, m=minutes, else micros *)
// GC expressions can be up to 500 characters in length
//
// The different types of PROP are defined as follows:
// version() - cell index, counting from most recent and starting at 1
// age() - age of the cell (current time minus cell timestamp)
//
// Example: "version() > 3 || (age() > 3d && version() > 1)"
// drop cells beyond the most recent three, and drop cells older than three
// days unless they're the most recent cell in the row/column
//
// Garbage collection executes opportunistically in the background, and so
// it's possible for reads to return a cell even if it matches the active GC
// expression for its family.
string gc_expression = 2;
// Garbage collection rule specified as a protobuf.
// Supersedes `gc_expression`.
// Must serialize to at most 500 bytes.
//
// NOTE: Garbage collection executes opportunistically in the background, and
// so it's possible for reads to return a cell even if it matches the active
// GC expression for its family.
GcRule gc_rule = 3;
}
// Rule for determining which cells to delete during garbage collection.
message GcRule {
// A GcRule which deletes cells matching all of the given rules.
message Intersection {
// Only delete cells which would be deleted by every element of `rules`.
repeated GcRule rules = 1;
}
// A GcRule which deletes cells matching any of the given rules.
message Union {
// Delete cells which would be deleted by any element of `rules`.
repeated GcRule rules = 1;
}
oneof rule {
// Delete all cells in a column except the most recent N.
int32 max_num_versions = 1;
// Delete cells in a column older than the given age.
// Values must be at least one millisecond, and will be truncated to
// microsecond granularity.
google.protobuf.Duration max_age = 2;
// Delete cells that would be deleted by every nested rule.
Intersection intersection = 3;
// Delete cells that would be deleted by any nested rule.
Union union = 4;
}
}

View File

@@ -0,0 +1,80 @@
// Copyright 2017 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.bigtable.admin.table.v1;
import "google/api/annotations.proto";
import "google/bigtable/admin/table/v1/bigtable_table_data.proto";
import "google/bigtable/admin/table/v1/bigtable_table_service_messages.proto";
import "google/protobuf/empty.proto";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/table/v1;table";
option java_multiple_files = true;
option java_outer_classname = "BigtableTableServicesProto";
option java_package = "com.google.bigtable.admin.table.v1";
// Service for creating, configuring, and deleting Cloud Bigtable tables.
// Provides access to the table schemas only, not the data stored within the tables.
service BigtableTableService {
// Creates a new table, to be served from a specified cluster.
// The table can be created with a full set of initial column families,
// specified in the request.
rpc CreateTable(CreateTableRequest) returns (Table) {
option (google.api.http) = { post: "/v1/{name=projects/*/zones/*/clusters/*}/tables" body: "*" };
}
// Lists the names of all tables served from a specified cluster.
rpc ListTables(ListTablesRequest) returns (ListTablesResponse) {
option (google.api.http) = { get: "/v1/{name=projects/*/zones/*/clusters/*}/tables" };
}
// Gets the schema of the specified table, including its column families.
rpc GetTable(GetTableRequest) returns (Table) {
option (google.api.http) = { get: "/v1/{name=projects/*/zones/*/clusters/*/tables/*}" };
}
// Permanently deletes a specified table and all of its data.
rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v1/{name=projects/*/zones/*/clusters/*/tables/*}" };
}
// Changes the name of a specified table.
// Cannot be used to move tables between clusters, zones, or projects.
rpc RenameTable(RenameTableRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { post: "/v1/{name=projects/*/zones/*/clusters/*/tables/*}:rename" body: "*" };
}
// Creates a new column family within a specified table.
rpc CreateColumnFamily(CreateColumnFamilyRequest) returns (ColumnFamily) {
option (google.api.http) = { post: "/v1/{name=projects/*/zones/*/clusters/*/tables/*}/columnFamilies" body: "*" };
}
// Changes the configuration of a specified column family.
rpc UpdateColumnFamily(ColumnFamily) returns (ColumnFamily) {
option (google.api.http) = { put: "/v1/{name=projects/*/zones/*/clusters/*/tables/*/columnFamilies/*}" body: "*" };
}
// Permanently deletes a specified column family and all of its data.
rpc DeleteColumnFamily(DeleteColumnFamilyRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v1/{name=projects/*/zones/*/clusters/*/tables/*/columnFamilies/*}" };
}
// Delete all rows in a table corresponding to a particular prefix
rpc BulkDeleteRows(BulkDeleteRowsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { post: "/v1/{table_name=projects/*/zones/*/clusters/*/tables/*}:bulkDeleteRows" body: "*" };
}
}

View File

@@ -0,0 +1,116 @@
// Copyright 2017 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.bigtable.admin.table.v1;
import "google/bigtable/admin/table/v1/bigtable_table_data.proto";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/table/v1;table";
option java_multiple_files = true;
option java_outer_classname = "BigtableTableServiceMessagesProto";
option java_package = "com.google.bigtable.admin.table.v1";
message CreateTableRequest {
// The unique name of the cluster in which to create the new table.
string name = 1;
// The name by which the new table should be referred to within the cluster,
// e.g. "foobar" rather than "<cluster_name>/tables/foobar".
string table_id = 2;
// The Table to create. The `name` field of the Table and all of its
// ColumnFamilies must be left blank, and will be populated in the response.
Table table = 3;
// The optional list of row keys that will be used to initially split the
// table into several tablets (Tablets are similar to HBase regions).
// Given two split keys, "s1" and "s2", three tablets will be created,
// spanning the key ranges: [, s1), [s1, s2), [s2, ).
//
// Example:
// * Row keys := ["a", "apple", "custom", "customer_1", "customer_2",
// "other", "zz"]
// * initial_split_keys := ["apple", "customer_1", "customer_2", "other"]
// * Key assignment:
// - Tablet 1 [, apple) => {"a"}.
// - Tablet 2 [apple, customer_1) => {"apple", "custom"}.
// - Tablet 3 [customer_1, customer_2) => {"customer_1"}.
// - Tablet 4 [customer_2, other) => {"customer_2"}.
// - Tablet 5 [other, ) => {"other", "zz"}.
repeated string initial_split_keys = 4;
}
message ListTablesRequest {
// The unique name of the cluster for which tables should be listed.
string name = 1;
}
message ListTablesResponse {
// The tables present in the requested cluster.
// At present, only the names of the tables are populated.
repeated Table tables = 1;
}
message GetTableRequest {
// The unique name of the requested table.
string name = 1;
}
message DeleteTableRequest {
// The unique name of the table to be deleted.
string name = 1;
}
message RenameTableRequest {
// The current unique name of the table.
string name = 1;
// The new name by which the table should be referred to within its containing
// cluster, e.g. "foobar" rather than "<cluster_name>/tables/foobar".
string new_id = 2;
}
message CreateColumnFamilyRequest {
// The unique name of the table in which to create the new column family.
string name = 1;
// The name by which the new column family should be referred to within the
// table, e.g. "foobar" rather than "<table_name>/columnFamilies/foobar".
string column_family_id = 2;
// The column family to create. The `name` field must be left blank.
ColumnFamily column_family = 3;
}
message DeleteColumnFamilyRequest {
// The unique name of the column family to be deleted.
string name = 1;
}
message BulkDeleteRowsRequest {
// The unique name of the table on which to perform the bulk delete
string table_name = 1;
oneof target {
// Delete all rows that start with this row key prefix. Prefix cannot be
// zero length.
bytes row_key_prefix = 2;
// Delete all rows in the table. Setting this to false is a no-op.
bool delete_all_data_from_table = 3;
}
}

View File

@@ -0,0 +1,445 @@
// Copyright 2018 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.bigtable.admin.v2;
import "google/api/annotations.proto";
import "google/bigtable/admin/v2/instance.proto";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
option java_multiple_files = true;
option java_outer_classname = "BigtableInstanceAdminProto";
option java_package = "com.google.bigtable.admin.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
// Service for creating, configuring, and deleting Cloud Bigtable Instances and
// Clusters. Provides access to the Instance and Cluster schemas only, not the
// tables' metadata or data stored in those tables.
service BigtableInstanceAdmin {
// Create an instance within a project.
rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/instances"
body: "*"
};
}
// Gets information about an instance.
rpc GetInstance(GetInstanceRequest) returns (Instance) {
option (google.api.http) = {
get: "/v2/{name=projects/*/instances/*}"
};
}
// Lists information about instances in a project.
rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*}/instances"
};
}
// Updates an instance within a project.
rpc UpdateInstance(Instance) returns (Instance) {
option (google.api.http) = {
put: "/v2/{name=projects/*/instances/*}"
body: "*"
};
}
// Partially updates an instance within a project.
rpc PartialUpdateInstance(PartialUpdateInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v2/{instance.name=projects/*/instances/*}"
body: "instance"
};
}
// Delete an instance from a project.
rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/instances/*}"
};
}
// Creates a cluster within an instance.
rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/instances/*}/clusters"
body: "cluster"
};
}
// Gets information about a cluster.
rpc GetCluster(GetClusterRequest) returns (Cluster) {
option (google.api.http) = {
get: "/v2/{name=projects/*/instances/*/clusters/*}"
};
}
// Lists information about clusters in an instance.
rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/instances/*}/clusters"
};
}
// Updates a cluster within an instance.
rpc UpdateCluster(Cluster) returns (google.longrunning.Operation) {
option (google.api.http) = {
put: "/v2/{name=projects/*/instances/*/clusters/*}"
body: "*"
};
}
// Deletes a cluster from an instance.
rpc DeleteCluster(DeleteClusterRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/instances/*/clusters/*}"
};
}
// Creates an app profile within an instance.
rpc CreateAppProfile(CreateAppProfileRequest) returns (AppProfile) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/instances/*}/appProfiles"
body: "app_profile"
};
}
// Gets information about an app profile.
rpc GetAppProfile(GetAppProfileRequest) returns (AppProfile) {
option (google.api.http) = {
get: "/v2/{name=projects/*/instances/*/appProfiles/*}"
};
}
// Lists information about app profiles in an instance.
rpc ListAppProfiles(ListAppProfilesRequest) returns (ListAppProfilesResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/instances/*}/appProfiles"
};
}
// Updates an app profile within an instance.
rpc UpdateAppProfile(UpdateAppProfileRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}"
body: "app_profile"
};
}
// Deletes an app profile from an instance.
rpc DeleteAppProfile(DeleteAppProfileRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/instances/*/appProfiles/*}"
};
}
// Gets the access control policy for an instance resource. Returns an empty
// policy if an instance exists but does not have a policy set.
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = {
post: "/v2/{resource=projects/*/instances/*}:getIamPolicy"
body: "*"
};
}
// Sets the access control policy on an instance resource. Replaces any
// existing policy.
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = {
post: "/v2/{resource=projects/*/instances/*}:setIamPolicy"
body: "*"
};
}
// Returns permissions that the caller has on the specified instance resource.
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
option (google.api.http) = {
post: "/v2/{resource=projects/*/instances/*}:testIamPermissions"
body: "*"
};
}
}
// Request message for BigtableInstanceAdmin.CreateInstance.
message CreateInstanceRequest {
// The unique name of the project in which to create the new instance.
// Values are of the form `projects/<project>`.
string parent = 1;
// The ID to be used when referring to the new instance within its project,
// e.g., just `myinstance` rather than
// `projects/myproject/instances/myinstance`.
string instance_id = 2;
// The instance to create.
// Fields marked `OutputOnly` must be left blank.
Instance instance = 3;
// The clusters to be created within the instance, mapped by desired
// cluster ID, e.g., just `mycluster` rather than
// `projects/myproject/instances/myinstance/clusters/mycluster`.
// Fields marked `OutputOnly` must be left blank.
// Currently exactly one cluster must be specified.
map<string, Cluster> clusters = 4;
}
// Request message for BigtableInstanceAdmin.GetInstance.
message GetInstanceRequest {
// The unique name of the requested instance. Values are of the form
// `projects/<project>/instances/<instance>`.
string name = 1;
}
// Request message for BigtableInstanceAdmin.ListInstances.
message ListInstancesRequest {
// The unique name of the project for which a list of instances is requested.
// Values are of the form `projects/<project>`.
string parent = 1;
// The value of `next_page_token` returned by a previous call.
string page_token = 2;
}
// Response message for BigtableInstanceAdmin.ListInstances.
message ListInstancesResponse {
// The list of requested instances.
repeated Instance instances = 1;
// Locations from which Instance information could not be retrieved,
// due to an outage or some other transient condition.
// Instances whose Clusters are all in one of the failed locations
// may be missing from `instances`, and Instances with at least one
// Cluster in a failed location may only have partial information returned.
repeated string failed_locations = 2;
// Set if not all instances could be returned in a single response.
// Pass this value to `page_token` in another request to get the next
// page of results.
string next_page_token = 3;
}
// Request message for BigtableInstanceAdmin.PartialUpdateInstance.
message PartialUpdateInstanceRequest {
// The Instance which will (partially) replace the current value.
Instance instance = 1;
// The subset of Instance fields which should be replaced.
// Must be explicitly set.
google.protobuf.FieldMask update_mask = 2;
}
// Request message for BigtableInstanceAdmin.DeleteInstance.
message DeleteInstanceRequest {
// The unique name of the instance to be deleted.
// Values are of the form `projects/<project>/instances/<instance>`.
string name = 1;
}
// Request message for BigtableInstanceAdmin.CreateCluster.
message CreateClusterRequest {
// The unique name of the instance in which to create the new cluster.
// Values are of the form
// `projects/<project>/instances/<instance>`.
string parent = 1;
// The ID to be used when referring to the new cluster within its instance,
// e.g., just `mycluster` rather than
// `projects/myproject/instances/myinstance/clusters/mycluster`.
string cluster_id = 2;
// The cluster to be created.
// Fields marked `OutputOnly` must be left blank.
Cluster cluster = 3;
}
// Request message for BigtableInstanceAdmin.GetCluster.
message GetClusterRequest {
// The unique name of the requested cluster. Values are of the form
// `projects/<project>/instances/<instance>/clusters/<cluster>`.
string name = 1;
}
// Request message for BigtableInstanceAdmin.ListClusters.
message ListClustersRequest {
// The unique name of the instance for which a list of clusters is requested.
// Values are of the form `projects/<project>/instances/<instance>`.
// Use `<instance> = '-'` to list Clusters for all Instances in a project,
// e.g., `projects/myproject/instances/-`.
string parent = 1;
// The value of `next_page_token` returned by a previous call.
string page_token = 2;
}
// Response message for BigtableInstanceAdmin.ListClusters.
message ListClustersResponse {
// The list of requested clusters.
repeated Cluster clusters = 1;
// Locations from which Cluster information could not be retrieved,
// due to an outage or some other transient condition.
// Clusters from these locations may be missing from `clusters`,
// or may only have partial information returned.
repeated string failed_locations = 2;
// Set if not all clusters could be returned in a single response.
// Pass this value to `page_token` in another request to get the next
// page of results.
string next_page_token = 3;
}
// Request message for BigtableInstanceAdmin.DeleteCluster.
message DeleteClusterRequest {
// The unique name of the cluster to be deleted. Values are of the form
// `projects/<project>/instances/<instance>/clusters/<cluster>`.
string name = 1;
}
// The metadata for the Operation returned by CreateInstance.
message CreateInstanceMetadata {
// The request that prompted the initiation of this CreateInstance operation.
CreateInstanceRequest original_request = 1;
// The time at which the original request was received.
google.protobuf.Timestamp request_time = 2;
// The time at which the operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 3;
}
// The metadata for the Operation returned by UpdateInstance.
message UpdateInstanceMetadata {
// The request that prompted the initiation of this UpdateInstance operation.
PartialUpdateInstanceRequest original_request = 1;
// The time at which the original request was received.
google.protobuf.Timestamp request_time = 2;
// The time at which the operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 3;
}
// The metadata for the Operation returned by CreateCluster.
message CreateClusterMetadata {
// The request that prompted the initiation of this CreateCluster operation.
CreateClusterRequest original_request = 1;
// The time at which the original request was received.
google.protobuf.Timestamp request_time = 2;
// The time at which the operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 3;
}
// The metadata for the Operation returned by UpdateCluster.
message UpdateClusterMetadata {
// The request that prompted the initiation of this UpdateCluster operation.
Cluster original_request = 1;
// The time at which the original request was received.
google.protobuf.Timestamp request_time = 2;
// The time at which the operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 3;
}
// Request message for BigtableInstanceAdmin.CreateAppProfile.
message CreateAppProfileRequest {
// The unique name of the instance in which to create the new app profile.
// Values are of the form
// `projects/<project>/instances/<instance>`.
string parent = 1;
// The ID to be used when referring to the new app profile within its
// instance, e.g., just `myprofile` rather than
// `projects/myproject/instances/myinstance/appProfiles/myprofile`.
string app_profile_id = 2;
// The app profile to be created.
// Fields marked `OutputOnly` will be ignored.
AppProfile app_profile = 3;
// If true, ignore safety checks when creating the app profile.
bool ignore_warnings = 4;
}
// Request message for BigtableInstanceAdmin.GetAppProfile.
message GetAppProfileRequest {
// The unique name of the requested app profile. Values are of the form
// `projects/<project>/instances/<instance>/appProfiles/<app_profile>`.
string name = 1;
}
// Request message for BigtableInstanceAdmin.ListAppProfiles.
message ListAppProfilesRequest {
// The unique name of the instance for which a list of app profiles is
// requested. Values are of the form
// `projects/<project>/instances/<instance>`.
string parent = 1;
// The value of `next_page_token` returned by a previous call.
string page_token = 2;
}
// Response message for BigtableInstanceAdmin.ListAppProfiles.
message ListAppProfilesResponse {
// The list of requested app profiles.
repeated AppProfile app_profiles = 1;
// Set if not all app profiles could be returned in a single response.
// Pass this value to `page_token` in another request to get the next
// page of results.
string next_page_token = 2;
}
// Request message for BigtableInstanceAdmin.UpdateAppProfile.
message UpdateAppProfileRequest {
// The app profile which will (partially) replace the current value.
AppProfile app_profile = 1;
// The subset of app profile fields which should be replaced.
// If unset, all fields will be replaced.
google.protobuf.FieldMask update_mask = 2;
// If true, ignore safety checks when updating the app profile.
bool ignore_warnings = 3;
}
// Request message for BigtableInstanceAdmin.DeleteAppProfile.
message DeleteAppProfileRequest {
// The unique name of the app profile to be deleted. Values are of the form
// `projects/<project>/instances/<instance>/appProfiles/<app_profile>`.
string name = 1;
// If true, ignore safety checks when deleting the app profile.
bool ignore_warnings = 2;
}
// The metadata for the Operation returned by UpdateAppProfile.
message UpdateAppProfileMetadata {
}

View File

@@ -0,0 +1,519 @@
// Copyright 2018 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.bigtable.admin.v2;
import "google/api/annotations.proto";
import "google/bigtable/admin/v2/table.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
option java_multiple_files = true;
option java_outer_classname = "BigtableTableAdminProto";
option java_package = "com.google.bigtable.admin.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
// Service for creating, configuring, and deleting Cloud Bigtable tables.
//
//
// Provides access to the table schemas only, not the data stored within
// the tables.
service BigtableTableAdmin {
// Creates a new table in the specified instance.
// The table can be created with a full set of initial column families,
// specified in the request.
rpc CreateTable(CreateTableRequest) returns (Table) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/instances/*}/tables"
body: "*"
};
}
// Creates a new table from the specified snapshot. The target table must
// not exist. The snapshot and the table must be in the same instance.
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not
// recommended for production use. It is not subject to any SLA or deprecation
// policy.
rpc CreateTableFromSnapshot(CreateTableFromSnapshotRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot"
body: "*"
};
}
// Lists all tables served from a specified instance.
rpc ListTables(ListTablesRequest) returns (ListTablesResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/instances/*}/tables"
};
}
// Gets metadata information about the specified table.
rpc GetTable(GetTableRequest) returns (Table) {
option (google.api.http) = {
get: "/v2/{name=projects/*/instances/*/tables/*}"
};
}
// Permanently deletes a specified table and all of its data.
rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/instances/*/tables/*}"
};
}
// Performs a series of column family modifications on the specified table.
// Either all or none of the modifications will occur before this method
// returns, but data requests received prior to that point may see a table
// where only some modifications have taken effect.
rpc ModifyColumnFamilies(ModifyColumnFamiliesRequest) returns (Table) {
option (google.api.http) = {
post: "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies"
body: "*"
};
}
// Permanently drop/delete a row range from a specified table. The request can
// specify whether to delete all rows in a table, or only those that match a
// particular prefix.
rpc DropRowRange(DropRowRangeRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange"
body: "*"
};
}
// Generates a consistency token for a Table, which can be used in
// CheckConsistency to check whether mutations to the table that finished
// before this call started have been replicated. The tokens will be available
// for 90 days.
rpc GenerateConsistencyToken(GenerateConsistencyTokenRequest) returns (GenerateConsistencyTokenResponse) {
option (google.api.http) = {
post: "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken"
body: "*"
};
}
// Checks replication consistency based on a consistency token, that is, if
// replication has caught up based on the conditions specified in the token
// and the check request.
rpc CheckConsistency(CheckConsistencyRequest) returns (CheckConsistencyResponse) {
option (google.api.http) = {
post: "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency"
body: "*"
};
}
// Creates a new snapshot in the specified cluster from the specified
// source table. The cluster and the table must be in the same instance.
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not
// recommended for production use. It is not subject to any SLA or deprecation
// policy.
rpc SnapshotTable(SnapshotTableRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{name=projects/*/instances/*/tables/*}:snapshot"
body: "*"
};
}
// Gets metadata information about the specified snapshot.
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not
// recommended for production use. It is not subject to any SLA or deprecation
// policy.
rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) {
option (google.api.http) = {
get: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}"
};
}
// Lists all snapshots associated with the specified cluster.
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not
// recommended for production use. It is not subject to any SLA or deprecation
// policy.
rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots"
};
}
// Permanently deletes the specified snapshot.
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not
// recommended for production use. It is not subject to any SLA or deprecation
// policy.
rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}"
};
}
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]
message CreateTableRequest {
// An initial split point for a newly created table.
message Split {
// Row key to use as an initial tablet boundary.
bytes key = 1;
}
// The unique name of the instance in which to create the table.
// Values are of the form `projects/<project>/instances/<instance>`.
string parent = 1;
// The name by which the new table should be referred to within the parent
// instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
string table_id = 2;
// The Table to create.
Table table = 3;
// The optional list of row keys that will be used to initially split the
// table into several tablets (tablets are similar to HBase regions).
// Given two split keys, `s1` and `s2`, three tablets will be created,
// spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
//
// Example:
//
// * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
// `"other", "zz"]`
// * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
// * Key assignment:
// - Tablet 1 `[, apple) => {"a"}.`
// - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.`
// - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
// - Tablet 4 `[customer_2, other) => {"customer_2"}.`
// - Tablet 5 `[other, ) => {"other", "zz"}.`
repeated Split initial_splits = 4;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message CreateTableFromSnapshotRequest {
// The unique name of the instance in which to create the table.
// Values are of the form `projects/<project>/instances/<instance>`.
string parent = 1;
// The name by which the new table should be referred to within the parent
// instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
string table_id = 2;
// The unique name of the snapshot from which to restore the table. The
// snapshot and the table must be in the same instance.
// Values are of the form
// `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
string source_snapshot = 3;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]
message DropRowRangeRequest {
// The unique name of the table on which to drop a range of rows.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string name = 1;
// Delete all rows or by prefix.
oneof target {
// Delete all rows that start with this row key prefix. Prefix cannot be
// zero length.
bytes row_key_prefix = 2;
// Delete all rows in the table. Setting this to false is a no-op.
bool delete_all_data_from_table = 3;
}
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
message ListTablesRequest {
// The unique name of the instance for which tables should be listed.
// Values are of the form `projects/<project>/instances/<instance>`.
string parent = 1;
// The view to be applied to the returned tables' fields.
// Defaults to `NAME_ONLY` if unspecified; no others are currently supported.
Table.View view = 2;
// The value of `next_page_token` returned by a previous call.
string page_token = 3;
}
// Response message for
// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
message ListTablesResponse {
// The tables present in the requested instance.
repeated Table tables = 1;
// Set if not all tables could be returned in a single response.
// Pass this value to `page_token` in another request to get the next
// page of results.
string next_page_token = 2;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable]
message GetTableRequest {
// The unique name of the requested table.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string name = 1;
// The view to be applied to the returned table's fields.
// Defaults to `SCHEMA_VIEW` if unspecified.
Table.View view = 2;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]
message DeleteTableRequest {
// The unique name of the table to be deleted.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string name = 1;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]
message ModifyColumnFamiliesRequest {
// A create, update, or delete of a particular column family.
message Modification {
// The ID of the column family to be modified.
string id = 1;
// Column familiy modifications.
oneof mod {
// Create a new column family with the specified schema, or fail if
// one already exists with the given ID.
ColumnFamily create = 2;
// Update an existing column family to the specified schema, or fail
// if no column family exists with the given ID.
ColumnFamily update = 3;
// Drop (delete) the column family with the given ID, or fail if no such
// family exists.
bool drop = 4;
}
}
// The unique name of the table whose families should be modified.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string name = 1;
// Modifications to be atomically applied to the specified table's families.
// Entries are applied in order, meaning that earlier modifications can be
// masked by later ones (in the case of repeated updates to the same family,
// for example).
repeated Modification modifications = 2;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
message GenerateConsistencyTokenRequest {
// The unique name of the Table for which to create a consistency token.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string name = 1;
}
// Response message for
// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
message GenerateConsistencyTokenResponse {
// The generated consistency token.
string consistency_token = 1;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
message CheckConsistencyRequest {
// The unique name of the Table for which to check replication consistency.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string name = 1;
// The token created using GenerateConsistencyToken for the Table.
string consistency_token = 2;
}
// Response message for
// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
message CheckConsistencyResponse {
// True only if the token is consistent. A token is consistent if replication
// has caught up with the restrictions specified in the request.
bool consistent = 1;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message SnapshotTableRequest {
// The unique name of the table to have the snapshot taken.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string name = 1;
// The name of the cluster where the snapshot will be created in.
// Values are of the form
// `projects/<project>/instances/<instance>/clusters/<cluster>`.
string cluster = 2;
// The ID by which the new snapshot should be referred to within the parent
// cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
// rather than
// `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/mysnapshot`.
string snapshot_id = 3;
// The amount of time that the new snapshot can stay active after it is
// created. Once 'ttl' expires, the snapshot will get deleted. The maximum
// amount of time a snapshot can stay active is 7 days. If 'ttl' is not
// specified, the default value of 24 hours will be used.
google.protobuf.Duration ttl = 4;
// Description of the snapshot.
string description = 5;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message GetSnapshotRequest {
// The unique name of the requested snapshot.
// Values are of the form
// `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
string name = 1;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message ListSnapshotsRequest {
// The unique name of the cluster for which snapshots should be listed.
// Values are of the form
// `projects/<project>/instances/<instance>/clusters/<cluster>`.
// Use `<cluster> = '-'` to list snapshots for all clusters in an instance,
// e.g., `projects/<project>/instances/<instance>/clusters/-`.
string parent = 1;
// The maximum number of snapshots to return.
int32 page_size = 2;
// The value of `next_page_token` returned by a previous call.
string page_token = 3;
}
// Response message for
// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message ListSnapshotsResponse {
// The snapshots present in the requested cluster.
repeated Snapshot snapshots = 1;
// Set if not all snapshots could be returned in a single response.
// Pass this value to `page_token` in another request to get the next
// page of results.
string next_page_token = 2;
}
// Request message for
// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message DeleteSnapshotRequest {
// The unique name of the snapshot to be deleted.
// Values are of the form
// `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
string name = 1;
}
// The metadata for the Operation returned by SnapshotTable.
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message SnapshotTableMetadata {
// The request that prompted the initiation of this SnapshotTable operation.
SnapshotTableRequest original_request = 1;
// The time at which the original request was received.
google.protobuf.Timestamp request_time = 2;
// The time at which the operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 3;
}
// The metadata for the Operation returned by CreateTableFromSnapshot.
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message CreateTableFromSnapshotMetadata {
// The request that prompted the initiation of this CreateTableFromSnapshot
// operation.
CreateTableFromSnapshotRequest original_request = 1;
// The time at which the original request was received.
google.protobuf.Timestamp request_time = 2;
// The time at which the operation failed or was completed successfully.
google.protobuf.Timestamp finish_time = 3;
}

View File

@@ -0,0 +1,40 @@
// Copyright 2018 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.bigtable.admin.v2;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
option java_multiple_files = true;
option java_outer_classname = "CommonProto";
option java_package = "com.google.bigtable.admin.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
// Storage media types for persisting Bigtable data.
enum StorageType {
// The user did not specify a storage type.
STORAGE_TYPE_UNSPECIFIED = 0;
// Flash (SSD) storage should be used.
SSD = 1;
// Magnetic drive (HDD) storage should be used.
HDD = 2;
}

View File

@@ -0,0 +1,207 @@
// Copyright 2018 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.bigtable.admin.v2;
import "google/api/annotations.proto";
import "google/bigtable/admin/v2/common.proto";
option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
option java_multiple_files = true;
option java_outer_classname = "InstanceProto";
option java_package = "com.google.bigtable.admin.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
// A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
// the resources that serve them.
// All tables in an instance are served from a single
// [Cluster][google.bigtable.admin.v2.Cluster].
message Instance {
// Possible states of an instance.
enum State {
// The state of the instance could not be determined.
STATE_NOT_KNOWN = 0;
// The instance has been successfully created and can serve requests
// to its tables.
READY = 1;
// The instance is currently being created, and may be destroyed
// if the creation process encounters an error.
CREATING = 2;
}
// The type of the instance.
enum Type {
// The type of the instance is unspecified. If set when creating an
// instance, a `PRODUCTION` instance will be created. If set when updating
// an instance, the type will be left unchanged.
TYPE_UNSPECIFIED = 0;
// An instance meant for production use. `serve_nodes` must be set
// on the cluster.
PRODUCTION = 1;
// The instance is meant for development and testing purposes only; it has
// no performance or uptime guarantees and is not covered by SLA.
// After a development instance is created, it can be upgraded by
// updating the instance to type `PRODUCTION`. An instance created
// as a production instance cannot be changed to a development instance.
// When creating a development instance, `serve_nodes` on the cluster must
// not be set.
DEVELOPMENT = 2;
}
// (`OutputOnly`)
// The unique name of the instance. Values are of the form
// `projects/<project>/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
string name = 1;
// The descriptive name for this instance as it appears in UIs.
// Can be changed at any time, but should be kept globally unique
// to avoid confusion.
string display_name = 2;
// (`OutputOnly`)
// The current state of the instance.
State state = 3;
// The type of the instance. Defaults to `PRODUCTION`.
Type type = 4;
// Labels are a flexible and lightweight mechanism for organizing cloud
// resources into groups that reflect a customer's organizational needs and
// deployment strategies. They can be used to filter resources and aggregate
// metrics.
//
// * Label keys must be between 1 and 63 characters long and must conform to
// the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
// * Label values must be between 0 and 63 characters long and must conform to
// the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
// * No more than 64 labels can be associated with a given resource.
// * Keys and values must both be under 128 bytes.
map<string, string> labels = 5;
}
// A resizable group of nodes in a particular cloud location, capable
// of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
// [Instance][google.bigtable.admin.v2.Instance].
message Cluster {
// Possible states of a cluster.
enum State {
// The state of the cluster could not be determined.
STATE_NOT_KNOWN = 0;
// The cluster has been successfully created and is ready to serve requests.
READY = 1;
// The cluster is currently being created, and may be destroyed
// if the creation process encounters an error.
// A cluster may not be able to serve requests while being created.
CREATING = 2;
// The cluster is currently being resized, and may revert to its previous
// node count if the process encounters an error.
// A cluster is still capable of serving requests while being resized,
// but may exhibit performance as if its number of allocated nodes is
// between the starting and requested states.
RESIZING = 3;
// The cluster has no backing nodes. The data (tables) still
// exist, but no operations can be performed on the cluster.
DISABLED = 4;
}
// (`OutputOnly`)
// The unique name of the cluster. Values are of the form
// `projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*`.
string name = 1;
// (`CreationOnly`)
// The location where this cluster's nodes and storage reside. For best
// performance, clients should be located as close as possible to this
// cluster. Currently only zones are supported, so values should be of the
// form `projects/<project>/locations/<zone>`.
string location = 2;
// (`OutputOnly`)
// The current state of the cluster.
State state = 3;
// The number of nodes allocated to this cluster. More nodes enable higher
// throughput and more consistent performance.
int32 serve_nodes = 4;
// (`CreationOnly`)
// The type of storage used by this cluster to serve its
// parent instance's tables, unless explicitly overridden.
StorageType default_storage_type = 5;
}
// A configuration object describing how Cloud Bigtable should treat traffic
// from a particular end user application.
message AppProfile {
// Read/write requests may be routed to any cluster in the instance, and will
// fail over to another cluster in the event of transient errors or delays.
// Choosing this option sacrifices read-your-writes consistency to improve
// availability.
message MultiClusterRoutingUseAny {
}
// Unconditionally routes all read/write requests to a specific cluster.
// This option preserves read-your-writes consistency, but does not improve
// availability.
message SingleClusterRouting {
// The cluster to which read/write requests should be routed.
string cluster_id = 1;
// Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
// allowed by this app profile. It is unsafe to send these requests to
// the same table/row/column in multiple clusters.
bool allow_transactional_writes = 2;
}
// (`OutputOnly`)
// The unique name of the app profile. Values are of the form
// `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
string name = 1;
// Strongly validated etag for optimistic concurrency control. Preserve the
// value returned from `GetAppProfile` when calling `UpdateAppProfile` to
// fail the request if there has been a modification in the mean time. The
// `update_mask` of the request need not include `etag` for this protection
// to apply.
// See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
// [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
// details.
string etag = 2;
// Optional long form description of the use case for this AppProfile.
string description = 3;
// The routing policy for all read/write requests which use this app profile.
// A value must be explicitly set.
oneof routing_policy {
// Use a multi-cluster routing policy that may pick any cluster.
MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5;
// Use a single-cluster routing policy.
SingleClusterRouting single_cluster_routing = 6;
}
}

View File

@@ -0,0 +1,220 @@
// Copyright 2018 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.bigtable.admin.v2;
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
option java_multiple_files = true;
option java_outer_classname = "TableProto";
option java_package = "com.google.bigtable.admin.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
// A collection of user data indexed by row, column, and timestamp.
// Each table is served using the resources of its parent cluster.
message Table {
// The state of a table's data in a particular cluster.
message ClusterState {
// Table replication states.
enum ReplicationState {
// The replication state of the table is unknown in this cluster.
STATE_NOT_KNOWN = 0;
// The cluster was recently created, and the table must finish copying
// over pre-existing data from other clusters before it can begin
// receiving live replication updates and serving Data API requests.
INITIALIZING = 1;
// The table is temporarily unable to serve Data API requests from this
// cluster due to planned internal maintenance.
PLANNED_MAINTENANCE = 2;
// The table is temporarily unable to serve Data API requests from this
// cluster due to unplanned or emergency maintenance.
UNPLANNED_MAINTENANCE = 3;
// The table can serve Data API requests from this cluster. Depending on
// replication delay, reads may not immediately reflect the state of the
// table in other clusters.
READY = 4;
}
// (`OutputOnly`)
// The state of replication for the table in this cluster.
ReplicationState replication_state = 1;
}
// Possible timestamp granularities to use when keeping multiple versions
// of data in a table.
enum TimestampGranularity {
// The user did not specify a granularity. Should not be returned.
// When specified during table creation, MILLIS will be used.
TIMESTAMP_GRANULARITY_UNSPECIFIED = 0;
// The table keeps data versioned at a granularity of 1ms.
MILLIS = 1;
}
// Defines a view over a table's fields.
enum View {
// Uses the default view for each method as documented in its request.
VIEW_UNSPECIFIED = 0;
// Only populates `name`.
NAME_ONLY = 1;
// Only populates `name` and fields related to the table's schema.
SCHEMA_VIEW = 2;
// Only populates `name` and fields related to the table's
// replication state.
REPLICATION_VIEW = 3;
// Populates all fields.
FULL = 4;
}
// (`OutputOnly`)
// The unique name of the table. Values are of the form
// `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
// Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
string name = 1;
// (`OutputOnly`)
// Map from cluster ID to per-cluster table state.
// If it could not be determined whether or not the table has data in a
// particular cluster (for example, if its zone is unavailable), then
// there will be an entry for the cluster with UNKNOWN `replication_status`.
// Views: `REPLICATION_VIEW`, `FULL`
map<string, ClusterState> cluster_states = 2;
// (`CreationOnly`)
// The column families configured for this table, mapped by column family ID.
// Views: `SCHEMA_VIEW`, `FULL`
map<string, ColumnFamily> column_families = 3;
// (`CreationOnly`)
// The granularity (i.e. `MILLIS`) at which timestamps are stored in
// this table. Timestamps not matching the granularity will be rejected.
// If unspecified at creation time, the value will be set to `MILLIS`.
// Views: `SCHEMA_VIEW`, `FULL`
TimestampGranularity granularity = 4;
}
// A set of columns within a table which share a common configuration.
message ColumnFamily {
// Garbage collection rule specified as a protobuf.
// Must serialize to at most 500 bytes.
//
// NOTE: Garbage collection executes opportunistically in the background, and
// so it's possible for reads to return a cell even if it matches the active
// GC expression for its family.
GcRule gc_rule = 1;
}
// Rule for determining which cells to delete during garbage collection.
message GcRule {
// A GcRule which deletes cells matching all of the given rules.
message Intersection {
// Only delete cells which would be deleted by every element of `rules`.
repeated GcRule rules = 1;
}
// A GcRule which deletes cells matching any of the given rules.
message Union {
// Delete cells which would be deleted by any element of `rules`.
repeated GcRule rules = 1;
}
// Garbage collection rules.
oneof rule {
// Delete all cells in a column except the most recent N.
int32 max_num_versions = 1;
// Delete cells in a column older than the given age.
// Values must be at least one millisecond, and will be truncated to
// microsecond granularity.
google.protobuf.Duration max_age = 2;
// Delete cells that would be deleted by every nested rule.
Intersection intersection = 3;
// Delete cells that would be deleted by any nested rule.
Union union = 4;
}
}
// A snapshot of a table at a particular time. A snapshot can be used as a
// checkpoint for data restoration or a data source for a new table.
//
// Note: This is a private alpha release of Cloud Bigtable snapshots. This
// feature is not currently available to most Cloud Bigtable customers. This
// feature might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
message Snapshot {
// Possible states of a snapshot.
enum State {
// The state of the snapshot could not be determined.
STATE_NOT_KNOWN = 0;
// The snapshot has been successfully created and can serve all requests.
READY = 1;
// The snapshot is currently being created, and may be destroyed if the
// creation process encounters an error. A snapshot may not be restored to a
// table while it is being created.
CREATING = 2;
}
// (`OutputOnly`)
// The unique name of the snapshot.
// Values are of the form
// `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
string name = 1;
// (`OutputOnly`)
// The source table at the time the snapshot was taken.
Table source_table = 2;
// (`OutputOnly`)
// The size of the data in the source table at the time the snapshot was
// taken. In some cases, this value may be computed asynchronously via a
// background process and a placeholder of 0 will be used in the meantime.
int64 data_size_bytes = 3;
// (`OutputOnly`)
// The time when the snapshot is created.
google.protobuf.Timestamp create_time = 4;
// (`OutputOnly`)
// The time when the snapshot will be deleted. The maximum amount of time a
// snapshot can stay active is 365 days. If 'ttl' is not specified,
// the default maximum of 365 days will be used.
google.protobuf.Timestamp delete_time = 5;
// (`OutputOnly`)
// The current state of the snapshot.
State state = 6;
// (`OutputOnly`)
// Description of the snapshot.
string description = 7;
}

View File

@@ -0,0 +1,516 @@
// Copyright 2018 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.bigtable.v1;
option go_package = "google.golang.org/genproto/googleapis/bigtable/v1;bigtable";
option java_multiple_files = true;
option java_outer_classname = "BigtableDataProto";
option java_package = "com.google.bigtable.v1";
// Specifies the complete (requested) contents of a single row of a table.
// Rows which exceed 256MiB in size cannot be read in full.
message Row {
// The unique key which identifies this row within its table. This is the same
// key that's used to identify the row in, for example, a MutateRowRequest.
// May contain any non-empty byte string up to 4KiB in length.
bytes key = 1;
// May be empty, but only if the entire row is empty.
// The mutual ordering of column families is not specified.
repeated Family families = 2;
}
// Specifies (some of) the contents of a single row/column family of a table.
message Family {
// The unique key which identifies this family within its row. This is the
// same key that's used to identify the family in, for example, a RowFilter
// which sets its "family_name_regex_filter" field.
// Must match [-_.a-zA-Z0-9]+, except that AggregatingRowProcessors may
// produce cells in a sentinel family with an empty name.
// Must be no greater than 64 characters in length.
string name = 1;
// Must not be empty. Sorted in order of increasing "qualifier".
repeated Column columns = 2;
}
// Specifies (some of) the contents of a single row/column of a table.
message Column {
// The unique key which identifies this column within its family. This is the
// same key that's used to identify the column in, for example, a RowFilter
// which sets its "column_qualifier_regex_filter" field.
// May contain any byte string, including the empty string, up to 16kiB in
// length.
bytes qualifier = 1;
// Must not be empty. Sorted in order of decreasing "timestamp_micros".
repeated Cell cells = 2;
}
// Specifies (some of) the contents of a single row/column/timestamp of a table.
message Cell {
// The cell's stored timestamp, which also uniquely identifies it within
// its column.
// Values are always expressed in microseconds, but individual tables may set
// a coarser "granularity" to further restrict the allowed values. For
// example, a table which specifies millisecond granularity will only allow
// values of "timestamp_micros" which are multiples of 1000.
int64 timestamp_micros = 1;
// The value stored in the cell.
// May contain any byte string, including the empty string, up to 100MiB in
// length.
bytes value = 2;
// Labels applied to the cell by a [RowFilter][google.bigtable.v1.RowFilter].
repeated string labels = 3;
}
// Specifies a contiguous range of rows.
message RowRange {
// Inclusive lower bound. If left empty, interpreted as the empty string.
bytes start_key = 2;
// Exclusive upper bound. If left empty, interpreted as infinity.
bytes end_key = 3;
}
// Specifies a non-contiguous set of rows.
message RowSet {
// Single rows included in the set.
repeated bytes row_keys = 1;
// Contiguous row ranges included in the set.
repeated RowRange row_ranges = 2;
}
// Specifies a contiguous range of columns within a single column family.
// The range spans from <column_family>:<start_qualifier> to
// <column_family>:<end_qualifier>, where both bounds can be either inclusive or
// exclusive.
message ColumnRange {
// The name of the column family within which this range falls.
string family_name = 1;
// The column qualifier at which to start the range (within 'column_family').
// If neither field is set, interpreted as the empty string, inclusive.
oneof start_qualifier {
// Used when giving an inclusive lower bound for the range.
bytes start_qualifier_inclusive = 2;
// Used when giving an exclusive lower bound for the range.
bytes start_qualifier_exclusive = 3;
}
// The column qualifier at which to end the range (within 'column_family').
// If neither field is set, interpreted as the infinite string, exclusive.
oneof end_qualifier {
// Used when giving an inclusive upper bound for the range.
bytes end_qualifier_inclusive = 4;
// Used when giving an exclusive upper bound for the range.
bytes end_qualifier_exclusive = 5;
}
}
// Specified a contiguous range of microsecond timestamps.
message TimestampRange {
// Inclusive lower bound. If left empty, interpreted as 0.
int64 start_timestamp_micros = 1;
// Exclusive upper bound. If left empty, interpreted as infinity.
int64 end_timestamp_micros = 2;
}
// Specifies a contiguous range of raw byte values.
message ValueRange {
// The value at which to start the range.
// If neither field is set, interpreted as the empty string, inclusive.
oneof start_value {
// Used when giving an inclusive lower bound for the range.
bytes start_value_inclusive = 1;
// Used when giving an exclusive lower bound for the range.
bytes start_value_exclusive = 2;
}
// The value at which to end the range.
// If neither field is set, interpreted as the infinite string, exclusive.
oneof end_value {
// Used when giving an inclusive upper bound for the range.
bytes end_value_inclusive = 3;
// Used when giving an exclusive upper bound for the range.
bytes end_value_exclusive = 4;
}
}
// Takes a row as input and produces an alternate view of the row based on
// specified rules. For example, a RowFilter might trim down a row to include
// just the cells from columns matching a given regular expression, or might
// return all the cells of a row but not their values. More complicated filters
// can be composed out of these components to express requests such as, "within
// every column of a particular family, give just the two most recent cells
// which are older than timestamp X."
//
// There are two broad categories of RowFilters (true filters and transformers),
// as well as two ways to compose simple filters into more complex ones
// (chains and interleaves). They work as follows:
//
// * True filters alter the input row by excluding some of its cells wholesale
// from the output row. An example of a true filter is the "value_regex_filter",
// which excludes cells whose values don't match the specified pattern. All
// regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax)
// in raw byte mode (RE2::Latin1), and are evaluated as full matches. An
// important point to keep in mind is that RE2(.) is equivalent by default to
// RE2([^\n]), meaning that it does not match newlines. When attempting to match
// an arbitrary byte, you should therefore use the escape sequence '\C', which
// may need to be further escaped as '\\C' in your client language.
//
// * Transformers alter the input row by changing the values of some of its
// cells in the output, without excluding them completely. Currently, the only
// supported transformer is the "strip_value_transformer", which replaces every
// cell's value with the empty string.
//
// * Chains and interleaves are described in more detail in the
// RowFilter.Chain and RowFilter.Interleave documentation.
//
// The total serialized size of a RowFilter message must not
// exceed 4096 bytes, and RowFilters may not be nested within each other
// (in Chains or Interleaves) to a depth of more than 20.
message RowFilter {
// A RowFilter which sends rows through several RowFilters in sequence.
message Chain {
// The elements of "filters" are chained together to process the input row:
// in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
// The full chain is executed atomically.
repeated RowFilter filters = 1;
}
// A RowFilter which sends each row to each of several component
// RowFilters and interleaves the results.
message Interleave {
// The elements of "filters" all process a copy of the input row, and the
// results are pooled, sorted, and combined into a single output row.
// If multiple cells are produced with the same column and timestamp,
// they will all appear in the output row in an unspecified mutual order.
// Consider the following example, with three filters:
//
// input row
// |
// -----------------------------------------------------
// | | |
// f(0) f(1) f(2)
// | | |
// 1: foo,bar,10,x foo,bar,10,z far,bar,7,a
// 2: foo,blah,11,z far,blah,5,x far,blah,5,x
// | | |
// -----------------------------------------------------
// |
// 1: foo,bar,10,z // could have switched with #2
// 2: foo,bar,10,x // could have switched with #1
// 3: foo,blah,11,z
// 4: far,bar,7,a
// 5: far,blah,5,x // identical to #6
// 6: far,blah,5,x // identical to #5
// All interleaved filters are executed atomically.
repeated RowFilter filters = 1;
}
// A RowFilter which evaluates one of two possible RowFilters, depending on
// whether or not a predicate RowFilter outputs any cells from the input row.
//
// IMPORTANT NOTE: The predicate filter does not execute atomically with the
// true and false filters, which may lead to inconsistent or unexpected
// results. Additionally, Condition filters have poor performance, especially
// when filters are set for the false condition.
message Condition {
// If "predicate_filter" outputs any cells, then "true_filter" will be
// evaluated on the input row. Otherwise, "false_filter" will be evaluated.
RowFilter predicate_filter = 1;
// The filter to apply to the input row if "predicate_filter" returns any
// results. If not provided, no results will be returned in the true case.
RowFilter true_filter = 2;
// The filter to apply to the input row if "predicate_filter" does not
// return any results. If not provided, no results will be returned in the
// false case.
RowFilter false_filter = 3;
}
// Which of the possible RowFilter types to apply. If none are set, this
// RowFilter returns all cells in the input row.
oneof filter {
// Applies several RowFilters to the data in sequence, progressively
// narrowing the results.
Chain chain = 1;
// Applies several RowFilters to the data in parallel and combines the
// results.
Interleave interleave = 2;
// Applies one of two possible RowFilters to the data based on the output of
// a predicate RowFilter.
Condition condition = 3;
// ADVANCED USE ONLY.
// Hook for introspection into the RowFilter. Outputs all cells directly to
// the output of the read rather than to any parent filter. Consider the
// following example:
//
// Chain(
// FamilyRegex("A"),
// Interleave(
// All(),
// Chain(Label("foo"), Sink())
// ),
// QualifierRegex("B")
// )
//
// A,A,1,w
// A,B,2,x
// B,B,4,z
// |
// FamilyRegex("A")
// |
// A,A,1,w
// A,B,2,x
// |
// +------------+-------------+
// | |
// All() Label(foo)
// | |
// A,A,1,w A,A,1,w,labels:[foo]
// A,B,2,x A,B,2,x,labels:[foo]
// | |
// | Sink() --------------+
// | | |
// +------------+ x------+ A,A,1,w,labels:[foo]
// | A,B,2,x,labels:[foo]
// A,A,1,w |
// A,B,2,x |
// | |
// QualifierRegex("B") |
// | |
// A,B,2,x |
// | |
// +--------------------------------+
// |
// A,A,1,w,labels:[foo]
// A,B,2,x,labels:[foo] // could be switched
// A,B,2,x // could be switched
//
// Despite being excluded by the qualifier filter, a copy of every cell
// that reaches the sink is present in the final result.
//
// As with an [Interleave][google.bigtable.v1.RowFilter.Interleave],
// duplicate cells are possible, and appear in an unspecified mutual order.
// In this case we have a duplicate with column "A:B" and timestamp 2,
// because one copy passed through the all filter while the other was
// passed through the label and sink. Note that one copy has label "foo",
// while the other does not.
//
// Cannot be used within the `predicate_filter`, `true_filter`, or
// `false_filter` of a [Condition][google.bigtable.v1.RowFilter.Condition].
bool sink = 16;
// Matches all cells, regardless of input. Functionally equivalent to
// leaving `filter` unset, but included for completeness.
bool pass_all_filter = 17;
// Does not match any cells, regardless of input. Useful for temporarily
// disabling just part of a filter.
bool block_all_filter = 18;
// Matches only cells from rows whose keys satisfy the given RE2 regex. In
// other words, passes through the entire row when the key matches, and
// otherwise produces an empty row.
// Note that, since row keys can contain arbitrary bytes, the '\C' escape
// sequence must be used if a true wildcard is desired. The '.' character
// will not match the new line character '\n', which may be present in a
// binary key.
bytes row_key_regex_filter = 4;
// Matches all cells from a row with probability p, and matches no cells
// from the row with probability 1-p.
double row_sample_filter = 14;
// Matches only cells from columns whose families satisfy the given RE2
// regex. For technical reasons, the regex must not contain the ':'
// character, even if it is not being used as a literal.
// Note that, since column families cannot contain the new line character
// '\n', it is sufficient to use '.' as a full wildcard when matching
// column family names.
string family_name_regex_filter = 5;
// Matches only cells from columns whose qualifiers satisfy the given RE2
// regex.
// Note that, since column qualifiers can contain arbitrary bytes, the '\C'
// escape sequence must be used if a true wildcard is desired. The '.'
// character will not match the new line character '\n', which may be
// present in a binary qualifier.
bytes column_qualifier_regex_filter = 6;
// Matches only cells from columns within the given range.
ColumnRange column_range_filter = 7;
// Matches only cells with timestamps within the given range.
TimestampRange timestamp_range_filter = 8;
// Matches only cells with values that satisfy the given regular expression.
// Note that, since cell values can contain arbitrary bytes, the '\C' escape
// sequence must be used if a true wildcard is desired. The '.' character
// will not match the new line character '\n', which may be present in a
// binary value.
bytes value_regex_filter = 9;
// Matches only cells with values that fall within the given range.
ValueRange value_range_filter = 15;
// Skips the first N cells of each row, matching all subsequent cells.
// If duplicate cells are present, as is possible when using an Interleave,
// each copy of the cell is counted separately.
int32 cells_per_row_offset_filter = 10;
// Matches only the first N cells of each row.
// If duplicate cells are present, as is possible when using an Interleave,
// each copy of the cell is counted separately.
int32 cells_per_row_limit_filter = 11;
// Matches only the most recent N cells within each column. For example,
// if N=2, this filter would match column "foo:bar" at timestamps 10 and 9,
// skip all earlier cells in "foo:bar", and then begin matching again in
// column "foo:bar2".
// If duplicate cells are present, as is possible when using an Interleave,
// each copy of the cell is counted separately.
int32 cells_per_column_limit_filter = 12;
// Replaces each cell's value with the empty string.
bool strip_value_transformer = 13;
// Applies the given label to all cells in the output row. This allows
// the client to determine which results were produced from which part of
// the filter.
//
// Values must be at most 15 characters in length, and match the RE2
// pattern [a-z0-9\\-]+
//
// Due to a technical limitation, it is not currently possible to apply
// multiple labels to a cell. As a result, a Chain may have no more than
// one sub-filter which contains a apply_label_transformer. It is okay for
// an Interleave to contain multiple apply_label_transformers, as they will
// be applied to separate copies of the input. This may be relaxed in the
// future.
string apply_label_transformer = 19;
}
}
// Specifies a particular change to be made to the contents of a row.
message Mutation {
// A Mutation which sets the value of the specified cell.
message SetCell {
// The name of the family into which new data should be written.
// Must match [-_.a-zA-Z0-9]+
string family_name = 1;
// The qualifier of the column into which new data should be written.
// Can be any byte string, including the empty string.
bytes column_qualifier = 2;
// The timestamp of the cell into which new data should be written.
// Use -1 for current Bigtable server time.
// Otherwise, the client should set this value itself, noting that the
// default value is a timestamp of zero if the field is left unspecified.
// Values must match the "granularity" of the table (e.g. micros, millis).
int64 timestamp_micros = 3;
// The value to be written into the specified cell.
bytes value = 4;
}
// A Mutation which deletes cells from the specified column, optionally
// restricting the deletions to a given timestamp range.
message DeleteFromColumn {
// The name of the family from which cells should be deleted.
// Must match [-_.a-zA-Z0-9]+
string family_name = 1;
// The qualifier of the column from which cells should be deleted.
// Can be any byte string, including the empty string.
bytes column_qualifier = 2;
// The range of timestamps within which cells should be deleted.
TimestampRange time_range = 3;
}
// A Mutation which deletes all cells from the specified column family.
message DeleteFromFamily {
// The name of the family from which cells should be deleted.
// Must match [-_.a-zA-Z0-9]+
string family_name = 1;
}
// A Mutation which deletes all cells from the containing row.
message DeleteFromRow {
}
// Which of the possible Mutation types to apply.
oneof mutation {
// Set a cell's value.
SetCell set_cell = 1;
// Deletes cells from a column.
DeleteFromColumn delete_from_column = 2;
// Deletes cells from a column family.
DeleteFromFamily delete_from_family = 3;
// Deletes cells from the entire row.
DeleteFromRow delete_from_row = 4;
}
}
// Specifies an atomic read/modify/write operation on the latest value of the
// specified column.
message ReadModifyWriteRule {
// The name of the family to which the read/modify/write should be applied.
// Must match [-_.a-zA-Z0-9]+
string family_name = 1;
// The qualifier of the column to which the read/modify/write should be
// applied.
// Can be any byte string, including the empty string.
bytes column_qualifier = 2;
// The rule used to determine the column's new latest value from its current
// latest value.
oneof rule {
// Rule specifying that "append_value" be appended to the existing value.
// If the targeted cell is unset, it will be treated as containing the
// empty string.
bytes append_value = 3;
// Rule specifying that "increment_amount" be added to the existing value.
// If the targeted cell is unset, it will be treated as containing a zero.
// Otherwise, the targeted cell must contain an 8-byte value (interpreted
// as a 64-bit big-endian signed integer), or the entire request will fail.
int64 increment_amount = 4;
}
}

View File

@@ -0,0 +1,91 @@
// Copyright 2018 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.bigtable.v1;
import "google/api/annotations.proto";
import "google/bigtable/v1/bigtable_data.proto";
import "google/bigtable/v1/bigtable_service_messages.proto";
import "google/protobuf/empty.proto";
option go_package = "google.golang.org/genproto/googleapis/bigtable/v1;bigtable";
option java_generic_services = true;
option java_multiple_files = true;
option java_outer_classname = "BigtableServicesProto";
option java_package = "com.google.bigtable.v1";
// Service for reading from and writing to existing Bigtables.
service BigtableService {
// Streams back the contents of all requested rows, optionally applying
// the same Reader filter to each. Depending on their size, rows may be
// broken up across multiple responses, but atomicity of each row will still
// be preserved.
rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) {
option (google.api.http) = {
post: "/v1/{table_name=projects/*/zones/*/clusters/*/tables/*}/rows:read"
body: "*"
};
}
// Returns a sample of row keys in the table. The returned row keys will
// delimit contiguous sections of the table of approximately equal size,
// which can be used to break up the data for distributed tasks like
// mapreduces.
rpc SampleRowKeys(SampleRowKeysRequest) returns (stream SampleRowKeysResponse) {
option (google.api.http) = {
get: "/v1/{table_name=projects/*/zones/*/clusters/*/tables/*}/rows:sampleKeys"
};
}
// Mutates a row atomically. Cells already present in the row are left
// unchanged unless explicitly changed by 'mutation'.
rpc MutateRow(MutateRowRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{table_name=projects/*/zones/*/clusters/*/tables/*}/rows/{row_key}:mutate"
body: "*"
};
}
// Mutates multiple rows in a batch. Each individual row is mutated
// atomically as in MutateRow, but the entire batch is not executed
// atomically.
rpc MutateRows(MutateRowsRequest) returns (MutateRowsResponse) {
option (google.api.http) = {
post: "/v1/{table_name=projects/*/zones/*/clusters/*/tables/*}:mutateRows"
body: "*"
};
}
// Mutates a row atomically based on the output of a predicate Reader filter.
rpc CheckAndMutateRow(CheckAndMutateRowRequest) returns (CheckAndMutateRowResponse) {
option (google.api.http) = {
post: "/v1/{table_name=projects/*/zones/*/clusters/*/tables/*}/rows/{row_key}:checkAndMutate"
body: "*"
};
}
// Modifies a row atomically, reading the latest existing timestamp/value from
// the specified columns and writing a new value at
// max(existing timestamp, current server time) based on pre-defined
// read/modify/write rules. Returns the new contents of all modified cells.
rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (Row) {
option (google.api.http) = {
post: "/v1/{table_name=projects/*/zones/*/clusters/*/tables/*}/rows/{row_key}:readModifyWrite"
body: "*"
};
}
}

View File

@@ -0,0 +1,218 @@
// Copyright 2018 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.bigtable.v1;
import "google/bigtable/v1/bigtable_data.proto";
import "google/rpc/status.proto";
option go_package = "google.golang.org/genproto/googleapis/bigtable/v1;bigtable";
option java_multiple_files = true;
option java_outer_classname = "BigtableServiceMessagesProto";
option java_package = "com.google.bigtable.v1";
// Request message for BigtableServer.ReadRows.
message ReadRowsRequest {
// The unique name of the table from which to read.
string table_name = 1;
// If neither row_key nor row_range is set, reads from all rows.
oneof target {
// The key of a single row from which to read.
bytes row_key = 2;
// A range of rows from which to read.
RowRange row_range = 3;
// A set of rows from which to read. Entries need not be in order, and will
// be deduplicated before reading.
// The total serialized size of the set must not exceed 1MB.
RowSet row_set = 8;
}
// The filter to apply to the contents of the specified row(s). If unset,
// reads the entire table.
RowFilter filter = 5;
// By default, rows are read sequentially, producing results which are
// guaranteed to arrive in increasing row order. Setting
// "allow_row_interleaving" to true allows multiple rows to be interleaved in
// the response stream, which increases throughput but breaks this guarantee,
// and may force the client to use more memory to buffer partially-received
// rows. Cannot be set to true when specifying "num_rows_limit".
bool allow_row_interleaving = 6;
// The read will terminate after committing to N rows' worth of results. The
// default (zero) is to return all results.
// Note that "allow_row_interleaving" cannot be set to true when this is set.
int64 num_rows_limit = 7;
}
// Response message for BigtableService.ReadRows.
message ReadRowsResponse {
// Specifies a piece of a row's contents returned as part of the read
// response stream.
message Chunk {
oneof chunk {
// A subset of the data from a particular row. As long as no "reset_row"
// is received in between, multiple "row_contents" from the same row are
// from the same atomic view of that row, and will be received in the
// expected family/column/timestamp order.
Family row_contents = 1;
// Indicates that the client should drop all previous chunks for
// "row_key", as it will be re-read from the beginning.
bool reset_row = 2;
// Indicates that the client can safely process all previous chunks for
// "row_key", as its data has been fully read.
bool commit_row = 3;
}
}
// The key of the row for which we're receiving data.
// Results will be received in increasing row key order, unless
// "allow_row_interleaving" was specified in the request.
bytes row_key = 1;
// One or more chunks of the row specified by "row_key".
repeated Chunk chunks = 2;
}
// Request message for BigtableService.SampleRowKeys.
message SampleRowKeysRequest {
// The unique name of the table from which to sample row keys.
string table_name = 1;
}
// Response message for BigtableService.SampleRowKeys.
message SampleRowKeysResponse {
// Sorted streamed sequence of sample row keys in the table. The table might
// have contents before the first row key in the list and after the last one,
// but a key containing the empty string indicates "end of table" and will be
// the last response given, if present.
// Note that row keys in this list may not have ever been written to or read
// from, and users should therefore not make any assumptions about the row key
// structure that are specific to their use case.
bytes row_key = 1;
// Approximate total storage space used by all rows in the table which precede
// "row_key". Buffering the contents of all rows between two subsequent
// samples would require space roughly equal to the difference in their
// "offset_bytes" fields.
int64 offset_bytes = 2;
}
// Request message for BigtableService.MutateRow.
message MutateRowRequest {
// The unique name of the table to which the mutation should be applied.
string table_name = 1;
// The key of the row to which the mutation should be applied.
bytes row_key = 2;
// Changes to be atomically applied to the specified row. Entries are applied
// in order, meaning that earlier mutations can be masked by later ones.
// Must contain at least one entry and at most 100000.
repeated Mutation mutations = 3;
}
// Request message for BigtableService.MutateRows.
message MutateRowsRequest {
message Entry {
// The key of the row to which the `mutations` should be applied.
bytes row_key = 1;
// Changes to be atomically applied to the specified row. Mutations are
// applied in order, meaning that earlier mutations can be masked by
// later ones.
// At least one mutation must be specified.
repeated Mutation mutations = 2;
}
// The unique name of the table to which the mutations should be applied.
string table_name = 1;
// The row keys/mutations to be applied in bulk.
// Each entry is applied as an atomic mutation, but the entries may be
// applied in arbitrary order (even between entries for the same row).
// At least one entry must be specified, and in total the entries may
// contain at most 100000 mutations.
repeated Entry entries = 2;
}
// Response message for BigtableService.MutateRows.
message MutateRowsResponse {
// The results for each Entry from the request, presented in the order
// in which the entries were originally given.
// Depending on how requests are batched during execution, it is possible
// for one Entry to fail due to an error with another Entry. In the event
// that this occurs, the same error will be reported for both entries.
repeated google.rpc.Status statuses = 1;
}
// Request message for BigtableService.CheckAndMutateRowRequest
message CheckAndMutateRowRequest {
// The unique name of the table to which the conditional mutation should be
// applied.
string table_name = 1;
// The key of the row to which the conditional mutation should be applied.
bytes row_key = 2;
// The filter to be applied to the contents of the specified row. Depending
// on whether or not any results are yielded, either "true_mutations" or
// "false_mutations" will be executed. If unset, checks that the row contains
// any values at all.
RowFilter predicate_filter = 6;
// Changes to be atomically applied to the specified row if "predicate_filter"
// yields at least one cell when applied to "row_key". Entries are applied in
// order, meaning that earlier mutations can be masked by later ones.
// Must contain at least one entry if "false_mutations" is empty, and at most
// 100000.
repeated Mutation true_mutations = 4;
// Changes to be atomically applied to the specified row if "predicate_filter"
// does not yield any cells when applied to "row_key". Entries are applied in
// order, meaning that earlier mutations can be masked by later ones.
// Must contain at least one entry if "true_mutations" is empty, and at most
// 100000.
repeated Mutation false_mutations = 5;
}
// Response message for BigtableService.CheckAndMutateRowRequest.
message CheckAndMutateRowResponse {
// Whether or not the request's "predicate_filter" yielded any results for
// the specified row.
bool predicate_matched = 1;
}
// Request message for BigtableService.ReadModifyWriteRowRequest.
message ReadModifyWriteRowRequest {
// The unique name of the table to which the read/modify/write rules should be
// applied.
string table_name = 1;
// The key of the row to which the read/modify/write rules should be applied.
bytes row_key = 2;
// Rules specifying how the specified row's contents are to be transformed
// into writes. Entries are applied in order, meaning that earlier rules will
// affect the results of later ones.
repeated ReadModifyWriteRule rules = 3;
}

View File

@@ -0,0 +1,365 @@
// Copyright 2018 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.bigtable.v2;
import "google/api/annotations.proto";
import "google/bigtable/v2/data.proto";
import "google/protobuf/wrappers.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.Cloud.Bigtable.V2";
option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable";
option java_multiple_files = true;
option java_outer_classname = "BigtableProto";
option java_package = "com.google.bigtable.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\V2";
// Service for reading from and writing to existing Bigtable tables.
service Bigtable {
// Streams back the contents of all requested rows in key order, optionally
// applying the same Reader filter to each. Depending on their size,
// rows and cells may be broken up across multiple responses, but
// atomicity of each row will still be preserved. See the
// ReadRowsResponse documentation for details.
rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) {
option (google.api.http) = {
post: "/v2/{table_name=projects/*/instances/*/tables/*}:readRows"
body: "*"
};
}
// Returns a sample of row keys in the table. The returned row keys will
// delimit contiguous sections of the table of approximately equal size,
// which can be used to break up the data for distributed tasks like
// mapreduces.
rpc SampleRowKeys(SampleRowKeysRequest) returns (stream SampleRowKeysResponse) {
option (google.api.http) = {
get: "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys"
};
}
// Mutates a row atomically. Cells already present in the row are left
// unchanged unless explicitly changed by `mutation`.
rpc MutateRow(MutateRowRequest) returns (MutateRowResponse) {
option (google.api.http) = {
post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow"
body: "*"
};
}
// Mutates multiple rows in a batch. Each individual row is mutated
// atomically as in MutateRow, but the entire batch is not executed
// atomically.
rpc MutateRows(MutateRowsRequest) returns (stream MutateRowsResponse) {
option (google.api.http) = {
post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows"
body: "*"
};
}
// Mutates a row atomically based on the output of a predicate Reader filter.
rpc CheckAndMutateRow(CheckAndMutateRowRequest) returns (CheckAndMutateRowResponse) {
option (google.api.http) = {
post: "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow"
body: "*"
};
}
// Modifies a row atomically on the server. The method reads the latest
// existing timestamp and value from the specified columns and writes a new
// entry based on pre-defined read/modify/write rules. The new value for the
// timestamp is the greater of the existing timestamp or the current server
// time. The method returns the new contents of all modified cells.
rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (ReadModifyWriteRowResponse) {
option (google.api.http) = {
post: "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow"
body: "*"
};
}
}
// Request message for Bigtable.ReadRows.
message ReadRowsRequest {
// The unique name of the table from which to read.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string table_name = 1;
// This value specifies routing for replication. If not specified, the
// "default" application profile will be used.
string app_profile_id = 5;
// The row keys and/or ranges to read. If not specified, reads from all rows.
RowSet rows = 2;
// The filter to apply to the contents of the specified row(s). If unset,
// reads the entirety of each row.
RowFilter filter = 3;
// The read will terminate after committing to N rows' worth of results. The
// default (zero) is to return all results.
int64 rows_limit = 4;
}
// Response message for Bigtable.ReadRows.
message ReadRowsResponse {
// Specifies a piece of a row's contents returned as part of the read
// response stream.
message CellChunk {
// The row key for this chunk of data. If the row key is empty,
// this CellChunk is a continuation of the same row as the previous
// CellChunk in the response stream, even if that CellChunk was in a
// previous ReadRowsResponse message.
bytes row_key = 1;
// The column family name for this chunk of data. If this message
// is not present this CellChunk is a continuation of the same column
// family as the previous CellChunk. The empty string can occur as a
// column family name in a response so clients must check
// explicitly for the presence of this message, not just for
// `family_name.value` being non-empty.
google.protobuf.StringValue family_name = 2;
// The column qualifier for this chunk of data. If this message
// is not present, this CellChunk is a continuation of the same column
// as the previous CellChunk. Column qualifiers may be empty so
// clients must check for the presence of this message, not just
// for `qualifier.value` being non-empty.
google.protobuf.BytesValue qualifier = 3;
// The cell's stored timestamp, which also uniquely identifies it
// within its column. Values are always expressed in
// microseconds, but individual tables may set a coarser
// granularity to further restrict the allowed values. For
// example, a table which specifies millisecond granularity will
// only allow values of `timestamp_micros` which are multiples of
// 1000. Timestamps are only set in the first CellChunk per cell
// (for cells split into multiple chunks).
int64 timestamp_micros = 4;
// Labels applied to the cell by a
// [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set
// on the first CellChunk per cell.
repeated string labels = 5;
// The value stored in the cell. Cell values can be split across
// multiple CellChunks. In that case only the value field will be
// set in CellChunks after the first: the timestamp and labels
// will only be present in the first CellChunk, even if the first
// CellChunk came in a previous ReadRowsResponse.
bytes value = 6;
// If this CellChunk is part of a chunked cell value and this is
// not the final chunk of that cell, value_size will be set to the
// total length of the cell value. The client can use this size
// to pre-allocate memory to hold the full cell value.
int32 value_size = 7;
oneof row_status {
// Indicates that the client should drop all previous chunks for
// `row_key`, as it will be re-read from the beginning.
bool reset_row = 8;
// Indicates that the client can safely process all previous chunks for
// `row_key`, as its data has been fully read.
bool commit_row = 9;
}
}
repeated CellChunk chunks = 1;
// Optionally the server might return the row key of the last row it
// has scanned. The client can use this to construct a more
// efficient retry request if needed: any row keys or portions of
// ranges less than this row key can be dropped from the request.
// This is primarily useful for cases where the server has read a
// lot of data that was filtered out since the last committed row
// key, allowing the client to skip that work on a retry.
bytes last_scanned_row_key = 2;
}
// Request message for Bigtable.SampleRowKeys.
message SampleRowKeysRequest {
// The unique name of the table from which to sample row keys.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string table_name = 1;
// This value specifies routing for replication. If not specified, the
// "default" application profile will be used.
string app_profile_id = 2;
}
// Response message for Bigtable.SampleRowKeys.
message SampleRowKeysResponse {
// Sorted streamed sequence of sample row keys in the table. The table might
// have contents before the first row key in the list and after the last one,
// but a key containing the empty string indicates "end of table" and will be
// the last response given, if present.
// Note that row keys in this list may not have ever been written to or read
// from, and users should therefore not make any assumptions about the row key
// structure that are specific to their use case.
bytes row_key = 1;
// Approximate total storage space used by all rows in the table which precede
// `row_key`. Buffering the contents of all rows between two subsequent
// samples would require space roughly equal to the difference in their
// `offset_bytes` fields.
int64 offset_bytes = 2;
}
// Request message for Bigtable.MutateRow.
message MutateRowRequest {
// The unique name of the table to which the mutation should be applied.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string table_name = 1;
// This value specifies routing for replication. If not specified, the
// "default" application profile will be used.
string app_profile_id = 4;
// The key of the row to which the mutation should be applied.
bytes row_key = 2;
// Changes to be atomically applied to the specified row. Entries are applied
// in order, meaning that earlier mutations can be masked by later ones.
// Must contain at least one entry and at most 100000.
repeated Mutation mutations = 3;
}
// Response message for Bigtable.MutateRow.
message MutateRowResponse {
}
// Request message for BigtableService.MutateRows.
message MutateRowsRequest {
message Entry {
// The key of the row to which the `mutations` should be applied.
bytes row_key = 1;
// Changes to be atomically applied to the specified row. Mutations are
// applied in order, meaning that earlier mutations can be masked by
// later ones.
// You must specify at least one mutation.
repeated Mutation mutations = 2;
}
// The unique name of the table to which the mutations should be applied.
string table_name = 1;
// This value specifies routing for replication. If not specified, the
// "default" application profile will be used.
string app_profile_id = 3;
// The row keys and corresponding mutations to be applied in bulk.
// Each entry is applied as an atomic mutation, but the entries may be
// applied in arbitrary order (even between entries for the same row).
// At least one entry must be specified, and in total the entries can
// contain at most 100000 mutations.
repeated Entry entries = 2;
}
// Response message for BigtableService.MutateRows.
message MutateRowsResponse {
message Entry {
// The index into the original request's `entries` list of the Entry
// for which a result is being reported.
int64 index = 1;
// The result of the request Entry identified by `index`.
// Depending on how requests are batched during execution, it is possible
// for one Entry to fail due to an error with another Entry. In the event
// that this occurs, the same error will be reported for both entries.
google.rpc.Status status = 2;
}
// One or more results for Entries from the batch request.
repeated Entry entries = 1;
}
// Request message for Bigtable.CheckAndMutateRow.
message CheckAndMutateRowRequest {
// The unique name of the table to which the conditional mutation should be
// applied.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string table_name = 1;
// This value specifies routing for replication. If not specified, the
// "default" application profile will be used.
string app_profile_id = 7;
// The key of the row to which the conditional mutation should be applied.
bytes row_key = 2;
// The filter to be applied to the contents of the specified row. Depending
// on whether or not any results are yielded, either `true_mutations` or
// `false_mutations` will be executed. If unset, checks that the row contains
// any values at all.
RowFilter predicate_filter = 6;
// Changes to be atomically applied to the specified row if `predicate_filter`
// yields at least one cell when applied to `row_key`. Entries are applied in
// order, meaning that earlier mutations can be masked by later ones.
// Must contain at least one entry if `false_mutations` is empty, and at most
// 100000.
repeated Mutation true_mutations = 4;
// Changes to be atomically applied to the specified row if `predicate_filter`
// does not yield any cells when applied to `row_key`. Entries are applied in
// order, meaning that earlier mutations can be masked by later ones.
// Must contain at least one entry if `true_mutations` is empty, and at most
// 100000.
repeated Mutation false_mutations = 5;
}
// Response message for Bigtable.CheckAndMutateRow.
message CheckAndMutateRowResponse {
// Whether or not the request's `predicate_filter` yielded any results for
// the specified row.
bool predicate_matched = 1;
}
// Request message for Bigtable.ReadModifyWriteRow.
message ReadModifyWriteRowRequest {
// The unique name of the table to which the read/modify/write rules should be
// applied.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string table_name = 1;
// This value specifies routing for replication. If not specified, the
// "default" application profile will be used.
string app_profile_id = 4;
// The key of the row to which the read/modify/write rules should be applied.
bytes row_key = 2;
// Rules specifying how the specified row's contents are to be transformed
// into writes. Entries are applied in order, meaning that earlier rules will
// affect the results of later ones.
repeated ReadModifyWriteRule rules = 3;
}
// Response message for Bigtable.ReadModifyWriteRow.
message ReadModifyWriteRowResponse {
// A Row containing the new contents of all cells modified by the request.
Row row = 1;
}

View File

@@ -0,0 +1,535 @@
// Copyright 2018 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.bigtable.v2;
option csharp_namespace = "Google.Cloud.Bigtable.V2";
option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable";
option java_multiple_files = true;
option java_outer_classname = "DataProto";
option java_package = "com.google.bigtable.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\V2";
// Specifies the complete (requested) contents of a single row of a table.
// Rows which exceed 256MiB in size cannot be read in full.
message Row {
// The unique key which identifies this row within its table. This is the same
// key that's used to identify the row in, for example, a MutateRowRequest.
// May contain any non-empty byte string up to 4KiB in length.
bytes key = 1;
// May be empty, but only if the entire row is empty.
// The mutual ordering of column families is not specified.
repeated Family families = 2;
}
// Specifies (some of) the contents of a single row/column family intersection
// of a table.
message Family {
// The unique key which identifies this family within its row. This is the
// same key that's used to identify the family in, for example, a RowFilter
// which sets its "family_name_regex_filter" field.
// Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
// produce cells in a sentinel family with an empty name.
// Must be no greater than 64 characters in length.
string name = 1;
// Must not be empty. Sorted in order of increasing "qualifier".
repeated Column columns = 2;
}
// Specifies (some of) the contents of a single row/column intersection of a
// table.
message Column {
// The unique key which identifies this column within its family. This is the
// same key that's used to identify the column in, for example, a RowFilter
// which sets its `column_qualifier_regex_filter` field.
// May contain any byte string, including the empty string, up to 16kiB in
// length.
bytes qualifier = 1;
// Must not be empty. Sorted in order of decreasing "timestamp_micros".
repeated Cell cells = 2;
}
// Specifies (some of) the contents of a single row/column/timestamp of a table.
message Cell {
// The cell's stored timestamp, which also uniquely identifies it within
// its column.
// Values are always expressed in microseconds, but individual tables may set
// a coarser granularity to further restrict the allowed values. For
// example, a table which specifies millisecond granularity will only allow
// values of `timestamp_micros` which are multiples of 1000.
int64 timestamp_micros = 1;
// The value stored in the cell.
// May contain any byte string, including the empty string, up to 100MiB in
// length.
bytes value = 2;
// Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
repeated string labels = 3;
}
// Specifies a contiguous range of rows.
message RowRange {
// The row key at which to start the range.
// If neither field is set, interpreted as the empty string, inclusive.
oneof start_key {
// Used when giving an inclusive lower bound for the range.
bytes start_key_closed = 1;
// Used when giving an exclusive lower bound for the range.
bytes start_key_open = 2;
}
// The row key at which to end the range.
// If neither field is set, interpreted as the infinite row key, exclusive.
oneof end_key {
// Used when giving an exclusive upper bound for the range.
bytes end_key_open = 3;
// Used when giving an inclusive upper bound for the range.
bytes end_key_closed = 4;
}
}
// Specifies a non-contiguous set of rows.
message RowSet {
// Single rows included in the set.
repeated bytes row_keys = 1;
// Contiguous row ranges included in the set.
repeated RowRange row_ranges = 2;
}
// Specifies a contiguous range of columns within a single column family.
// The range spans from &lt;column_family&gt;:&lt;start_qualifier&gt; to
// &lt;column_family&gt;:&lt;end_qualifier&gt;, where both bounds can be either
// inclusive or exclusive.
message ColumnRange {
// The name of the column family within which this range falls.
string family_name = 1;
// The column qualifier at which to start the range (within `column_family`).
// If neither field is set, interpreted as the empty string, inclusive.
oneof start_qualifier {
// Used when giving an inclusive lower bound for the range.
bytes start_qualifier_closed = 2;
// Used when giving an exclusive lower bound for the range.
bytes start_qualifier_open = 3;
}
// The column qualifier at which to end the range (within `column_family`).
// If neither field is set, interpreted as the infinite string, exclusive.
oneof end_qualifier {
// Used when giving an inclusive upper bound for the range.
bytes end_qualifier_closed = 4;
// Used when giving an exclusive upper bound for the range.
bytes end_qualifier_open = 5;
}
}
// Specified a contiguous range of microsecond timestamps.
message TimestampRange {
// Inclusive lower bound. If left empty, interpreted as 0.
int64 start_timestamp_micros = 1;
// Exclusive upper bound. If left empty, interpreted as infinity.
int64 end_timestamp_micros = 2;
}
// Specifies a contiguous range of raw byte values.
message ValueRange {
// The value at which to start the range.
// If neither field is set, interpreted as the empty string, inclusive.
oneof start_value {
// Used when giving an inclusive lower bound for the range.
bytes start_value_closed = 1;
// Used when giving an exclusive lower bound for the range.
bytes start_value_open = 2;
}
// The value at which to end the range.
// If neither field is set, interpreted as the infinite string, exclusive.
oneof end_value {
// Used when giving an inclusive upper bound for the range.
bytes end_value_closed = 3;
// Used when giving an exclusive upper bound for the range.
bytes end_value_open = 4;
}
}
// Takes a row as input and produces an alternate view of the row based on
// specified rules. For example, a RowFilter might trim down a row to include
// just the cells from columns matching a given regular expression, or might
// return all the cells of a row but not their values. More complicated filters
// can be composed out of these components to express requests such as, "within
// every column of a particular family, give just the two most recent cells
// which are older than timestamp X."
//
// There are two broad categories of RowFilters (true filters and transformers),
// as well as two ways to compose simple filters into more complex ones
// (chains and interleaves). They work as follows:
//
// * True filters alter the input row by excluding some of its cells wholesale
// from the output row. An example of a true filter is the `value_regex_filter`,
// which excludes cells whose values don't match the specified pattern. All
// regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax)
// in raw byte mode (RE2::Latin1), and are evaluated as full matches. An
// important point to keep in mind is that `RE2(.)` is equivalent by default to
// `RE2([^\n])`, meaning that it does not match newlines. When attempting to
// match an arbitrary byte, you should therefore use the escape sequence `\C`,
// which may need to be further escaped as `\\C` in your client language.
//
// * Transformers alter the input row by changing the values of some of its
// cells in the output, without excluding them completely. Currently, the only
// supported transformer is the `strip_value_transformer`, which replaces every
// cell's value with the empty string.
//
// * Chains and interleaves are described in more detail in the
// RowFilter.Chain and RowFilter.Interleave documentation.
//
// The total serialized size of a RowFilter message must not
// exceed 4096 bytes, and RowFilters may not be nested within each other
// (in Chains or Interleaves) to a depth of more than 20.
message RowFilter {
// A RowFilter which sends rows through several RowFilters in sequence.
message Chain {
// The elements of "filters" are chained together to process the input row:
// in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
// The full chain is executed atomically.
repeated RowFilter filters = 1;
}
// A RowFilter which sends each row to each of several component
// RowFilters and interleaves the results.
message Interleave {
// The elements of "filters" all process a copy of the input row, and the
// results are pooled, sorted, and combined into a single output row.
// If multiple cells are produced with the same column and timestamp,
// they will all appear in the output row in an unspecified mutual order.
// Consider the following example, with three filters:
//
// input row
// |
// -----------------------------------------------------
// | | |
// f(0) f(1) f(2)
// | | |
// 1: foo,bar,10,x foo,bar,10,z far,bar,7,a
// 2: foo,blah,11,z far,blah,5,x far,blah,5,x
// | | |
// -----------------------------------------------------
// |
// 1: foo,bar,10,z // could have switched with #2
// 2: foo,bar,10,x // could have switched with #1
// 3: foo,blah,11,z
// 4: far,bar,7,a
// 5: far,blah,5,x // identical to #6
// 6: far,blah,5,x // identical to #5
//
// All interleaved filters are executed atomically.
repeated RowFilter filters = 1;
}
// A RowFilter which evaluates one of two possible RowFilters, depending on
// whether or not a predicate RowFilter outputs any cells from the input row.
//
// IMPORTANT NOTE: The predicate filter does not execute atomically with the
// true and false filters, which may lead to inconsistent or unexpected
// results. Additionally, Condition filters have poor performance, especially
// when filters are set for the false condition.
message Condition {
// If `predicate_filter` outputs any cells, then `true_filter` will be
// evaluated on the input row. Otherwise, `false_filter` will be evaluated.
RowFilter predicate_filter = 1;
// The filter to apply to the input row if `predicate_filter` returns any
// results. If not provided, no results will be returned in the true case.
RowFilter true_filter = 2;
// The filter to apply to the input row if `predicate_filter` does not
// return any results. If not provided, no results will be returned in the
// false case.
RowFilter false_filter = 3;
}
// Which of the possible RowFilter types to apply. If none are set, this
// RowFilter returns all cells in the input row.
oneof filter {
// Applies several RowFilters to the data in sequence, progressively
// narrowing the results.
Chain chain = 1;
// Applies several RowFilters to the data in parallel and combines the
// results.
Interleave interleave = 2;
// Applies one of two possible RowFilters to the data based on the output of
// a predicate RowFilter.
Condition condition = 3;
// ADVANCED USE ONLY.
// Hook for introspection into the RowFilter. Outputs all cells directly to
// the output of the read rather than to any parent filter. Consider the
// following example:
//
// Chain(
// FamilyRegex("A"),
// Interleave(
// All(),
// Chain(Label("foo"), Sink())
// ),
// QualifierRegex("B")
// )
//
// A,A,1,w
// A,B,2,x
// B,B,4,z
// |
// FamilyRegex("A")
// |
// A,A,1,w
// A,B,2,x
// |
// +------------+-------------+
// | |
// All() Label(foo)
// | |
// A,A,1,w A,A,1,w,labels:[foo]
// A,B,2,x A,B,2,x,labels:[foo]
// | |
// | Sink() --------------+
// | | |
// +------------+ x------+ A,A,1,w,labels:[foo]
// | A,B,2,x,labels:[foo]
// A,A,1,w |
// A,B,2,x |
// | |
// QualifierRegex("B") |
// | |
// A,B,2,x |
// | |
// +--------------------------------+
// |
// A,A,1,w,labels:[foo]
// A,B,2,x,labels:[foo] // could be switched
// A,B,2,x // could be switched
//
// Despite being excluded by the qualifier filter, a copy of every cell
// that reaches the sink is present in the final result.
//
// As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
// duplicate cells are possible, and appear in an unspecified mutual order.
// In this case we have a duplicate with column "A:B" and timestamp 2,
// because one copy passed through the all filter while the other was
// passed through the label and sink. Note that one copy has label "foo",
// while the other does not.
//
// Cannot be used within the `predicate_filter`, `true_filter`, or
// `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
bool sink = 16;
// Matches all cells, regardless of input. Functionally equivalent to
// leaving `filter` unset, but included for completeness.
bool pass_all_filter = 17;
// Does not match any cells, regardless of input. Useful for temporarily
// disabling just part of a filter.
bool block_all_filter = 18;
// Matches only cells from rows whose keys satisfy the given RE2 regex. In
// other words, passes through the entire row when the key matches, and
// otherwise produces an empty row.
// Note that, since row keys can contain arbitrary bytes, the `\C` escape
// sequence must be used if a true wildcard is desired. The `.` character
// will not match the new line character `\n`, which may be present in a
// binary key.
bytes row_key_regex_filter = 4;
// Matches all cells from a row with probability p, and matches no cells
// from the row with probability 1-p.
double row_sample_filter = 14;
// Matches only cells from columns whose families satisfy the given RE2
// regex. For technical reasons, the regex must not contain the `:`
// character, even if it is not being used as a literal.
// Note that, since column families cannot contain the new line character
// `\n`, it is sufficient to use `.` as a full wildcard when matching
// column family names.
string family_name_regex_filter = 5;
// Matches only cells from columns whose qualifiers satisfy the given RE2
// regex.
// Note that, since column qualifiers can contain arbitrary bytes, the `\C`
// escape sequence must be used if a true wildcard is desired. The `.`
// character will not match the new line character `\n`, which may be
// present in a binary qualifier.
bytes column_qualifier_regex_filter = 6;
// Matches only cells from columns within the given range.
ColumnRange column_range_filter = 7;
// Matches only cells with timestamps within the given range.
TimestampRange timestamp_range_filter = 8;
// Matches only cells with values that satisfy the given regular expression.
// Note that, since cell values can contain arbitrary bytes, the `\C` escape
// sequence must be used if a true wildcard is desired. The `.` character
// will not match the new line character `\n`, which may be present in a
// binary value.
bytes value_regex_filter = 9;
// Matches only cells with values that fall within the given range.
ValueRange value_range_filter = 15;
// Skips the first N cells of each row, matching all subsequent cells.
// If duplicate cells are present, as is possible when using an Interleave,
// each copy of the cell is counted separately.
int32 cells_per_row_offset_filter = 10;
// Matches only the first N cells of each row.
// If duplicate cells are present, as is possible when using an Interleave,
// each copy of the cell is counted separately.
int32 cells_per_row_limit_filter = 11;
// Matches only the most recent N cells within each column. For example,
// if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
// skip all earlier cells in `foo:bar`, and then begin matching again in
// column `foo:bar2`.
// If duplicate cells are present, as is possible when using an Interleave,
// each copy of the cell is counted separately.
int32 cells_per_column_limit_filter = 12;
// Replaces each cell's value with the empty string.
bool strip_value_transformer = 13;
// Applies the given label to all cells in the output row. This allows
// the client to determine which results were produced from which part of
// the filter.
//
// Values must be at most 15 characters in length, and match the RE2
// pattern `[a-z0-9\\-]+`
//
// Due to a technical limitation, it is not currently possible to apply
// multiple labels to a cell. As a result, a Chain may have no more than
// one sub-filter which contains a `apply_label_transformer`. It is okay for
// an Interleave to contain multiple `apply_label_transformers`, as they
// will be applied to separate copies of the input. This may be relaxed in
// the future.
string apply_label_transformer = 19;
}
}
// Specifies a particular change to be made to the contents of a row.
message Mutation {
// A Mutation which sets the value of the specified cell.
message SetCell {
// The name of the family into which new data should be written.
// Must match `[-_.a-zA-Z0-9]+`
string family_name = 1;
// The qualifier of the column into which new data should be written.
// Can be any byte string, including the empty string.
bytes column_qualifier = 2;
// The timestamp of the cell into which new data should be written.
// Use -1 for current Bigtable server time.
// Otherwise, the client should set this value itself, noting that the
// default value is a timestamp of zero if the field is left unspecified.
// Values must match the granularity of the table (e.g. micros, millis).
int64 timestamp_micros = 3;
// The value to be written into the specified cell.
bytes value = 4;
}
// A Mutation which deletes cells from the specified column, optionally
// restricting the deletions to a given timestamp range.
message DeleteFromColumn {
// The name of the family from which cells should be deleted.
// Must match `[-_.a-zA-Z0-9]+`
string family_name = 1;
// The qualifier of the column from which cells should be deleted.
// Can be any byte string, including the empty string.
bytes column_qualifier = 2;
// The range of timestamps within which cells should be deleted.
TimestampRange time_range = 3;
}
// A Mutation which deletes all cells from the specified column family.
message DeleteFromFamily {
// The name of the family from which cells should be deleted.
// Must match `[-_.a-zA-Z0-9]+`
string family_name = 1;
}
// A Mutation which deletes all cells from the containing row.
message DeleteFromRow {
}
// Which of the possible Mutation types to apply.
oneof mutation {
// Set a cell's value.
SetCell set_cell = 1;
// Deletes cells from a column.
DeleteFromColumn delete_from_column = 2;
// Deletes cells from a column family.
DeleteFromFamily delete_from_family = 3;
// Deletes cells from the entire row.
DeleteFromRow delete_from_row = 4;
}
}
// Specifies an atomic read/modify/write operation on the latest value of the
// specified column.
message ReadModifyWriteRule {
// The name of the family to which the read/modify/write should be applied.
// Must match `[-_.a-zA-Z0-9]+`
string family_name = 1;
// The qualifier of the column to which the read/modify/write should be
// applied.
// Can be any byte string, including the empty string.
bytes column_qualifier = 2;
// The rule used to determine the column's new latest value from its current
// latest value.
oneof rule {
// Rule specifying that `append_value` be appended to the existing value.
// If the targeted cell is unset, it will be treated as containing the
// empty string.
bytes append_value = 3;
// Rule specifying that `increment_amount` be added to the existing value.
// If the targeted cell is unset, it will be treated as containing a zero.
// Otherwise, the targeted cell must contain an 8-byte value (interpreted
// as a 64-bit big-endian signed integer), or the entire request will fail.
int64 increment_amount = 4;
}
}

View File

@@ -0,0 +1,181 @@
// 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.bytestream;
import "google/api/annotations.proto";
import "google/protobuf/wrappers.proto";
option go_package = "google.golang.org/genproto/googleapis/bytestream;bytestream";
option java_outer_classname = "ByteStreamProto";
option java_package = "com.google.bytestream";
// #### Introduction
//
// The Byte Stream API enables a client to read and write a stream of bytes to
// and from a resource. Resources have names, and these names are supplied in
// the API calls below to identify the resource that is being read from or
// written to.
//
// All implementations of the Byte Stream API export the interface defined here:
//
// * `Read()`: Reads the contents of a resource.
//
// * `Write()`: Writes the contents of a resource. The client can call `Write()`
// multiple times with the same resource and can check the status of the write
// by calling `QueryWriteStatus()`.
//
// #### Service parameters and metadata
//
// The ByteStream API provides no direct way to access/modify any metadata
// associated with the resource.
//
// #### Errors
//
// The errors returned by the service are in the Google canonical error space.
service ByteStream {
// `Read()` is used to retrieve the contents of a resource as a sequence
// of bytes. The bytes are returned in a sequence of responses, and the
// responses are delivered as the results of a server-side streaming RPC.
rpc Read(ReadRequest) returns (stream ReadResponse);
// `Write()` is used to send the contents of a resource as a sequence of
// bytes. The bytes are sent in a sequence of request protos of a client-side
// streaming RPC.
//
// A `Write()` action is resumable. If there is an error or the connection is
// broken during the `Write()`, the client should check the status of the
// `Write()` by calling `QueryWriteStatus()` and continue writing from the
// returned `committed_size`. This may be less than the amount of data the
// client previously sent.
//
// Calling `Write()` on a resource name that was previously written and
// finalized could cause an error, depending on whether the underlying service
// allows over-writing of previously written resources.
//
// When the client closes the request channel, the service will respond with
// a `WriteResponse`. The service will not view the resource as `complete`
// until the client has sent a `WriteRequest` with `finish_write` set to
// `true`. Sending any requests on a stream after sending a request with
// `finish_write` set to `true` will cause an error. The client **should**
// check the `WriteResponse` it receives to determine how much data the
// service was able to commit and whether the service views the resource as
// `complete` or not.
rpc Write(stream WriteRequest) returns (WriteResponse);
// `QueryWriteStatus()` is used to find the `committed_size` for a resource
// that is being written, which can then be used as the `write_offset` for
// the next `Write()` call.
//
// If the resource does not exist (i.e., the resource has been deleted, or the
// first `Write()` has not yet reached the service), this method returns the
// error `NOT_FOUND`.
//
// The client **may** call `QueryWriteStatus()` at any time to determine how
// much data has been processed for this resource. This is useful if the
// client is buffering data and needs to know which data can be safely
// evicted. For any sequence of `QueryWriteStatus()` calls for a given
// resource name, the sequence of returned `committed_size` values will be
// non-decreasing.
rpc QueryWriteStatus(QueryWriteStatusRequest) returns (QueryWriteStatusResponse);
}
// Request object for ByteStream.Read.
message ReadRequest {
// The name of the resource to read.
string resource_name = 1;
// The offset for the first byte to return in the read, relative to the start
// of the resource.
//
// A `read_offset` that is negative or greater than the size of the resource
// will cause an `OUT_OF_RANGE` error.
int64 read_offset = 2;
// The maximum number of `data` bytes the server is allowed to return in the
// sum of all `ReadResponse` messages. A `read_limit` of zero indicates that
// there is no limit, and a negative `read_limit` will cause an error.
//
// If the stream returns fewer bytes than allowed by the `read_limit` and no
// error occurred, the stream includes all data from the `read_offset` to the
// end of the resource.
int64 read_limit = 3;
}
// Response object for ByteStream.Read.
message ReadResponse {
// A portion of the data for the resource. The service **may** leave `data`
// empty for any given `ReadResponse`. This enables the service to inform the
// client that the request is still live while it is running an operation to
// generate more data.
bytes data = 10;
}
// Request object for ByteStream.Write.
message WriteRequest {
// The name of the resource to write. This **must** be set on the first
// `WriteRequest` of each `Write()` action. If it is set on subsequent calls,
// it **must** match the value of the first request.
string resource_name = 1;
// The offset from the beginning of the resource at which the data should be
// written. It is required on all `WriteRequest`s.
//
// In the first `WriteRequest` of a `Write()` action, it indicates
// the initial offset for the `Write()` call. The value **must** be equal to
// the `committed_size` that a call to `QueryWriteStatus()` would return.
//
// On subsequent calls, this value **must** be set and **must** be equal to
// the sum of the first `write_offset` and the sizes of all `data` bundles
// sent previously on this stream.
//
// An incorrect value will cause an error.
int64 write_offset = 2;
// If `true`, this indicates that the write is complete. Sending any
// `WriteRequest`s subsequent to one in which `finish_write` is `true` will
// cause an error.
bool finish_write = 3;
// A portion of the data for the resource. The client **may** leave `data`
// empty for any given `WriteRequest`. This enables the client to inform the
// service that the request is still live while it is running an operation to
// generate more data.
bytes data = 10;
}
// Response object for ByteStream.Write.
message WriteResponse {
// The number of bytes that have been processed for the given resource.
int64 committed_size = 1;
}
// Request object for ByteStream.QueryWriteStatus.
message QueryWriteStatusRequest {
// The name of the resource whose write status is being requested.
string resource_name = 1;
}
// Response object for ByteStream.QueryWriteStatus.
message QueryWriteStatusResponse {
// The number of bytes that have been processed for the given resource.
int64 committed_size = 1;
// `complete` is `true` only if the client has sent a `WriteRequest` with
// `finish_write` set to true, and the server has processed that request.
bool complete = 2;
}

View File

@@ -0,0 +1,128 @@
// 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.cloud.audit;
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";
import "google/rpc/status.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/audit;audit";
option java_multiple_files = true;
option java_outer_classname = "AuditLogProto";
option java_package = "com.google.cloud.audit";
// Common audit log format for Google Cloud Platform API operations.
message AuditLog {
// The name of the API service performing the operation. For example,
// `"datastore.googleapis.com"`.
string service_name = 7;
// The name of the service method or operation.
// For API calls, this should be the name of the API method.
// For example,
//
// "google.datastore.v1.Datastore.RunQuery"
// "google.logging.v1.LoggingService.DeleteLog"
string method_name = 8;
// The resource or collection that is the target of the operation.
// The name is a scheme-less URI, not including the API service name.
// For example:
//
// "shelves/SHELF_ID/books"
// "shelves/SHELF_ID/books/BOOK_ID"
string resource_name = 11;
// The number of items returned from a List or Query API method,
// if applicable.
int64 num_response_items = 12;
// The status of the overall operation.
google.rpc.Status status = 2;
// Authentication information.
AuthenticationInfo authentication_info = 3;
// Authorization information. If there are multiple
// resources or permissions involved, then there is
// one AuthorizationInfo element for each {resource, permission} tuple.
repeated AuthorizationInfo authorization_info = 9;
// Metadata about the operation.
RequestMetadata request_metadata = 4;
// The operation request. This may not include all request parameters,
// such as those that are too large, privacy-sensitive, or duplicated
// elsewhere in the log record.
// It should never include user-generated data, such as file contents.
// When the JSON object represented here has a proto equivalent, the proto
// name will be indicated in the `@type` property.
google.protobuf.Struct request = 16;
// The operation response. This may not include all response elements,
// such as those that are too large, privacy-sensitive, or duplicated
// elsewhere in the log record.
// It should never include user-generated data, such as file contents.
// When the JSON object represented here has a proto equivalent, the proto
// name will be indicated in the `@type` property.
google.protobuf.Struct response = 17;
// Other service-specific data about the request, response, and other
// activities.
google.protobuf.Any service_data = 15;
}
// Authentication information for the operation.
message AuthenticationInfo {
// The email address of the authenticated user making the request.
string principal_email = 1;
}
// Authorization information for the operation.
message AuthorizationInfo {
// The resource being accessed, as a REST-style string. For example:
//
// bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID
string resource = 1;
// The required IAM permission.
string permission = 2;
// Whether or not authorization for `resource` and `permission`
// was granted.
bool granted = 3;
}
// Metadata about the request.
message RequestMetadata {
// The IP address of the caller.
string caller_ip = 1;
// The user agent of the caller.
// This information is not authenticated and should be treated accordingly.
// For example:
//
// + `google-api-python-client/1.4.0`:
// The request was made by the Google API client for Python.
// + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`:
// The request was made by the Google Cloud SDK CLI (gcloud).
// + `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`:
// The request was made from the `my-project` App Engine app.
string caller_supplied_user_agent = 2;
}

View File

@@ -0,0 +1,653 @@
// Copyright 2018 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.cloud.bigquery.datatransfer.v1;
import "google/api/annotations.proto";
import "google/cloud/bigquery/datatransfer/v1/transfer.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer";
option java_multiple_files = true;
option java_outer_classname = "DataTransferProto";
option java_package = "com.google.cloud.bigquery.datatransfer.v1";
option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1";
// The Google BigQuery Data Transfer Service API enables BigQuery users to
// configure the transfer of their data from other Google Products into BigQuery.
// This service contains methods that are end user exposed. It backs up the
// frontend.
service DataTransferService {
// Retrieves a supported data source and returns its settings,
// which can be used for UI rendering.
rpc GetDataSource(GetDataSourceRequest) returns (DataSource) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/dataSources/*}"
additional_bindings {
get: "/v1/{name=projects/*/dataSources/*}"
}
};
}
// Lists supported data sources and returns their settings,
// which can be used for UI rendering.
rpc ListDataSources(ListDataSourcesRequest) returns (ListDataSourcesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/dataSources"
additional_bindings {
get: "/v1/{parent=projects/*}/dataSources"
}
};
}
// Creates a new data transfer configuration.
rpc CreateTransferConfig(CreateTransferConfigRequest) returns (TransferConfig) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/transferConfigs"
body: "transfer_config"
additional_bindings {
post: "/v1/{parent=projects/*}/transferConfigs"
body: "transfer_config"
}
};
}
// Updates a data transfer configuration.
// All fields must be set, even if they are not updated.
rpc UpdateTransferConfig(UpdateTransferConfigRequest) returns (TransferConfig) {
option (google.api.http) = {
patch: "/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}"
body: "transfer_config"
additional_bindings {
patch: "/v1/{transfer_config.name=projects/*/transferConfigs/*}"
body: "transfer_config"
}
};
}
// Deletes a data transfer configuration,
// including any associated transfer runs and logs.
rpc DeleteTransferConfig(DeleteTransferConfigRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/transferConfigs/*}"
additional_bindings {
delete: "/v1/{name=projects/*/transferConfigs/*}"
}
};
}
// Returns information about a data transfer config.
rpc GetTransferConfig(GetTransferConfigRequest) returns (TransferConfig) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/transferConfigs/*}"
additional_bindings {
get: "/v1/{name=projects/*/transferConfigs/*}"
}
};
}
// Returns information about all data transfers in the project.
rpc ListTransferConfigs(ListTransferConfigsRequest) returns (ListTransferConfigsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/transferConfigs"
additional_bindings {
get: "/v1/{parent=projects/*}/transferConfigs"
}
};
}
// Creates transfer runs for a time range [start_time, end_time].
// For each date - or whatever granularity the data source supports - in the
// range, one transfer run is created.
// Note that runs are created per UTC time in the time range.
rpc ScheduleTransferRuns(ScheduleTransferRunsRequest) returns (ScheduleTransferRunsResponse) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns"
body: "*"
additional_bindings {
post: "/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns"
body: "*"
}
};
}
// Returns information about the particular transfer run.
rpc GetTransferRun(GetTransferRunRequest) returns (TransferRun) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}"
additional_bindings {
get: "/v1/{name=projects/*/transferConfigs/*/runs/*}"
}
};
}
// Deletes the specified transfer run.
rpc DeleteTransferRun(DeleteTransferRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}"
additional_bindings {
delete: "/v1/{name=projects/*/transferConfigs/*/runs/*}"
}
};
}
// Returns information about running and completed jobs.
rpc ListTransferRuns(ListTransferRunsRequest) returns (ListTransferRunsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs"
additional_bindings {
get: "/v1/{parent=projects/*/transferConfigs/*}/runs"
}
};
}
// Returns user facing log messages for the data transfer run.
rpc ListTransferLogs(ListTransferLogsRequest) returns (ListTransferLogsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs"
additional_bindings {
get: "/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs"
}
};
}
// Returns true if valid credentials exist for the given data source and
// requesting user.
// Some data sources doesn't support service account, so we need to talk to
// them on behalf of the end user. This API just checks whether we have OAuth
// token for the particular user, which is a pre-requisite before user can
// create a transfer config.
rpc CheckValidCreds(CheckValidCredsRequest) returns (CheckValidCredsResponse) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds"
body: "*"
additional_bindings {
post: "/v1/{name=projects/*/dataSources/*}:checkValidCreds"
body: "*"
}
};
}
}
// Represents a data source parameter with validation rules, so that
// parameters can be rendered in the UI. These parameters are given to us by
// supported data sources, and include all needed information for rendering
// and validation.
// Thus, whoever uses this api can decide to generate either generic ui,
// or custom data source specific forms.
message DataSourceParameter {
// Parameter type.
enum Type {
// Type unspecified.
TYPE_UNSPECIFIED = 0;
// String parameter.
STRING = 1;
// Integer parameter (64-bits).
// Will be serialized to json as string.
INTEGER = 2;
// Double precision floating point parameter.
DOUBLE = 3;
// Boolean parameter.
BOOLEAN = 4;
// Record parameter.
RECORD = 5;
// Page ID for a Google+ Page.
PLUS_PAGE = 6;
}
// Parameter identifier.
string param_id = 1;
// Parameter display name in the user interface.
string display_name = 2;
// Parameter description.
string description = 3;
// Parameter type.
Type type = 4;
// Is parameter required.
bool required = 5;
// Can parameter have multiple values.
bool repeated = 6;
// Regular expression which can be used for parameter validation.
string validation_regex = 7;
// All possible values for the parameter.
repeated string allowed_values = 8;
// For integer and double values specifies minimum allowed value.
google.protobuf.DoubleValue min_value = 9;
// For integer and double values specifies maxminum allowed value.
google.protobuf.DoubleValue max_value = 10;
// When parameter is a record, describes child fields.
repeated DataSourceParameter fields = 11;
// Description of the requirements for this field, in case the user input does
// not fulfill the regex pattern or min/max values.
string validation_description = 12;
// URL to a help document to further explain the naming requirements.
string validation_help_url = 13;
// Cannot be changed after initial creation.
bool immutable = 14;
// If set to true, schema should be taken from the parent with the same
// parameter_id. Only applicable when parameter type is RECORD.
bool recurse = 15;
}
// Represents data source metadata. Metadata is sufficient to
// render UI and request proper OAuth tokens.
message DataSource {
// The type of authorization needed for this data source.
enum AuthorizationType {
// Type unspecified.
AUTHORIZATION_TYPE_UNSPECIFIED = 0;
// Use OAuth 2 authorization codes that can be exchanged
// for a refresh token on the backend.
AUTHORIZATION_CODE = 1;
// Return an authorization code for a given Google+ page that can then be
// exchanged for a refresh token on the backend.
GOOGLE_PLUS_AUTHORIZATION_CODE = 2;
}
// Represents how the data source supports data auto refresh.
enum DataRefreshType {
// The data source won't support data auto refresh, which is default value.
DATA_REFRESH_TYPE_UNSPECIFIED = 0;
// The data source supports data auto refresh, and runs will be scheduled
// for the past few days. Does not allow custom values to be set for each
// transfer config.
SLIDING_WINDOW = 1;
// The data source supports data auto refresh, and runs will be scheduled
// for the past few days. Allows custom values to be set for each transfer
// config.
CUSTOM_SLIDING_WINDOW = 2;
}
// Output only. Data source resource name.
string name = 1;
// Data source id.
string data_source_id = 2;
// User friendly data source name.
string display_name = 3;
// User friendly data source description string.
string description = 4;
// Data source client id which should be used to receive refresh token.
// When not supplied, no offline credentials are populated for data transfer.
string client_id = 5;
// Api auth scopes for which refresh token needs to be obtained. Only valid
// when `client_id` is specified. Ignored otherwise. These are scopes needed
// by a data source to prepare data and ingest them into BigQuery,
// e.g., https://www.googleapis.com/auth/bigquery
repeated string scopes = 6;
// Deprecated. This field has no effect.
TransferType transfer_type = 7;
// Indicates whether the data source supports multiple transfers
// to different BigQuery targets.
bool supports_multiple_transfers = 8;
// The number of seconds to wait for an update from the data source
// before BigQuery marks the transfer as failed.
int32 update_deadline_seconds = 9;
// Default data transfer schedule.
// Examples of valid schedules include:
// `1st,3rd monday of month 15:30`,
// `every wed,fri of jan,jun 13:15`, and
// `first sunday of quarter 00:00`.
string default_schedule = 10;
// Specifies whether the data source supports a user defined schedule, or
// operates on the default schedule.
// When set to `true`, user can override default schedule.
bool supports_custom_schedule = 11;
// Data source parameters.
repeated DataSourceParameter parameters = 12;
// Url for the help document for this data source.
string help_url = 13;
// Indicates the type of authorization.
AuthorizationType authorization_type = 14;
// Specifies whether the data source supports automatic data refresh for the
// past few days, and how it's supported.
// For some data sources, data might not be complete until a few days later,
// so it's useful to refresh data automatically.
DataRefreshType data_refresh_type = 15;
// Default data refresh window on days.
// Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`.
int32 default_data_refresh_window_days = 16;
// Disables backfilling and manual run scheduling
// for the data source.
bool manual_runs_disabled = 17;
// The minimum interval for scheduler to schedule runs.
google.protobuf.Duration minimum_schedule_interval = 18;
}
// A request to get data source info.
message GetDataSourceRequest {
// The field will contain name of the resource requested, for example:
// `projects/{project_id}/dataSources/{data_source_id}`
string name = 1;
}
// Request to list supported data sources and their data transfer settings.
message ListDataSourcesRequest {
// The BigQuery project id for which data sources should be returned.
// Must be in the form: `projects/{project_id}`
string parent = 1;
// Pagination token, which can be used to request a specific page
// of `ListDataSourcesRequest` list results. For multiple-page
// results, `ListDataSourcesResponse` outputs
// a `next_page` token, which can be used as the
// `page_token` value to request the next page of list results.
string page_token = 3;
// Page size. The default page size is the maximum value of 1000 results.
int32 page_size = 4;
}
// Returns list of supported data sources and their metadata.
message ListDataSourcesResponse {
// List of supported data sources and their transfer settings.
repeated DataSource data_sources = 1;
// Output only. The next-pagination token. For multiple-page list results,
// this token can be used as the
// `ListDataSourcesRequest.page_token`
// to request the next page of list results.
string next_page_token = 2;
}
// A request to create a data transfer configuration. If new credentials are
// needed for this transfer configuration, an authorization code must be
// provided. If an authorization code is provided, the transfer configuration
// will be associated with the user id corresponding to the
// authorization code. Otherwise, the transfer configuration will be associated
// with the calling user.
message CreateTransferConfigRequest {
// The BigQuery project id where the transfer configuration should be created.
// Must be in the format /projects/{project_id}/locations/{location_id}
// If specified location and location of the destination bigquery dataset
// do not match - the request will fail.
string parent = 1;
// Data transfer configuration to create.
TransferConfig transfer_config = 2;
// Optional OAuth2 authorization code to use with this transfer configuration.
// This is required if new credentials are needed, as indicated by
// `CheckValidCreds`.
// In order to obtain authorization_code, please make a
// request to
// https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=<datatransferapiclientid>&scope=<data_source_scopes>&redirect_uri=<redirect_uri>
//
// * client_id should be OAuth client_id of BigQuery DTS API for the given
// data source returned by ListDataSources method.
// * data_source_scopes are the scopes returned by ListDataSources method.
// * redirect_uri is an optional parameter. If not specified, then
// authorization code is posted to the opener of authorization flow window.
// Otherwise it will be sent to the redirect uri. A special value of
// urn:ietf:wg:oauth:2.0:oob means that authorization code should be
// returned in the title bar of the browser, with the page text prompting
// the user to copy the code and paste it in the application.
string authorization_code = 3;
}
// A request to update a transfer configuration. To update the user id of the
// transfer configuration, an authorization code needs to be provided.
message UpdateTransferConfigRequest {
// Data transfer configuration to create.
TransferConfig transfer_config = 1;
// Optional OAuth2 authorization code to use with this transfer configuration.
// If it is provided, the transfer configuration will be associated with the
// authorizing user.
// In order to obtain authorization_code, please make a
// request to
// https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=<datatransferapiclientid>&scope=<data_source_scopes>&redirect_uri=<redirect_uri>
//
// * client_id should be OAuth client_id of BigQuery DTS API for the given
// data source returned by ListDataSources method.
// * data_source_scopes are the scopes returned by ListDataSources method.
// * redirect_uri is an optional parameter. If not specified, then
// authorization code is posted to the opener of authorization flow window.
// Otherwise it will be sent to the redirect uri. A special value of
// urn:ietf:wg:oauth:2.0:oob means that authorization code should be
// returned in the title bar of the browser, with the page text prompting
// the user to copy the code and paste it in the application.
string authorization_code = 3;
// Required list of fields to be updated in this request.
google.protobuf.FieldMask update_mask = 4;
}
// A request to get data transfer information.
message GetTransferConfigRequest {
// The field will contain name of the resource requested, for example:
// `projects/{project_id}/transferConfigs/{config_id}`
string name = 1;
}
// A request to delete data transfer information. All associated transfer runs
// and log messages will be deleted as well.
message DeleteTransferConfigRequest {
// The field will contain name of the resource requested, for example:
// `projects/{project_id}/transferConfigs/{config_id}`
string name = 1;
}
// A request to get data transfer run information.
message GetTransferRunRequest {
// The field will contain name of the resource requested, for example:
// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
string name = 1;
}
// A request to delete data transfer run information.
message DeleteTransferRunRequest {
// The field will contain name of the resource requested, for example:
// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
string name = 1;
}
// A request to list data transfers configured for a BigQuery project.
message ListTransferConfigsRequest {
// The BigQuery project id for which data sources
// should be returned: `projects/{project_id}`.
string parent = 1;
// When specified, only configurations of requested data sources are returned.
repeated string data_source_ids = 2;
// Pagination token, which can be used to request a specific page
// of `ListTransfersRequest` list results. For multiple-page
// results, `ListTransfersResponse` outputs
// a `next_page` token, which can be used as the
// `page_token` value to request the next page of list results.
string page_token = 3;
// Page size. The default page size is the maximum value of 1000 results.
int32 page_size = 4;
}
// The returned list of pipelines in the project.
message ListTransferConfigsResponse {
// Output only. The stored pipeline transfer configurations.
repeated TransferConfig transfer_configs = 1;
// Output only. The next-pagination token. For multiple-page list results,
// this token can be used as the
// `ListTransferConfigsRequest.page_token`
// to request the next page of list results.
string next_page_token = 2;
}
// A request to list data transfer runs. UI can use this method to show/filter
// specific data transfer runs. The data source can use this method to request
// all scheduled transfer runs.
message ListTransferRunsRequest {
// Represents which runs should be pulled.
enum RunAttempt {
// All runs should be returned.
RUN_ATTEMPT_UNSPECIFIED = 0;
// Only latest run per day should be returned.
LATEST = 1;
}
// Name of transfer configuration for which transfer runs should be retrieved.
// Format of transfer configuration resource name is:
// `projects/{project_id}/transferConfigs/{config_id}`.
string parent = 1;
// When specified, only transfer runs with requested states are returned.
repeated TransferState states = 2;
// Pagination token, which can be used to request a specific page
// of `ListTransferRunsRequest` list results. For multiple-page
// results, `ListTransferRunsResponse` outputs
// a `next_page` token, which can be used as the
// `page_token` value to request the next page of list results.
string page_token = 3;
// Page size. The default page size is the maximum value of 1000 results.
int32 page_size = 4;
// Indicates how run attempts are to be pulled.
RunAttempt run_attempt = 5;
}
// The returned list of pipelines in the project.
message ListTransferRunsResponse {
// Output only. The stored pipeline transfer runs.
repeated TransferRun transfer_runs = 1;
// Output only. The next-pagination token. For multiple-page list results,
// this token can be used as the
// `ListTransferRunsRequest.page_token`
// to request the next page of list results.
string next_page_token = 2;
}
// A request to get user facing log messages associated with data transfer run.
message ListTransferLogsRequest {
// Transfer run name in the form:
// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`.
string parent = 1;
// Pagination token, which can be used to request a specific page
// of `ListTransferLogsRequest` list results. For multiple-page
// results, `ListTransferLogsResponse` outputs
// a `next_page` token, which can be used as the
// `page_token` value to request the next page of list results.
string page_token = 4;
// Page size. The default page size is the maximum value of 1000 results.
int32 page_size = 5;
// Message types to return. If not populated - INFO, WARNING and ERROR
// messages are returned.
repeated TransferMessage.MessageSeverity message_types = 6;
}
// The returned list transfer run messages.
message ListTransferLogsResponse {
// Output only. The stored pipeline transfer messages.
repeated TransferMessage transfer_messages = 1;
// Output only. The next-pagination token. For multiple-page list results,
// this token can be used as the
// `GetTransferRunLogRequest.page_token`
// to request the next page of list results.
string next_page_token = 2;
}
// A request to determine whether the user has valid credentials. This method
// is used to limit the number of OAuth popups in the user interface. The
// user id is inferred from the API call context.
// If the data source has the Google+ authorization type, this method
// returns false, as it cannot be determined whether the credentials are
// already valid merely based on the user id.
message CheckValidCredsRequest {
// The data source in the form:
// `projects/{project_id}/dataSources/{data_source_id}`
string name = 1;
}
// A response indicating whether the credentials exist and are valid.
message CheckValidCredsResponse {
// If set to `true`, the credentials exist and are valid.
bool has_valid_creds = 1;
}
// A request to schedule transfer runs for a time range.
message ScheduleTransferRunsRequest {
// Transfer configuration name in the form:
// `projects/{project_id}/transferConfigs/{config_id}`.
string parent = 1;
// Start time of the range of transfer runs. For example,
// `"2017-05-25T00:00:00+00:00"`.
google.protobuf.Timestamp start_time = 2;
// End time of the range of transfer runs. For example,
// `"2017-05-30T00:00:00+00:00"`.
google.protobuf.Timestamp end_time = 3;
}
// A response to schedule transfer runs for a time range.
message ScheduleTransferRunsResponse {
// The transfer runs that were scheduled.
repeated TransferRun runs = 1;
}

View File

@@ -0,0 +1,222 @@
// Copyright 2018 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.cloud.bigquery.datatransfer.v1;
import "google/api/annotations.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer";
option java_multiple_files = true;
option java_outer_classname = "TransferProto";
option java_package = "com.google.cloud.bigquery.datatransfer.v1";
option objc_class_prefix = "GCBDT";
option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1";
// Represents a data transfer configuration. A transfer configuration
// contains all metadata needed to perform a data transfer. For example,
// `destination_dataset_id` specifies where data should be stored.
// When a new transfer configuration is created, the specified
// `destination_dataset_id` is created when needed and shared with the
// appropriate data source service account.
message TransferConfig {
// The resource name of the transfer config.
// Transfer config names have the form
// `projects/{project_id}/transferConfigs/{config_id}`.
// Where `config_id` is usually a uuid, even though it is not
// guaranteed or required. The name is ignored when creating a transfer
// config.
string name = 1;
// The BigQuery target dataset id.
string destination_dataset_id = 2;
// User specified display name for the data transfer.
string display_name = 3;
// Data source id. Cannot be changed once data transfer is created.
string data_source_id = 5;
// Data transfer specific parameters.
google.protobuf.Struct params = 9;
// Data transfer schedule.
// If the data source does not support a custom schedule, this should be
// empty. If it is empty, the default value for the data source will be
// used.
// The specified times are in UTC.
// Examples of valid format:
// `1st,3rd monday of month 15:30`,
// `every wed,fri of jan,jun 13:15`, and
// `first sunday of quarter 00:00`.
// See more explanation about the format here:
// https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format
// NOTE: the granularity should be at least 8 hours, or less frequent.
string schedule = 7;
// The number of days to look back to automatically refresh the data.
// For example, if `data_refresh_window_days = 10`, then every day
// BigQuery reingests data for [today-10, today-1], rather than ingesting data
// for just [today-1].
// Only valid if the data source supports the feature. Set the value to 0
// to use the default value.
int32 data_refresh_window_days = 12;
// Is this config disabled. When set to true, no runs are scheduled
// for a given transfer.
bool disabled = 13;
// Output only. Data transfer modification time. Ignored by server on input.
google.protobuf.Timestamp update_time = 4;
// Output only. Next time when data transfer will run.
google.protobuf.Timestamp next_run_time = 8;
// Output only. State of the most recently updated transfer run.
TransferState state = 10;
// Output only. Unique ID of the user on whose behalf transfer is done.
// Applicable only to data sources that do not support service accounts.
// When set to 0, the data source service account credentials are used.
// May be negative. Note, that this identifier is not stable.
// It may change over time even for the same user.
int64 user_id = 11;
// Output only. Region in which BigQuery dataset is located.
string dataset_region = 14;
}
// Represents a data transfer run.
message TransferRun {
// The resource name of the transfer run.
// Transfer run names have the form
// `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`.
// The name is ignored when creating a transfer run.
string name = 1;
// Minimum time after which a transfer run can be started.
google.protobuf.Timestamp schedule_time = 3;
// For batch transfer runs, specifies the date and time that
// data should be ingested.
google.protobuf.Timestamp run_time = 10;
// Status of the transfer run.
google.rpc.Status error_status = 21;
// Output only. Time when transfer run was started.
// Parameter ignored by server for input requests.
google.protobuf.Timestamp start_time = 4;
// Output only. Time when transfer run ended.
// Parameter ignored by server for input requests.
google.protobuf.Timestamp end_time = 5;
// Output only. Last time the data transfer run state was updated.
google.protobuf.Timestamp update_time = 6;
// Output only. Data transfer specific parameters.
google.protobuf.Struct params = 9;
// Output only. The BigQuery target dataset id.
string destination_dataset_id = 2;
// Output only. Data source id.
string data_source_id = 7;
// Data transfer run state. Ignored for input requests.
TransferState state = 8;
// Output only. Unique ID of the user on whose behalf transfer is done.
// Applicable only to data sources that do not support service accounts.
// When set to 0, the data source service account credentials are used.
// May be negative. Note, that this identifier is not stable.
// It may change over time even for the same user.
int64 user_id = 11;
// Output only. Describes the schedule of this transfer run if it was
// created as part of a regular schedule. For batch transfer runs that are
// scheduled manually, this is empty.
// NOTE: the system might choose to delay the schedule depending on the
// current load, so `schedule_time` doesn't always matches this.
string schedule = 12;
}
// Represents a user facing message for a particular data transfer run.
message TransferMessage {
// Represents data transfer user facing message severity.
enum MessageSeverity {
// No severity specified.
MESSAGE_SEVERITY_UNSPECIFIED = 0;
// Informational message.
INFO = 1;
// Warning message.
WARNING = 2;
// Error message.
ERROR = 3;
}
// Time when message was logged.
google.protobuf.Timestamp message_time = 1;
// Message severity.
MessageSeverity severity = 2;
// Message text.
string message_text = 3;
}
// DEPRECATED. Represents data transfer type.
enum TransferType {
// Invalid or Unknown transfer type placeholder.
TRANSFER_TYPE_UNSPECIFIED = 0;
// Batch data transfer.
BATCH = 1;
// Streaming data transfer. Streaming data source currently doesn't
// support multiple transfer configs per project.
STREAMING = 2;
}
// Represents data transfer run state.
enum TransferState {
// State placeholder.
TRANSFER_STATE_UNSPECIFIED = 0;
// Data transfer is scheduled and is waiting to be picked up by
// data transfer backend.
PENDING = 2;
// Data transfer is in progress.
RUNNING = 3;
// Data transfer completed successsfully.
SUCCEEDED = 4;
// Data transfer failed.
FAILED = 5;
// Data transfer is cancelled.
CANCELLED = 6;
}

View File

@@ -0,0 +1,525 @@
// Copyright 2017 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.cloud.bigquery.logging.v1;
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/logging/v1;logging";
option java_multiple_files = true;
option java_outer_classname = "AuditDataProto";
option java_package = "com.google.cloud.bigquery.logging.v1";
// BigQuery request and response messages for audit log.
// Note: `Table.schema` has been deprecated in favor of `Table.schemaJson`.
// `Table.schema` may continue to be present in your logs during this
// transition.
message AuditData {
// Request data for each BigQuery method.
oneof request {
// Table insert request.
TableInsertRequest table_insert_request = 1;
// Table update request.
TableUpdateRequest table_update_request = 16;
// Dataset list request.
DatasetListRequest dataset_list_request = 2;
// Dataset insert request.
DatasetInsertRequest dataset_insert_request = 3;
// Dataset update request.
DatasetUpdateRequest dataset_update_request = 4;
// Job insert request.
JobInsertRequest job_insert_request = 5;
// Job query request.
JobQueryRequest job_query_request = 6;
// Job get query results request.
JobGetQueryResultsRequest job_get_query_results_request = 7;
// Table data-list request.
TableDataListRequest table_data_list_request = 8;
}
// Response data for each BigQuery method.
oneof response {
// Table insert response.
TableInsertResponse table_insert_response = 9;
// Table update response.
TableUpdateResponse table_update_response = 10;
// Dataset insert response.
DatasetInsertResponse dataset_insert_response = 11;
// Dataset update response.
DatasetUpdateResponse dataset_update_response = 12;
// Job insert response.
JobInsertResponse job_insert_response = 18;
// Job query response.
JobQueryResponse job_query_response = 13;
// Job get query results response.
JobGetQueryResultsResponse job_get_query_results_response = 14;
// Deprecated: Job query-done response. Use this information for usage
// analysis.
JobQueryDoneResponse job_query_done_response = 15;
}
// A job completion event.
JobCompletedEvent job_completed_event = 17;
}
// Table insert request.
message TableInsertRequest {
// The new table.
Table resource = 1;
}
// Table update request.
message TableUpdateRequest {
// The table to be updated.
Table resource = 1;
}
// Table insert response.
message TableInsertResponse {
// Final state of the inserted table.
Table resource = 1;
}
// Table update response.
message TableUpdateResponse {
// Final state of the updated table.
Table resource = 1;
}
// Dataset list request.
message DatasetListRequest {
// Whether to list all datasets, including hidden ones.
bool list_all = 1;
}
// Dataset insert request.
message DatasetInsertRequest {
// The dataset to be inserted.
Dataset resource = 1;
}
// Dataset insert response.
message DatasetInsertResponse {
// Final state of the inserted dataset.
Dataset resource = 1;
}
// Dataset update request.
message DatasetUpdateRequest {
// The dataset to be updated.
Dataset resource = 1;
}
// Dataset update response.
message DatasetUpdateResponse {
// Final state of the updated dataset.
Dataset resource = 1;
}
// Job insert request.
message JobInsertRequest {
// Job insert request.
Job resource = 1;
}
// Job insert response.
message JobInsertResponse {
// Job insert response.
Job resource = 1;
}
// Job query request.
message JobQueryRequest {
// The query.
string query = 1;
// The maximum number of results.
uint32 max_results = 2;
// The default dataset for tables that do not have a dataset specified.
DatasetName default_dataset = 3;
// Project that the query should be charged to.
string project_id = 4;
// If true, don't actually run the job. Just check that it would run.
bool dry_run = 5;
}
// Job query response.
message JobQueryResponse {
// The total number of rows in the full query result set.
uint64 total_results = 1;
// Information about the queried job.
Job job = 2;
}
// Job getQueryResults request.
message JobGetQueryResultsRequest {
// Maximum number of results to return.
uint32 max_results = 1;
// Zero-based row number at which to start.
uint64 start_row = 2;
}
// Job getQueryResults response.
message JobGetQueryResultsResponse {
// Total number of results in query results.
uint64 total_results = 1;
// The job that was created to run the query.
// It completed if `job.status.state` is `DONE`.
// It failed if `job.status.errorResult` is also present.
Job job = 2;
}
// Job getQueryDone response.
message JobQueryDoneResponse {
// The job and status information.
// The job completed if `job.status.state` is `DONE`.
Job job = 1;
}
// Query job completed event.
message JobCompletedEvent {
// Name of the event.
string event_name = 1;
// Job information.
Job job = 2;
}
// Table data-list request.
message TableDataListRequest {
// Starting row offset.
uint64 start_row = 1;
// Maximum number of results to return.
uint32 max_results = 2;
}
// Describes a BigQuery table.
// See the [Table](/bigquery/docs/reference/v2/tables) API resource
// for more details on individual fields.
// Note: `Table.schema` has been deprecated in favor of `Table.schemaJson`.
// `Table.schema` may continue to be present in your logs during this
// transition.
message Table {
// The name of the table.
TableName table_name = 1;
// User-provided metadata for the table.
TableInfo info = 2;
// A JSON representation of the table's schema.
string schema_json = 8;
// If present, this is a virtual table defined by a SQL query.
TableViewDefinition view = 4;
// The expiration date for the table, after which the table
// is deleted and the storage reclaimed.
// If not present, the table persists indefinitely.
google.protobuf.Timestamp expire_time = 5;
// The time the table was created.
google.protobuf.Timestamp create_time = 6;
// The time the table was last truncated
// by an operation with a `writeDisposition` of `WRITE_TRUNCATE`.
google.protobuf.Timestamp truncate_time = 7;
}
// User-provided metadata for a table.
message TableInfo {
// A short name for the table, such as`"Analytics Data - Jan 2011"`.
string friendly_name = 1;
// A long description, perhaps several paragraphs,
// describing the table contents in detail.
string description = 2;
}
// Describes a virtual table defined by a SQL query.
message TableViewDefinition {
// SQL query defining the view.
string query = 1;
}
// BigQuery dataset information.
// See the [Dataset](/bigquery/docs/reference/v2/datasets) API resource
// for more details on individual fields.
message Dataset {
// The name of the dataset.
DatasetName dataset_name = 1;
// User-provided metadata for the dataset.
DatasetInfo info = 2;
// The time the dataset was created.
google.protobuf.Timestamp create_time = 4;
// The time the dataset was last modified.
google.protobuf.Timestamp update_time = 5;
// The access control list for the dataset.
BigQueryAcl acl = 6;
// If this field is present, each table that does not specify an
// expiration time is assigned an expiration time by adding this
// duration to the table's `createTime`. If this field is empty,
// there is no default table expiration time.
google.protobuf.Duration default_table_expire_duration = 8;
}
// User-provided metadata for a dataset.
message DatasetInfo {
// A short name for the dataset, such as`"Analytics Data 2011"`.
string friendly_name = 1;
// A long description, perhaps several paragraphs,
// describing the dataset contents in detail.
string description = 2;
}
// An access control list.
message BigQueryAcl {
// Access control entry.
message Entry {
// The granted role, which can be `READER`, `WRITER`, or `OWNER`.
string role = 1;
// Grants access to a group identified by an email address.
string group_email = 2;
// Grants access to a user identified by an email address.
string user_email = 3;
// Grants access to all members of a domain.
string domain = 4;
// Grants access to special groups. Valid groups are `PROJECT_OWNERS`,
// `PROJECT_READERS`, `PROJECT_WRITERS` and `ALL_AUTHENTICATED_USERS`.
string special_group = 5;
// Grants access to a BigQuery View.
TableName view_name = 6;
}
// Access control entry list.
repeated Entry entries = 1;
}
// Describes a job.
message Job {
// Job name.
JobName job_name = 1;
// Job configuration.
JobConfiguration job_configuration = 2;
// Job status.
JobStatus job_status = 3;
// Job statistics.
JobStatistics job_statistics = 4;
}
// Job configuration information.
// See the [Jobs](/bigquery/docs/reference/v2/jobs) API resource
// for more details on individual fields.
message JobConfiguration {
// Describes a query job, which executes a SQL-like query.
message Query {
// The SQL query to run.
string query = 1;
// The table where results are written.
TableName destination_table = 2;
// Describes when a job is allowed to create a table:
// `CREATE_IF_NEEDED`, `CREATE_NEVER`.
string create_disposition = 3;
// Describes how writes affect existing tables:
// `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`.
string write_disposition = 4;
// If a table name is specified without a dataset in a query,
// this dataset will be added to table name.
DatasetName default_dataset = 5;
// Describes data sources outside BigQuery, if needed.
repeated TableDefinition table_definitions = 6;
}
// Describes a load job, which loads data from an external source via
// the import pipeline.
message Load {
// URIs for the data to be imported. Only Google Cloud Storage URIs are
// supported.
repeated string source_uris = 1;
// The table schema in JSON format representation of a TableSchema.
string schema_json = 6;
// The table where the imported data is written.
TableName destination_table = 3;
// Describes when a job is allowed to create a table:
// `CREATE_IF_NEEDED`, `CREATE_NEVER`.
string create_disposition = 4;
// Describes how writes affect existing tables:
// `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`.
string write_disposition = 5;
}
// Describes an extract job, which exports data to an external source
// via the export pipeline.
message Extract {
// Google Cloud Storage URIs where extracted data should be written.
repeated string destination_uris = 1;
// The source table.
TableName source_table = 2;
}
// Describes a copy job, which copies an existing table to another table.
message TableCopy {
// Source tables.
repeated TableName source_tables = 1;
// Destination table.
TableName destination_table = 2;
// Describes when a job is allowed to create a table:
// `CREATE_IF_NEEDED`, `CREATE_NEVER`.
string create_disposition = 3;
// Describes how writes affect existing tables:
// `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`.
string write_disposition = 4;
}
// Job configuration information.
oneof configuration {
// Query job information.
Query query = 5;
// Load job information.
Load load = 6;
// Extract job information.
Extract extract = 7;
// TableCopy job information.
TableCopy table_copy = 8;
}
// If true, don't actually run the job. Just check that it would run.
bool dry_run = 9;
}
// Describes an external data source used in a query.
message TableDefinition {
// Name of the table, used in queries.
string name = 1;
// Google Cloud Storage URIs for the data to be imported.
repeated string source_uris = 2;
}
// Running state of a job.
message JobStatus {
// State of a job: `PENDING`, `RUNNING`, or `DONE`.
string state = 1;
// If the job did not complete successfully, this field describes why.
google.rpc.Status error = 2;
}
// Job statistics that may change after a job starts.
message JobStatistics {
// Time when the job was created.
google.protobuf.Timestamp create_time = 1;
// Time when the job started.
google.protobuf.Timestamp start_time = 2;
// Time when the job ended.
google.protobuf.Timestamp end_time = 3;
// Total bytes processed for a job.
int64 total_processed_bytes = 4;
// Processed bytes, adjusted by the job's CPU usage.
int64 total_billed_bytes = 5;
// The tier assigned by CPU-based billing.
int32 billing_tier = 7;
}
// The fully-qualified name for a dataset.
message DatasetName {
// The project ID.
string project_id = 1;
// The dataset ID within the project.
string dataset_id = 2;
}
// The fully-qualified name for a table.
message TableName {
// The project ID.
string project_id = 1;
// The dataset ID within the project.
string dataset_id = 2;
// The table ID of the table within the dataset.
string table_id = 3;
}
// The fully-qualified name for a job.
message JobName {
// The project ID.
string project_id = 1;
// The job ID within the project.
string job_id = 2;
}

View File

@@ -0,0 +1,214 @@
// 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.cloud.billing.v1;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/billing/v1;billing";
option java_multiple_files = true;
option java_outer_classname = "CloudBillingProto";
option java_package = "com.google.cloud.billing.v1";
// Retrieves Google Cloud Console billing accounts and associates them with
// projects.
service CloudBilling {
// Gets information about a billing account. The current authenticated user
// must be an [owner of the billing
// account](https://support.google.com/cloud/answer/4430947).
rpc GetBillingAccount(GetBillingAccountRequest) returns (BillingAccount) {
option (google.api.http) = { get: "/v1/{name=billingAccounts/*}" };
}
// Lists the billing accounts that the current authenticated user
// [owns](https://support.google.com/cloud/answer/4430947).
rpc ListBillingAccounts(ListBillingAccountsRequest) returns (ListBillingAccountsResponse) {
option (google.api.http) = { get: "/v1/billingAccounts" };
}
// Lists the projects associated with a billing account. The current
// authenticated user must be an [owner of the billing
// account](https://support.google.com/cloud/answer/4430947).
rpc ListProjectBillingInfo(ListProjectBillingInfoRequest) returns (ListProjectBillingInfoResponse) {
option (google.api.http) = { get: "/v1/{name=billingAccounts/*}/projects" };
}
// Gets the billing information for a project. The current authenticated user
// must have [permission to view the
// project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo
// ).
rpc GetProjectBillingInfo(GetProjectBillingInfoRequest) returns (ProjectBillingInfo) {
option (google.api.http) = { get: "/v1/{name=projects/*}/billingInfo" };
}
// Sets or updates the billing account associated with a project. You specify
// the new billing account by setting the `billing_account_name` in the
// `ProjectBillingInfo` resource to the resource name of a billing account.
// Associating a project with an open billing account enables billing on the
// project and allows charges for resource usage. If the project already had a
// billing account, this method changes the billing account used for resource
// usage charges.
//
// *Note:* Incurred charges that have not yet been reported in the transaction
// history of the Google Cloud Console may be billed to the new billing
// account, even if the charge occurred before the new billing account was
// assigned to the project.
//
// The current authenticated user must have ownership privileges for both the
// [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo
// ) and the [billing
// account](https://support.google.com/cloud/answer/4430947).
//
// You can disable billing on the project by setting the
// `billing_account_name` field to empty. This action disassociates the
// current billing account from the project. Any billable activity of your
// in-use services will stop, and your application could stop functioning as
// expected. Any unbilled charges to date will be billed to the previously
// associated account. The current authenticated user must be either an owner
// of the project or an owner of the billing account for the project.
//
// Note that associating a project with a *closed* billing account will have
// much the same effect as disabling billing on the project: any paid
// resources used by the project will be shut down. Thus, unless you wish to
// disable billing, you should always call this method with the name of an
// *open* billing account.
rpc UpdateProjectBillingInfo(UpdateProjectBillingInfoRequest) returns (ProjectBillingInfo) {
option (google.api.http) = { put: "/v1/{name=projects/*}/billingInfo" body: "project_billing_info" };
}
}
// A billing account in [Google Cloud
// Console](https://console.cloud.google.com/). You can assign a billing account
// to one or more projects.
message BillingAccount {
// The resource name of the billing account. The resource name has the form
// `billingAccounts/{billing_account_id}`. For example,
// `billingAccounts/012345-567890-ABCDEF` would be the resource name for
// billing account `012345-567890-ABCDEF`.
string name = 1;
// True if the billing account is open, and will therefore be charged for any
// usage on associated projects. False if the billing account is closed, and
// therefore projects associated with it will be unable to use paid services.
bool open = 2;
// The display name given to the billing account, such as `My Billing
// Account`. This name is displayed in the Google Cloud Console.
string display_name = 3;
}
// Encapsulation of billing information for a Cloud Console project. A project
// has at most one associated billing account at a time (but a billing account
// can be assigned to multiple projects).
message ProjectBillingInfo {
// The resource name for the `ProjectBillingInfo`; has the form
// `projects/{project_id}/billingInfo`. For example, the resource name for the
// billing information for project `tokyo-rain-123` would be
// `projects/tokyo-rain-123/billingInfo`. This field is read-only.
string name = 1;
// The ID of the project that this `ProjectBillingInfo` represents, such as
// `tokyo-rain-123`. This is a convenience field so that you don't need to
// parse the `name` field to obtain a project ID. This field is read-only.
string project_id = 2;
// The resource name of the billing account associated with the project, if
// any. For example, `billingAccounts/012345-567890-ABCDEF`.
string billing_account_name = 3;
// True if the project is associated with an open billing account, to which
// usage on the project is charged. False if the project is associated with a
// closed billing account, or no billing account at all, and therefore cannot
// use paid services. This field is read-only.
bool billing_enabled = 4;
}
// Request message for `GetBillingAccount`.
message GetBillingAccountRequest {
// The resource name of the billing account to retrieve. For example,
// `billingAccounts/012345-567890-ABCDEF`.
string name = 1;
}
// Request message for `ListBillingAccounts`.
message ListBillingAccountsRequest {
// Requested page size. The maximum page size is 100; this is also the
// default.
int32 page_size = 1;
// A token identifying a page of results to return. This should be a
// `next_page_token` value returned from a previous `ListBillingAccounts`
// call. If unspecified, the first page of results is returned.
string page_token = 2;
}
// Response message for `ListBillingAccounts`.
message ListBillingAccountsResponse {
// A list of billing accounts.
repeated BillingAccount billing_accounts = 1;
// A token to retrieve the next page of results. To retrieve the next page,
// call `ListBillingAccounts` again with the `page_token` field set to this
// value. This field is empty if there are no more results to retrieve.
string next_page_token = 2;
}
// Request message for `ListProjectBillingInfo`.
message ListProjectBillingInfoRequest {
// The resource name of the billing account associated with the projects that
// you want to list. For example, `billingAccounts/012345-567890-ABCDEF`.
string name = 1;
// Requested page size. The maximum page size is 100; this is also the
// default.
int32 page_size = 2;
// A token identifying a page of results to be returned. This should be a
// `next_page_token` value returned from a previous `ListProjectBillingInfo`
// call. If unspecified, the first page of results is returned.
string page_token = 3;
}
// Request message for `ListProjectBillingInfoResponse`.
message ListProjectBillingInfoResponse {
// A list of `ProjectBillingInfo` resources representing the projects
// associated with the billing account.
repeated ProjectBillingInfo project_billing_info = 1;
// A token to retrieve the next page of results. To retrieve the next page,
// call `ListProjectBillingInfo` again with the `page_token` field set to this
// value. This field is empty if there are no more results to retrieve.
string next_page_token = 2;
}
// Request message for `GetProjectBillingInfo`.
message GetProjectBillingInfoRequest {
// The resource name of the project for which billing information is
// retrieved. For example, `projects/tokyo-rain-123`.
string name = 1;
}
// Request message for `UpdateProjectBillingInfo`.
message UpdateProjectBillingInfoRequest {
// The resource name of the project associated with the billing information
// that you want to update. For example, `projects/tokyo-rain-123`.
string name = 1;
// The new billing information for the project. Read-only fields are ignored;
// thus, you may leave empty all fields except `billing_account_name`.
ProjectBillingInfo project_billing_info = 2;
}

View File

@@ -0,0 +1,597 @@
// Copyright 2017 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.cloud.dataproc.v1;
import "google/api/annotations.proto";
import "google/cloud/dataproc/v1/operations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1;dataproc";
option java_multiple_files = true;
option java_outer_classname = "ClustersProto";
option java_package = "com.google.cloud.dataproc.v1";
// The ClusterControllerService provides methods to manage clusters
// of Google Compute Engine instances.
service ClusterController {
// Creates a cluster in a project.
rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/projects/{project_id}/regions/{region}/clusters" body: "cluster" };
}
// Updates a cluster in a project.
rpc UpdateCluster(UpdateClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { patch: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" body: "cluster" };
}
// Deletes a cluster in a project.
rpc DeleteCluster(DeleteClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { delete: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" };
}
// Gets the resource representation for a cluster in a project.
rpc GetCluster(GetClusterRequest) returns (Cluster) {
option (google.api.http) = { get: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" };
}
// Lists all regions/{region}/clusters in a project.
rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
option (google.api.http) = { get: "/v1/projects/{project_id}/regions/{region}/clusters" };
}
// Gets cluster diagnostic information.
// After the operation completes, the Operation.response field
// contains `DiagnoseClusterOutputLocation`.
rpc DiagnoseCluster(DiagnoseClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose" body: "*" };
}
}
// Describes the identifying information, config, and status of
// a cluster of Google Compute Engine instances.
message Cluster {
// Required. The Google Cloud Platform project ID that the cluster belongs to.
string project_id = 1;
// Required. The cluster name. Cluster names within a project must be
// unique. Names of deleted clusters can be reused.
string cluster_name = 2;
// Required. The cluster config. Note that Cloud Dataproc may set
// default values, and values may change when clusters are updated.
ClusterConfig config = 3;
// Optional. The labels to associate with this cluster.
// Label **keys** must contain 1 to 63 characters, and must conform to
// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
// Label **values** may be empty, but, if present, must contain 1 to 63
// characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
// No more than 32 labels can be associated with a cluster.
map<string, string> labels = 8;
// Output-only. Cluster status.
ClusterStatus status = 4;
// Output-only. The previous cluster status.
repeated ClusterStatus status_history = 7;
// Output-only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc
// generates this value when it creates the cluster.
string cluster_uuid = 6;
// Contains cluster daemon metrics such as HDFS and YARN stats.
//
// **Beta Feature**: This report is available for testing purposes only. It may
// be changed before final release.
ClusterMetrics metrics = 9;
}
// The cluster config.
message ClusterConfig {
// Optional. A Google Cloud Storage staging bucket used for sharing generated
// SSH keys and config. If you do not specify a staging bucket, Cloud
// Dataproc will determine an appropriate Cloud Storage location (US,
// ASIA, or EU) for your cluster's staging bucket according to the Google
// Compute Engine zone where your cluster is deployed, and then it will create
// and manage this project-level, per-location bucket for you.
string config_bucket = 1;
// Required. The shared Google Compute Engine config settings for
// all instances in a cluster.
GceClusterConfig gce_cluster_config = 8;
// Optional. The Google Compute Engine config settings for
// the master instance in a cluster.
InstanceGroupConfig master_config = 9;
// Optional. The Google Compute Engine config settings for
// worker instances in a cluster.
InstanceGroupConfig worker_config = 10;
// Optional. The Google Compute Engine config settings for
// additional worker instances in a cluster.
InstanceGroupConfig secondary_worker_config = 12;
// Optional. The config settings for software inside the cluster.
SoftwareConfig software_config = 13;
// Optional. Commands to execute on each node after config is
// completed. By default, executables are run on master and all worker nodes.
// You can test a node's `role` metadata to run an executable on
// a master or worker node, as shown below using `curl` (you can also use `wget`):
//
// ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
// if [[ "${ROLE}" == 'Master' ]]; then
// ... master specific actions ...
// else
// ... worker specific actions ...
// fi
repeated NodeInitializationAction initialization_actions = 11;
}
// Common config settings for resources of Google Compute Engine cluster
// instances, applicable to all instances in the cluster.
message GceClusterConfig {
// Optional. The zone where the Google Compute Engine cluster will be located.
// On a create request, it is required in the "global" region. If omitted
// in a non-global Cloud Dataproc region, the service will pick a zone in the
// corresponding Compute Engine region. On a get request, zone will
// always be present.
//
// A full URL, partial URI, or short name are valid. Examples:
//
// * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
// * `projects/[project_id]/zones/[zone]`
// * `us-central1-f`
string zone_uri = 1;
// Optional. The Google Compute Engine network to be used for machine
// communications. Cannot be specified with subnetwork_uri. If neither
// `network_uri` nor `subnetwork_uri` is specified, the "default" network of
// the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
// [Using Subnetworks](/compute/docs/subnetworks) for more information).
//
// A full URL, partial URI, or short name are valid. Examples:
//
// * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
// * `projects/[project_id]/regions/global/default`
// * `default`
string network_uri = 2;
// Optional. The Google Compute Engine subnetwork to be used for machine
// communications. Cannot be specified with network_uri.
//
// A full URL, partial URI, or short name are valid. Examples:
//
// * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
// * `projects/[project_id]/regions/us-east1/sub0`
// * `sub0`
string subnetwork_uri = 6;
// Optional. If true, all instances in the cluster will only have internal IP
// addresses. By default, clusters are not restricted to internal IP addresses,
// and will have ephemeral external IP addresses assigned to each instance.
// This `internal_ip_only` restriction can only be enabled for subnetwork
// enabled networks, and all off-cluster dependencies must be configured to be
// accessible without external IP addresses.
bool internal_ip_only = 7;
// Optional. The service account of the instances. Defaults to the default
// Google Compute Engine service account. Custom service accounts need
// permissions equivalent to the folloing IAM roles:
//
// * roles/logging.logWriter
// * roles/storage.objectAdmin
//
// (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
// for more information).
// Example: `[account_id]@[project_id].iam.gserviceaccount.com`
string service_account = 8;
// Optional. The URIs of service account scopes to be included in Google
// Compute Engine instances. The following base set of scopes is always
// included:
//
// * https://www.googleapis.com/auth/cloud.useraccounts.readonly
// * https://www.googleapis.com/auth/devstorage.read_write
// * https://www.googleapis.com/auth/logging.write
//
// If no scopes are specified, the following defaults are also provided:
//
// * https://www.googleapis.com/auth/bigquery
// * https://www.googleapis.com/auth/bigtable.admin.table
// * https://www.googleapis.com/auth/bigtable.data
// * https://www.googleapis.com/auth/devstorage.full_control
repeated string service_account_scopes = 3;
// The Google Compute Engine tags to add to all instances (see
// [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
repeated string tags = 4;
// The Google Compute Engine metadata entries to add to all instances (see
// [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
map<string, string> metadata = 5;
}
// Optional. The config settings for Google Compute Engine resources in
// an instance group, such as a master or worker group.
message InstanceGroupConfig {
// Optional. The number of VM instances in the instance group.
// For master instance groups, must be set to 1.
int32 num_instances = 1;
// Optional. The list of instance names. Cloud Dataproc derives the names from
// `cluster_name`, `num_instances`, and the instance group if not set by user
// (recommended practice is to let Cloud Dataproc derive the name).
repeated string instance_names = 2;
// Output-only. The Google Compute Engine image resource used for cluster
// instances. Inferred from `SoftwareConfig.image_version`.
string image_uri = 3;
// Optional. The Google Compute Engine machine type used for cluster instances.
//
// A full URL, partial URI, or short name are valid. Examples:
//
// * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2`
// * `projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2`
// * `n1-standard-2`
string machine_type_uri = 4;
// Optional. Disk option config settings.
DiskConfig disk_config = 5;
// Optional. Specifies that this instance group contains preemptible instances.
bool is_preemptible = 6;
// Output-only. The config for Google Compute Engine Instance Group
// Manager that manages this group.
// This is only used for preemptible instance groups.
ManagedGroupConfig managed_group_config = 7;
// Optional. The Google Compute Engine accelerator configuration for these
// instances.
//
// **Beta Feature**: This feature is still under development. It may be
// changed before final release.
repeated AcceleratorConfig accelerators = 8;
}
// Specifies the resources used to actively manage an instance group.
message ManagedGroupConfig {
// Output-only. The name of the Instance Template used for the Managed
// Instance Group.
string instance_template_name = 1;
// Output-only. The name of the Instance Group Manager for this group.
string instance_group_manager_name = 2;
}
// Specifies the type and number of accelerator cards attached to the instances
// of an instance group (see [GPUs on Compute Engine](/compute/docs/gpus/)).
message AcceleratorConfig {
// Full URL, partial URI, or short name of the accelerator type resource to
// expose to this instance. See [Google Compute Engine AcceleratorTypes](
// /compute/docs/reference/beta/acceleratorTypes)
//
// Examples
// * `https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80`
// * `projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80`
// * `nvidia-tesla-k80`
string accelerator_type_uri = 1;
// The number of the accelerator cards of this type exposed to this instance.
int32 accelerator_count = 2;
}
// Specifies the config of disk options for a group of VM instances.
message DiskConfig {
// Optional. Size in GB of the boot disk (default is 500GB).
int32 boot_disk_size_gb = 1;
// Optional. Number of attached SSDs, from 0 to 4 (default is 0).
// If SSDs are not attached, the boot disk is used to store runtime logs and
// [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data.
// If one or more SSDs are attached, this runtime bulk
// data is spread across them, and the boot disk contains only basic
// config and installed binaries.
int32 num_local_ssds = 2;
}
// Specifies an executable to run on a fully configured node and a
// timeout period for executable completion.
message NodeInitializationAction {
// Required. Google Cloud Storage URI of executable file.
string executable_file = 1;
// Optional. Amount of time executable has to complete. Default is
// 10 minutes. Cluster creation fails with an explanatory error message (the
// name of the executable that caused the error and the exceeded timeout
// period) if the executable is not completed at end of the timeout period.
google.protobuf.Duration execution_timeout = 2;
}
// The status of a cluster and its instances.
message ClusterStatus {
// The cluster state.
enum State {
// The cluster state is unknown.
UNKNOWN = 0;
// The cluster is being created and set up. It is not ready for use.
CREATING = 1;
// The cluster is currently running and healthy. It is ready for use.
RUNNING = 2;
// The cluster encountered an error. It is not ready for use.
ERROR = 3;
// The cluster is being deleted. It cannot be used.
DELETING = 4;
// The cluster is being updated. It continues to accept and process jobs.
UPDATING = 5;
}
enum Substate {
UNSPECIFIED = 0;
// The cluster is known to be in an unhealthy state
// (for example, critical daemons are not running or HDFS capacity is
// exhausted).
//
// Applies to RUNNING state.
UNHEALTHY = 1;
// The agent-reported status is out of date (may occur if
// Cloud Dataproc loses communication with Agent).
//
// Applies to RUNNING state.
STALE_STATUS = 2;
}
// Output-only. The cluster's state.
State state = 1;
// Output-only. Optional details of cluster's state.
string detail = 2;
// Output-only. Time when this state was entered.
google.protobuf.Timestamp state_start_time = 3;
// Output-only. Additional state information that includes
// status reported by the agent.
Substate substate = 4;
}
// Specifies the selection and config of software inside the cluster.
message SoftwareConfig {
// Optional. The version of software inside the cluster. It must match the
// regular expression `[0-9]+\.[0-9]+`. If unspecified, it defaults to the
// latest version (see [Cloud Dataproc Versioning](/dataproc/versioning)).
string image_version = 1;
// Optional. The properties to set on daemon config files.
//
// Property keys are specified in `prefix:property` format, such as
// `core:fs.defaultFS`. The following are supported prefixes
// and their mappings:
//
// * capacity-scheduler: `capacity-scheduler.xml`
// * core: `core-site.xml`
// * distcp: `distcp-default.xml`
// * hdfs: `hdfs-site.xml`
// * hive: `hive-site.xml`
// * mapred: `mapred-site.xml`
// * pig: `pig.properties`
// * spark: `spark-defaults.conf`
// * yarn: `yarn-site.xml`
//
// For more information, see
// [Cluster properties](/dataproc/docs/concepts/cluster-properties).
map<string, string> properties = 2;
}
// Contains cluster daemon metrics, such as HDFS and YARN stats.
//
// **Beta Feature**: This report is available for testing purposes only. It may
// be changed before final release.
message ClusterMetrics {
// The HDFS metrics.
map<string, int64> hdfs_metrics = 1;
// The YARN metrics.
map<string, int64> yarn_metrics = 2;
}
// A request to create a cluster.
message CreateClusterRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The cluster to create.
Cluster cluster = 2;
}
// A request to update a cluster.
message UpdateClusterRequest {
// Required. The ID of the Google Cloud Platform project the
// cluster belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 5;
// Required. The cluster name.
string cluster_name = 2;
// Required. The changes to the cluster.
Cluster cluster = 3;
// Required. Specifies the path, relative to `Cluster`, of
// the field to update. For example, to change the number of workers
// in a cluster to 5, the `update_mask` parameter would be
// specified as `config.worker_config.num_instances`,
// and the `PATCH` request body would specify the new value, as follows:
//
// {
// "config":{
// "workerConfig":{
// "numInstances":"5"
// }
// }
// }
// Similarly, to change the number of preemptible workers in a cluster to 5,
// the `update_mask` parameter would be
// `config.secondary_worker_config.num_instances`, and the `PATCH` request
// body would be set as follows:
//
// {
// "config":{
// "secondaryWorkerConfig":{
// "numInstances":"5"
// }
// }
// }
// <strong>Note:</strong> Currently, only the following fields can be updated:
//
// <table>
// <tbody>
// <tr>
// <td><strong>Mask</strong></td>
// <td><strong>Purpose</strong></td>
// </tr>
// <tr>
// <td><strong><em>labels</em></strong></td>
// <td>Update labels</td>
// </tr>
// <tr>
// <td><strong><em>config.worker_config.num_instances</em></strong></td>
// <td>Resize primary worker group</td>
// </tr>
// <tr>
// <td><strong><em>config.secondary_worker_config.num_instances</em></strong></td>
// <td>Resize secondary worker group</td>
// </tr>
// </tbody>
// </table>
google.protobuf.FieldMask update_mask = 4;
}
// A request to delete a cluster.
message DeleteClusterRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The cluster name.
string cluster_name = 2;
}
// Request to get the resource representation for a cluster in a project.
message GetClusterRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The cluster name.
string cluster_name = 2;
}
// A request to list the clusters in a project.
message ListClustersRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 4;
// Optional. A filter constraining the clusters to list. Filters are
// case-sensitive and have the following syntax:
//
// field = value [AND [field = value]] ...
//
// where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`,
// and `[KEY]` is a label key. **value** can be `*` to match all values.
// `status.state` can be one of the following: `ACTIVE`, `INACTIVE`,
// `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE`
// contains the `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE`
// contains the `DELETING` and `ERROR` states.
// `clusterName` is the name of the cluster provided at creation time.
// Only the logical `AND` operator is supported; space-separated items are
// treated as having an implicit `AND` operator.
//
// Example filter:
//
// status.state = ACTIVE AND clusterName = mycluster
// AND labels.env = staging AND labels.starred = *
string filter = 5;
// Optional. The standard List page size.
int32 page_size = 2;
// Optional. The standard List page token.
string page_token = 3;
}
// The list of all clusters in a project.
message ListClustersResponse {
// Output-only. The clusters in the project.
repeated Cluster clusters = 1;
// Output-only. This token is included in the response if there are more
// results to fetch. To fetch additional results, provide this value as the
// `page_token` in a subsequent `ListClustersRequest`.
string next_page_token = 2;
}
// A request to collect cluster diagnostic information.
message DiagnoseClusterRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The cluster name.
string cluster_name = 2;
}
// The location of diagnostic output.
message DiagnoseClusterResults {
// Output-only. The Google Cloud Storage URI of the diagnostic output.
// The output report is a plain text file with a summary of collected
// diagnostics.
string output_uri = 1;
}

View File

@@ -0,0 +1,740 @@
// Copyright 2017 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.cloud.dataproc.v1;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1;dataproc";
option java_multiple_files = true;
option java_outer_classname = "JobsProto";
option java_package = "com.google.cloud.dataproc.v1";
// The JobController provides methods to manage jobs.
service JobController {
// Submits a job to a cluster.
rpc SubmitJob(SubmitJobRequest) returns (Job) {
option (google.api.http) = { post: "/v1/projects/{project_id}/regions/{region}/jobs:submit" body: "*" };
}
// Gets the resource representation for a job in a project.
rpc GetJob(GetJobRequest) returns (Job) {
option (google.api.http) = { get: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" };
}
// Lists regions/{region}/jobs in a project.
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
option (google.api.http) = { get: "/v1/projects/{project_id}/regions/{region}/jobs" };
}
// Updates a job in a project.
rpc UpdateJob(UpdateJobRequest) returns (Job) {
option (google.api.http) = { patch: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" body: "job" };
}
// Starts a job cancellation request. To access the job resource
// after cancellation, call
// [regions/{region}/jobs.list](/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or
// [regions/{region}/jobs.get](/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
rpc CancelJob(CancelJobRequest) returns (Job) {
option (google.api.http) = { post: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel" body: "*" };
}
// Deletes the job from the project. If the job is active, the delete fails,
// and the response returns `FAILED_PRECONDITION`.
rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" };
}
}
// The runtime logging config of the job.
message LoggingConfig {
// The Log4j level for job execution. When running an
// [Apache Hive](http://hive.apache.org/) job, Cloud
// Dataproc configures the Hive client to an equivalent verbosity level.
enum Level {
// Level is unspecified. Use default level for log4j.
LEVEL_UNSPECIFIED = 0;
// Use ALL level for log4j.
ALL = 1;
// Use TRACE level for log4j.
TRACE = 2;
// Use DEBUG level for log4j.
DEBUG = 3;
// Use INFO level for log4j.
INFO = 4;
// Use WARN level for log4j.
WARN = 5;
// Use ERROR level for log4j.
ERROR = 6;
// Use FATAL level for log4j.
FATAL = 7;
// Turn off log4j.
OFF = 8;
}
// The per-package log levels for the driver. This may include
// "root" package name to configure rootLogger.
// Examples:
// 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'
map<string, Level> driver_log_levels = 2;
}
// A Cloud Dataproc job for running
// [Apache Hadoop MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html)
// jobs on [Apache Hadoop YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).
message HadoopJob {
// Required. Indicates the location of the driver's main class. Specify
// either the jar file that contains the main class or the main class name.
// To specify both, add the jar file to `jar_file_uris`, and then specify
// the main class name in this property.
oneof driver {
// The HCFS URI of the jar file containing the main class.
// Examples:
// 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
// 'hdfs:/tmp/test-samples/custom-wordcount.jar'
// 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
string main_jar_file_uri = 1;
// The name of the driver's main class. The jar file containing the class
// must be in the default CLASSPATH or specified in `jar_file_uris`.
string main_class = 2;
}
// Optional. The arguments to pass to the driver. Do not
// include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as job
// properties, since a collision may occur that causes an incorrect job
// submission.
repeated string args = 3;
// Optional. Jar file URIs to add to the CLASSPATHs of the
// Hadoop driver and tasks.
repeated string jar_file_uris = 4;
// Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied
// to the working directory of Hadoop drivers and distributed tasks. Useful
// for naively parallel tasks.
repeated string file_uris = 5;
// Optional. HCFS URIs of archives to be extracted in the working directory of
// Hadoop drivers and tasks. Supported file types:
// .jar, .tar, .tar.gz, .tgz, or .zip.
repeated string archive_uris = 6;
// Optional. A mapping of property names to values, used to configure Hadoop.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in /etc/hadoop/conf/*-site and
// classes in user code.
map<string, string> properties = 7;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 8;
}
// A Cloud Dataproc job for running [Apache Spark](http://spark.apache.org/)
// applications on YARN.
message SparkJob {
// Required. The specification of the main method to call to drive the job.
// Specify either the jar file that contains the main class or the main class
// name. To pass both a main jar and a main class in that jar, add the jar to
// `CommonJob.jar_file_uris`, and then specify the main class name in `main_class`.
oneof driver {
// The HCFS URI of the jar file that contains the main class.
string main_jar_file_uri = 1;
// The name of the driver's main class. The jar file that contains the class
// must be in the default CLASSPATH or specified in `jar_file_uris`.
string main_class = 2;
}
// Optional. The arguments to pass to the driver. Do not include arguments,
// such as `--conf`, that can be set as job properties, since a collision may
// occur that causes an incorrect job submission.
repeated string args = 3;
// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
// Spark driver and tasks.
repeated string jar_file_uris = 4;
// Optional. HCFS URIs of files to be copied to the working directory of
// Spark drivers and distributed tasks. Useful for naively parallel tasks.
repeated string file_uris = 5;
// Optional. HCFS URIs of archives to be extracted in the working directory
// of Spark drivers and tasks. Supported file types:
// .jar, .tar, .tar.gz, .tgz, and .zip.
repeated string archive_uris = 6;
// Optional. A mapping of property names to values, used to configure Spark.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in
// /etc/spark/conf/spark-defaults.conf and classes in user code.
map<string, string> properties = 7;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 8;
}
// A Cloud Dataproc job for running
// [Apache PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html)
// applications on YARN.
message PySparkJob {
// Required. The HCFS URI of the main Python file to use as the driver. Must
// be a .py file.
string main_python_file_uri = 1;
// Optional. The arguments to pass to the driver. Do not include arguments,
// such as `--conf`, that can be set as job properties, since a collision may
// occur that causes an incorrect job submission.
repeated string args = 2;
// Optional. HCFS file URIs of Python files to pass to the PySpark
// framework. Supported file types: .py, .egg, and .zip.
repeated string python_file_uris = 3;
// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
// Python driver and tasks.
repeated string jar_file_uris = 4;
// Optional. HCFS URIs of files to be copied to the working directory of
// Python drivers and distributed tasks. Useful for naively parallel tasks.
repeated string file_uris = 5;
// Optional. HCFS URIs of archives to be extracted in the working directory of
// .jar, .tar, .tar.gz, .tgz, and .zip.
repeated string archive_uris = 6;
// Optional. A mapping of property names to values, used to configure PySpark.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in
// /etc/spark/conf/spark-defaults.conf and classes in user code.
map<string, string> properties = 7;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 8;
}
// A list of queries to run on a cluster.
message QueryList {
// Required. The queries to execute. You do not need to terminate a query
// with a semicolon. Multiple queries can be specified in one string
// by separating each with a semicolon. Here is an example of an Cloud
// Dataproc API snippet that uses a QueryList to specify a HiveJob:
//
// "hiveJob": {
// "queryList": {
// "queries": [
// "query1",
// "query2",
// "query3;query4",
// ]
// }
// }
repeated string queries = 1;
}
// A Cloud Dataproc job for running [Apache Hive](https://hive.apache.org/)
// queries on YARN.
message HiveJob {
// Required. The sequence of Hive queries to execute, specified as either
// an HCFS file URI or a list of queries.
oneof queries {
// The HCFS URI of the script that contains Hive queries.
string query_file_uri = 1;
// A list of queries.
QueryList query_list = 2;
}
// Optional. Whether to continue executing queries if a query fails.
// The default value is `false`. Setting to `true` can be useful when executing
// independent parallel queries.
bool continue_on_failure = 3;
// Optional. Mapping of query variable names to values (equivalent to the
// Hive command: `SET name="value";`).
map<string, string> script_variables = 4;
// Optional. A mapping of property names and values, used to configure Hive.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml,
// /etc/hive/conf/hive-site.xml, and classes in user code.
map<string, string> properties = 5;
// Optional. HCFS URIs of jar files to add to the CLASSPATH of the
// Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes
// and UDFs.
repeated string jar_file_uris = 6;
}
// A Cloud Dataproc job for running [Apache Spark SQL](http://spark.apache.org/sql/)
// queries.
message SparkSqlJob {
// Required. The sequence of Spark SQL queries to execute, specified as
// either an HCFS file URI or as a list of queries.
oneof queries {
// The HCFS URI of the script that contains SQL queries.
string query_file_uri = 1;
// A list of queries.
QueryList query_list = 2;
}
// Optional. Mapping of query variable names to values (equivalent to the
// Spark SQL command: SET `name="value";`).
map<string, string> script_variables = 3;
// Optional. A mapping of property names to values, used to configure
// Spark SQL's SparkConf. Properties that conflict with values set by the
// Cloud Dataproc API may be overwritten.
map<string, string> properties = 4;
// Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
repeated string jar_file_uris = 56;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 6;
}
// A Cloud Dataproc job for running [Apache Pig](https://pig.apache.org/)
// queries on YARN.
message PigJob {
// Required. The sequence of Pig queries to execute, specified as an HCFS
// file URI or a list of queries.
oneof queries {
// The HCFS URI of the script that contains the Pig queries.
string query_file_uri = 1;
// A list of queries.
QueryList query_list = 2;
}
// Optional. Whether to continue executing queries if a query fails.
// The default value is `false`. Setting to `true` can be useful when executing
// independent parallel queries.
bool continue_on_failure = 3;
// Optional. Mapping of query variable names to values (equivalent to the Pig
// command: `name=[value]`).
map<string, string> script_variables = 4;
// Optional. A mapping of property names to values, used to configure Pig.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml,
// /etc/pig/conf/pig.properties, and classes in user code.
map<string, string> properties = 5;
// Optional. HCFS URIs of jar files to add to the CLASSPATH of
// the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
repeated string jar_file_uris = 6;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 7;
}
// Cloud Dataproc job config.
message JobPlacement {
// Required. The name of the cluster where the job will be submitted.
string cluster_name = 1;
// Output-only. A cluster UUID generated by the Cloud Dataproc service when
// the job is submitted.
string cluster_uuid = 2;
}
// Cloud Dataproc job status.
message JobStatus {
// The job state.
enum State {
// The job state is unknown.
STATE_UNSPECIFIED = 0;
// The job is pending; it has been submitted, but is not yet running.
PENDING = 1;
// Job has been received by the service and completed initial setup;
// it will soon be submitted to the cluster.
SETUP_DONE = 8;
// The job is running on the cluster.
RUNNING = 2;
// A CancelJob request has been received, but is pending.
CANCEL_PENDING = 3;
// Transient in-flight resources have been canceled, and the request to
// cancel the running job has been issued to the cluster.
CANCEL_STARTED = 7;
// The job cancellation was successful.
CANCELLED = 4;
// The job has completed successfully.
DONE = 5;
// The job has completed, but encountered an error.
ERROR = 6;
// Job attempt has failed. The detail field contains failure details for
// this attempt.
//
// Applies to restartable jobs only.
ATTEMPT_FAILURE = 9;
}
enum Substate {
UNSPECIFIED = 0;
// The Job is submitted to the agent.
//
// Applies to RUNNING state.
SUBMITTED = 1;
// The Job has been received and is awaiting execution (it may be waiting
// for a condition to be met). See the "details" field for the reason for
// the delay.
//
// Applies to RUNNING state.
QUEUED = 2;
// The agent-reported status is out of date, which may be caused by a
// loss of communication between the agent and Cloud Dataproc. If the
// agent does not send a timely update, the job will fail.
//
// Applies to RUNNING state.
STALE_STATUS = 3;
}
// Output-only. A state message specifying the overall job state.
State state = 1;
// Output-only. Optional job state details, such as an error
// description if the state is <code>ERROR</code>.
string details = 2;
// Output-only. The time when this state was entered.
google.protobuf.Timestamp state_start_time = 6;
// Output-only. Additional state information, which includes
// status reported by the agent.
Substate substate = 7;
}
// Encapsulates the full scoping used to reference a job.
message JobReference {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Optional. The job ID, which must be unique within the project. The job ID
// is generated by the server upon job submission or provided by the user as a
// means to perform retries without creating duplicate jobs. The ID must
// contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or
// hyphens (-). The maximum length is 100 characters.
string job_id = 2;
}
// A YARN application created by a job. Application information is a subset of
// <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</code>.
//
// **Beta Feature**: This report is available for testing purposes only. It may
// be changed before final release.
message YarnApplication {
// The application state, corresponding to
// <code>YarnProtos.YarnApplicationStateProto</code>.
enum State {
// Status is unspecified.
STATE_UNSPECIFIED = 0;
// Status is NEW.
NEW = 1;
// Status is NEW_SAVING.
NEW_SAVING = 2;
// Status is SUBMITTED.
SUBMITTED = 3;
// Status is ACCEPTED.
ACCEPTED = 4;
// Status is RUNNING.
RUNNING = 5;
// Status is FINISHED.
FINISHED = 6;
// Status is FAILED.
FAILED = 7;
// Status is KILLED.
KILLED = 8;
}
// Required. The application name.
string name = 1;
// Required. The application state.
State state = 2;
// Required. The numerical progress of the application, from 1 to 100.
float progress = 3;
// Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or
// TimelineServer that provides application-specific information. The URL uses
// the internal hostname, and requires a proxy server for resolution and,
// possibly, access.
string tracking_url = 4;
}
// A Cloud Dataproc job resource.
message Job {
// Optional. The fully qualified reference to the job, which can be used to
// obtain the equivalent REST path of the job resource. If this property
// is not specified when a job is created, the server generates a
// <code>job_id</code>.
JobReference reference = 1;
// Required. Job information, including how, when, and where to
// run the job.
JobPlacement placement = 2;
// Required. The application/framework-specific portion of the job.
oneof type_job {
// Job is a Hadoop job.
HadoopJob hadoop_job = 3;
// Job is a Spark job.
SparkJob spark_job = 4;
// Job is a Pyspark job.
PySparkJob pyspark_job = 5;
// Job is a Hive job.
HiveJob hive_job = 6;
// Job is a Pig job.
PigJob pig_job = 7;
// Job is a SparkSql job.
SparkSqlJob spark_sql_job = 12;
}
// Output-only. The job status. Additional application-specific
// status information may be contained in the <code>type_job</code>
// and <code>yarn_applications</code> fields.
JobStatus status = 8;
// Output-only. The previous job status.
repeated JobStatus status_history = 13;
// Output-only. The collection of YARN applications spun up by this job.
//
// **Beta** Feature: This report is available for testing purposes only. It may
// be changed before final release.
repeated YarnApplication yarn_applications = 9;
// Output-only. A URI pointing to the location of the stdout of the job's
// driver program.
string driver_output_resource_uri = 17;
// Output-only. If present, the location of miscellaneous control files
// which may be used as part of job setup and handling. If not present,
// control files may be placed in the same location as `driver_output_uri`.
string driver_control_files_uri = 15;
// Optional. The labels to associate with this job.
// Label **keys** must contain 1 to 63 characters, and must conform to
// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
// Label **values** may be empty, but, if present, must contain 1 to 63
// characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
// No more than 32 labels can be associated with a job.
map<string, string> labels = 18;
// Optional. Job scheduling configuration.
JobScheduling scheduling = 20;
}
// Job scheduling options.
//
// **Beta Feature**: These options are available for testing purposes only.
// They may be changed before final release.
message JobScheduling {
// Optional. Maximum number of times per hour a driver may be restarted as
// a result of driver terminating with non-zero code before job is
// reported failed.
//
// A job may be reported as thrashing if driver exits with non-zero code
// 4 times within 10 minute window.
//
// Maximum value is 10.
int32 max_failures_per_hour = 1;
}
// A request to submit a job.
message SubmitJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The job resource.
Job job = 2;
}
// A request to get the resource representation for a job in a project.
message GetJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The job ID.
string job_id = 2;
}
// A request to list jobs in a project.
message ListJobsRequest {
// A matcher that specifies categories of job states.
enum JobStateMatcher {
// Match all jobs, regardless of state.
ALL = 0;
// Only match jobs in non-terminal states: PENDING, RUNNING, or
// CANCEL_PENDING.
ACTIVE = 1;
// Only match jobs in terminal states: CANCELLED, DONE, or ERROR.
NON_ACTIVE = 2;
}
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 6;
// Optional. The number of results to return in each response.
int32 page_size = 2;
// Optional. The page token, returned by a previous call, to request the
// next page of results.
string page_token = 3;
// Optional. If set, the returned jobs list includes only jobs that were
// submitted to the named cluster.
string cluster_name = 4;
// Optional. Specifies enumerated categories of jobs to list.
// (default = match ALL jobs).
//
// If `filter` is provided, `jobStateMatcher` will be ignored.
JobStateMatcher job_state_matcher = 5;
// Optional. A filter constraining the jobs to list. Filters are
// case-sensitive and have the following syntax:
//
// [field = value] AND [field [= value]] ...
//
// where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
// key. **value** can be `*` to match all values.
// `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
// Only the logical `AND` operator is supported; space-separated items are
// treated as having an implicit `AND` operator.
//
// Example filter:
//
// status.state = ACTIVE AND labels.env = staging AND labels.starred = *
string filter = 7;
}
// A request to update a job.
message UpdateJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 2;
// Required. The job ID.
string job_id = 3;
// Required. The changes to the job.
Job job = 4;
// Required. Specifies the path, relative to <code>Job</code>, of
// the field to update. For example, to update the labels of a Job the
// <code>update_mask</code> parameter would be specified as
// <code>labels</code>, and the `PATCH` request body would specify the new
// value. <strong>Note:</strong> Currently, <code>labels</code> is the only
// field that can be updated.
google.protobuf.FieldMask update_mask = 5;
}
// A list of jobs in a project.
message ListJobsResponse {
// Output-only. Jobs list.
repeated Job jobs = 1;
// Optional. This token is included in the response if there are more results
// to fetch. To fetch additional results, provide this value as the
// `page_token` in a subsequent <code>ListJobsRequest</code>.
string next_page_token = 2;
}
// A request to cancel a job.
message CancelJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The job ID.
string job_id = 2;
}
// A request to delete a job.
message DeleteJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The job ID.
string job_id = 2;
}

View File

@@ -0,0 +1,85 @@
// Copyright 2017 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.cloud.dataproc.v1;
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1;dataproc";
option java_multiple_files = true;
option java_outer_classname = "OperationsProto";
option java_package = "com.google.cloud.dataproc.v1";
// The status of the operation.
message ClusterOperationStatus {
// The operation state.
enum State {
// Unused.
UNKNOWN = 0;
// The operation has been created.
PENDING = 1;
// The operation is running.
RUNNING = 2;
// The operation is done; either cancelled or completed.
DONE = 3;
}
// Output-only. A message containing the operation state.
State state = 1;
// Output-only. A message containing the detailed operation state.
string inner_state = 2;
// Output-only.A message containing any operation metadata details.
string details = 3;
// Output-only. The time this state was entered.
google.protobuf.Timestamp state_start_time = 4;
}
// Metadata describing the operation.
message ClusterOperationMetadata {
// Output-only. Name of the cluster for the operation.
string cluster_name = 7;
// Output-only. Cluster UUID for the operation.
string cluster_uuid = 8;
// Output-only. Current operation status.
ClusterOperationStatus status = 9;
// Output-only. The previous operation status.
repeated ClusterOperationStatus status_history = 10;
// Output-only. The operation type.
string operation_type = 11;
// Output-only. Short description of operation.
string description = 12;
// Output-only. Labels associated with the operation
map<string, string> labels = 13;
// Output-only. Errors encountered during operation execution.
repeated string warnings = 14;
}

View File

@@ -0,0 +1,712 @@
// Copyright 2018 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.cloud.dataproc.v1beta2;
import "google/api/annotations.proto";
import "google/cloud/dataproc/v1beta2/shared.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2;dataproc";
option java_multiple_files = true;
option java_outer_classname = "ClustersProto";
option java_package = "com.google.cloud.dataproc.v1beta2";
// The ClusterControllerService provides methods to manage clusters
// of Compute Engine instances.
service ClusterController {
// Creates a cluster in a project.
rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta2/projects/{project_id}/regions/{region}/clusters"
body: "cluster"
};
}
// Updates a cluster in a project.
rpc UpdateCluster(UpdateClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1beta2/projects/{project_id}/regions/{region}/clusters/{cluster_name}"
body: "cluster"
};
}
// Deletes a cluster in a project.
rpc DeleteCluster(DeleteClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1beta2/projects/{project_id}/regions/{region}/clusters/{cluster_name}"
};
}
// Gets the resource representation for a cluster in a project.
rpc GetCluster(GetClusterRequest) returns (Cluster) {
option (google.api.http) = {
get: "/v1beta2/projects/{project_id}/regions/{region}/clusters/{cluster_name}"
};
}
// Lists all regions/{region}/clusters in a project.
rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
option (google.api.http) = {
get: "/v1beta2/projects/{project_id}/regions/{region}/clusters"
};
}
// Gets cluster diagnostic information.
// After the operation completes, the Operation.response field
// contains `DiagnoseClusterOutputLocation`.
rpc DiagnoseCluster(DiagnoseClusterRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta2/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose"
body: "*"
};
}
}
// Describes the identifying information, config, and status of
// a cluster of Compute Engine instances.
message Cluster {
// Required. The Google Cloud Platform project ID that the cluster belongs to.
string project_id = 1;
// Required. The cluster name. Cluster names within a project must be
// unique. Names of deleted clusters can be reused.
string cluster_name = 2;
// Required. The cluster config. Note that Cloud Dataproc may set
// default values, and values may change when clusters are updated.
ClusterConfig config = 3;
// Optional. The labels to associate with this cluster.
// Label **keys** must contain 1 to 63 characters, and must conform to
// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
// Label **values** may be empty, but, if present, must contain 1 to 63
// characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
// No more than 32 labels can be associated with a cluster.
map<string, string> labels = 8;
// Output only. Cluster status.
ClusterStatus status = 4;
// Output only. The previous cluster status.
repeated ClusterStatus status_history = 7;
// Output only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc
// generates this value when it creates the cluster.
string cluster_uuid = 6;
// Contains cluster daemon metrics such as HDFS and YARN stats.
//
// **Beta Feature**: This report is available for testing purposes only. It may
// be changed before final release.
ClusterMetrics metrics = 9;
}
// The cluster config.
message ClusterConfig {
// Optional. A Cloud Storage staging bucket used for sharing generated
// SSH keys and config. If you do not specify a staging bucket, Cloud
// Dataproc will determine an appropriate Cloud Storage location (US,
// ASIA, or EU) for your cluster's staging bucket according to the Google
// Compute Engine zone where your cluster is deployed, and then it will create
// and manage this project-level, per-location bucket for you.
string config_bucket = 1;
// Required. The shared Compute Engine config settings for
// all instances in a cluster.
GceClusterConfig gce_cluster_config = 8;
// Optional. The Compute Engine config settings for
// the master instance in a cluster.
InstanceGroupConfig master_config = 9;
// Optional. The Compute Engine config settings for
// worker instances in a cluster.
InstanceGroupConfig worker_config = 10;
// Optional. The Compute Engine config settings for
// additional worker instances in a cluster.
InstanceGroupConfig secondary_worker_config = 12;
// Optional. The config settings for software inside the cluster.
SoftwareConfig software_config = 13;
// Optional. The config setting for auto delete cluster schedule.
LifecycleConfig lifecycle_config = 14;
// Optional. Commands to execute on each node after config is
// completed. By default, executables are run on master and all worker nodes.
// You can test a node's <code>role</code> metadata to run an executable on
// a master or worker node, as shown below using `curl` (you can also use `wget`):
//
// ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1beta2/instance/attributes/dataproc-role)
// if [[ "${ROLE}" == 'Master' ]]; then
// ... master specific actions ...
// else
// ... worker specific actions ...
// fi
repeated NodeInitializationAction initialization_actions = 11;
}
// Common config settings for resources of Compute Engine cluster
// instances, applicable to all instances in the cluster.
message GceClusterConfig {
// Optional. The zone where the Compute Engine cluster will be located.
// On a create request, it is required in the "global" region. If omitted
// in a non-global Cloud Dataproc region, the service will pick a zone in the
// corresponding Compute Engine region. On a get request, zone will always be
// present.
//
// A full URL, partial URI, or short name are valid. Examples:
//
// * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
// * `projects/[project_id]/zones/[zone]`
// * `us-central1-f`
string zone_uri = 1;
// Optional. The Compute Engine network to be used for machine
// communications. Cannot be specified with subnetwork_uri. If neither
// `network_uri` nor `subnetwork_uri` is specified, the "default" network of
// the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
// [Using Subnetworks](/compute/docs/subnetworks) for more information).
//
// A full URL, partial URI, or short name are valid. Examples:
//
// * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
// * `projects/[project_id]/regions/global/default`
// * `default`
string network_uri = 2;
// Optional. The Compute Engine subnetwork to be used for machine
// communications. Cannot be specified with network_uri.
//
// A full URL, partial URI, or short name are valid. Examples:
//
// * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
// * `projects/[project_id]/regions/us-east1/sub0`
// * `sub0`
string subnetwork_uri = 6;
// Optional. If true, all instances in the cluster will only have internal IP
// addresses. By default, clusters are not restricted to internal IP addresses,
// and will have ephemeral external IP addresses assigned to each instance.
// This `internal_ip_only` restriction can only be enabled for subnetwork
// enabled networks, and all off-cluster dependencies must be configured to be
// accessible without external IP addresses.
bool internal_ip_only = 7;
// Optional. The service account of the instances. Defaults to the default
// Compute Engine service account. Custom service accounts need
// permissions equivalent to the following IAM roles:
//
// * roles/logging.logWriter
// * roles/storage.objectAdmin
//
// (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
// for more information).
// Example: `[account_id]@[project_id].iam.gserviceaccount.com`
string service_account = 8;
// Optional. The URIs of service account scopes to be included in
// Compute Engine instances. The following base set of scopes is always
// included:
//
// * https://www.googleapis.com/auth/cloud.useraccounts.readonly
// * https://www.googleapis.com/auth/devstorage.read_write
// * https://www.googleapis.com/auth/logging.write
//
// If no scopes are specified, the following defaults are also provided:
//
// * https://www.googleapis.com/auth/bigquery
// * https://www.googleapis.com/auth/bigtable.admin.table
// * https://www.googleapis.com/auth/bigtable.data
// * https://www.googleapis.com/auth/devstorage.full_control
repeated string service_account_scopes = 3;
// The Compute Engine tags to add to all instances (see
// [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
repeated string tags = 4;
// The Compute Engine metadata entries to add to all instances (see
// [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
map<string, string> metadata = 5;
}
// Optional. The config settings for Compute Engine resources in
// an instance group, such as a master or worker group.
message InstanceGroupConfig {
// Optional. The number of VM instances in the instance group.
// For master instance groups, must be set to 1.
int32 num_instances = 1;
// Output only. The list of instance names. Cloud Dataproc derives the names
// from `cluster_name`, `num_instances`, and the instance group.
repeated string instance_names = 2;
// Output only. The Compute Engine image resource used for cluster
// instances. Inferred from `SoftwareConfig.image_version`.
string image_uri = 3;
// Optional. The Compute Engine machine type used for cluster instances.
//
// A full URL, partial URI, or short name are valid. Examples:
//
// * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2`
// * `projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2`
// * `n1-standard-2`
//
// **Auto Zone Exception**: If you are using the Cloud Dataproc
// [Auto Zone Placement](/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
// feature, you must use the short name of the machine type
// resource, for example, `n1-standard-2`.
string machine_type_uri = 4;
// Optional. Disk option config settings.
DiskConfig disk_config = 5;
// Optional. Specifies that this instance group contains preemptible instances.
bool is_preemptible = 6;
// Output only. The config for Compute Engine Instance Group
// Manager that manages this group.
// This is only used for preemptible instance groups.
ManagedGroupConfig managed_group_config = 7;
// Optional. The Compute Engine accelerator configuration for these
// instances.
//
// **Beta Feature**: This feature is still under development. It may be
// changed before final release.
repeated AcceleratorConfig accelerators = 8;
// Optional. Specifies the minimum cpu platform for the Instance Group.
// See [Cloud Dataproc&rarr;Minimum CPU Platform]
// (/dataproc/docs/concepts/compute/dataproc-min-cpu).
string min_cpu_platform = 9;
}
// Specifies the resources used to actively manage an instance group.
message ManagedGroupConfig {
// Output only. The name of the Instance Template used for the Managed
// Instance Group.
string instance_template_name = 1;
// Output only. The name of the Instance Group Manager for this group.
string instance_group_manager_name = 2;
}
// Specifies the type and number of accelerator cards attached to the instances
// of an instance group (see [GPUs on Compute Engine](/compute/docs/gpus/)).
message AcceleratorConfig {
// Full URL, partial URI, or short name of the accelerator type resource to
// expose to this instance. See [Compute Engine AcceleratorTypes](
// /compute/docs/reference/beta/acceleratorTypes)
//
// Examples
// * `https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80`
// * `projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80`
// * `nvidia-tesla-k80`
//
// **Auto Zone Exception**: If you are using the Cloud Dataproc
// [Auto Zone Placement](/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
// feature, you must use the short name of the accelerator type
// resource, for example, `nvidia-tesla-k80`.
string accelerator_type_uri = 1;
// The number of the accelerator cards of this type exposed to this instance.
int32 accelerator_count = 2;
}
// Specifies the config of disk options for a group of VM instances.
message DiskConfig {
// Optional. Type of the boot disk (default is "pd-standard").
// Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
// "pd-standard" (Persistent Disk Hard Disk Drive).
string boot_disk_type = 3;
// Optional. Size in GB of the boot disk (default is 500GB).
int32 boot_disk_size_gb = 1;
// Optional. Number of attached SSDs, from 0 to 4 (default is 0).
// If SSDs are not attached, the boot disk is used to store runtime logs and
// [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data.
// If one or more SSDs are attached, this runtime bulk
// data is spread across them, and the boot disk contains only basic
// config and installed binaries.
int32 num_local_ssds = 2;
}
// Specifies the cluster auto delete related schedule configuration.
message LifecycleConfig {
// Optional. The longest duration that cluster would keep alive while staying
// idle; passing this threshold will cause cluster to be auto-deleted.
google.protobuf.Duration idle_delete_ttl = 1;
// Optional. Either the exact time the cluster should be deleted at or
// the cluster maximum age.
oneof ttl {
// Optional. The time when cluster will be auto-deleted.
google.protobuf.Timestamp auto_delete_time = 2;
// Optional. The life duration of cluster, the cluster will be auto-deleted
// at the end of this duration.
google.protobuf.Duration auto_delete_ttl = 3;
}
}
// Specifies an executable to run on a fully configured node and a
// timeout period for executable completion.
message NodeInitializationAction {
// Required. Cloud Storage URI of executable file.
string executable_file = 1;
// Optional. Amount of time executable has to complete. Default is
// 10 minutes. Cluster creation fails with an explanatory error message (the
// name of the executable that caused the error and the exceeded timeout
// period) if the executable is not completed at end of the timeout period.
google.protobuf.Duration execution_timeout = 2;
}
// The status of a cluster and its instances.
message ClusterStatus {
// The cluster state.
enum State {
// The cluster state is unknown.
UNKNOWN = 0;
// The cluster is being created and set up. It is not ready for use.
CREATING = 1;
// The cluster is currently running and healthy. It is ready for use.
RUNNING = 2;
// The cluster encountered an error. It is not ready for use.
ERROR = 3;
// The cluster is being deleted. It cannot be used.
DELETING = 4;
// The cluster is being updated. It continues to accept and process jobs.
UPDATING = 5;
}
// The cluster substate.
enum Substate {
// The cluster substate is unknown.
UNSPECIFIED = 0;
// The cluster is known to be in an unhealthy state
// (for example, critical daemons are not running or HDFS capacity is
// exhausted).
//
// Applies to RUNNING state.
UNHEALTHY = 1;
// The agent-reported status is out of date (may occur if
// Cloud Dataproc loses communication with Agent).
//
// Applies to RUNNING state.
STALE_STATUS = 2;
}
// Output only. The cluster's state.
State state = 1;
// Output only. Optional details of cluster's state.
string detail = 2;
// Output only. Time when this state was entered.
google.protobuf.Timestamp state_start_time = 3;
// Output only. Additional state information that includes
// status reported by the agent.
Substate substate = 4;
}
// Specifies the selection and config of software inside the cluster.
message SoftwareConfig {
// Optional. The version of software inside the cluster. It must be one of the supported
// [Cloud Dataproc Versions](/dataproc/docs/concepts/versioning/dataproc-versions#supported_cloud_dataproc_versions),
// such as "1.2" (including a subminor version, such as "1.2.29"), or the
// ["preview" version](/dataproc/docs/concepts/versioning/dataproc-versions#other_versions).
// If unspecified, it defaults to the latest version.
string image_version = 1;
// Optional. The properties to set on daemon config files.
//
// Property keys are specified in `prefix:property` format, such as
// `core:fs.defaultFS`. The following are supported prefixes
// and their mappings:
//
// * capacity-scheduler: `capacity-scheduler.xml`
// * core: `core-site.xml`
// * distcp: `distcp-default.xml`
// * hdfs: `hdfs-site.xml`
// * hive: `hive-site.xml`
// * mapred: `mapred-site.xml`
// * pig: `pig.properties`
// * spark: `spark-defaults.conf`
// * yarn: `yarn-site.xml`
//
// For more information, see
// [Cluster properties](/dataproc/docs/concepts/cluster-properties).
map<string, string> properties = 2;
}
// Contains cluster daemon metrics, such as HDFS and YARN stats.
//
// **Beta Feature**: This report is available for testing purposes only. It may
// be changed before final release.
message ClusterMetrics {
// The HDFS metrics.
map<string, int64> hdfs_metrics = 1;
// The YARN metrics.
map<string, int64> yarn_metrics = 2;
}
// A request to create a cluster.
message CreateClusterRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The cluster to create.
Cluster cluster = 2;
// Optional. A unique id used to identify the request. If the server
// receives two [CreateClusterRequest][google.cloud.dataproc.v1beta2.CreateClusterRequest] requests with the same
// id, then the second request will be ignored and the
// first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the backend
// is returned.
//
// It is recommended to always set this value to a
// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
//
// The id must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), and hyphens (-). The maximum length is 40 characters.
string request_id = 4;
}
// A request to update a cluster.
message UpdateClusterRequest {
// Required. The ID of the Google Cloud Platform project the
// cluster belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 5;
// Required. The cluster name.
string cluster_name = 2;
// Required. The changes to the cluster.
Cluster cluster = 3;
// Optional. Timeout for graceful YARN decomissioning. Graceful
// decommissioning allows removing nodes from the cluster without
// interrupting jobs in progress. Timeout specifies how long to wait for jobs
// in progress to finish before forcefully removing nodes (and potentially
// interrupting jobs). Default timeout is 0 (for forceful decommission), and
// the maximum allowed timeout is 1 day.
//
// Only supported on Dataproc image versions 1.2 and higher.
google.protobuf.Duration graceful_decommission_timeout = 6;
// Required. Specifies the path, relative to `Cluster`, of
// the field to update. For example, to change the number of workers
// in a cluster to 5, the `update_mask` parameter would be
// specified as `config.worker_config.num_instances`,
// and the `PATCH` request body would specify the new value, as follows:
//
// {
// "config":{
// "workerConfig":{
// "numInstances":"5"
// }
// }
// }
//
// Similarly, to change the number of preemptible workers in a cluster to 5, the
// `update_mask` parameter would be `config.secondary_worker_config.num_instances`,
// and the `PATCH` request body would be set as follows:
//
// {
// "config":{
// "secondaryWorkerConfig":{
// "numInstances":"5"
// }
// }
// }
// <strong>Note:</strong> currently only the following fields can be updated:
//
// <table>
// <tr>
// <td><strong>Mask</strong></td><td><strong>Purpose</strong></td>
// </tr>
// <tr>
// <td>labels</td><td>Updates labels</td>
// </tr>
// <tr>
// <td>config.worker_config.num_instances</td><td>Resize primary worker group</td>
// </tr>
// <tr>
// <td>config.secondary_worker_config.num_instances</td><td>Resize secondary worker group</td>
// </tr>
// <tr>
// <td>config.lifecycle_config.auto_delete_ttl</td><td>Reset MAX TTL duration</td>
// </tr>
// <tr>
// <td>config.lifecycle_config.auto_delete_time</td><td>Update MAX TTL deletion timestamp</td>
// </tr>
// <tr>
// <td>config.lifecycle_config.idle_delete_ttl</td><td>Update Idle TTL duration</td>
// </tr>
// </table>
google.protobuf.FieldMask update_mask = 4;
// Optional. A unique id used to identify the request. If the server
// receives two [UpdateClusterRequest][google.cloud.dataproc.v1beta2.UpdateClusterRequest] requests with the same
// id, then the second request will be ignored and the
// first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the
// backend is returned.
//
// It is recommended to always set this value to a
// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
//
// The id must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), and hyphens (-). The maximum length is 40 characters.
string request_id = 7;
}
// A request to delete a cluster.
message DeleteClusterRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The cluster name.
string cluster_name = 2;
// Optional. Specifying the `cluster_uuid` means the RPC should fail
// (with error NOT_FOUND) if cluster with specified UUID does not exist.
string cluster_uuid = 4;
// Optional. A unique id used to identify the request. If the server
// receives two [DeleteClusterRequest][google.cloud.dataproc.v1beta2.DeleteClusterRequest] requests with the same
// id, then the second request will be ignored and the
// first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the
// backend is returned.
//
// It is recommended to always set this value to a
// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
//
// The id must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), and hyphens (-). The maximum length is 40 characters.
string request_id = 5;
}
// Request to get the resource representation for a cluster in a project.
message GetClusterRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The cluster name.
string cluster_name = 2;
}
// A request to list the clusters in a project.
message ListClustersRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 4;
// Optional. A filter constraining the clusters to list. Filters are
// case-sensitive and have the following syntax:
//
// field = value [AND [field = value]] ...
//
// where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`,
// and `[KEY]` is a label key. **value** can be `*` to match all values.
// `status.state` can be one of the following: `ACTIVE`, `INACTIVE`,
// `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE`
// contains the `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE`
// contains the `DELETING` and `ERROR` states.
// `clusterName` is the name of the cluster provided at creation time.
// Only the logical `AND` operator is supported; space-separated items are
// treated as having an implicit `AND` operator.
//
// Example filter:
//
// status.state = ACTIVE AND clusterName = mycluster
// AND labels.env = staging AND labels.starred = *
string filter = 5;
// Optional. The standard List page size.
int32 page_size = 2;
// Optional. The standard List page token.
string page_token = 3;
}
// The list of all clusters in a project.
message ListClustersResponse {
// Output only. The clusters in the project.
repeated Cluster clusters = 1;
// Output only. This token is included in the response if there are more
// results to fetch. To fetch additional results, provide this value as the
// `page_token` in a subsequent <code>ListClustersRequest</code>.
string next_page_token = 2;
}
// A request to collect cluster diagnostic information.
message DiagnoseClusterRequest {
// Required. The ID of the Google Cloud Platform project that the cluster
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The cluster name.
string cluster_name = 2;
}
// The location of diagnostic output.
message DiagnoseClusterResults {
// Output only. The Cloud Storage URI of the diagnostic output.
// The output report is a plain text file with a summary of collected
// diagnostics.
string output_uri = 1;
}

View File

@@ -0,0 +1,767 @@
// Copyright 2018 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.cloud.dataproc.v1beta2;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2;dataproc";
option java_multiple_files = true;
option java_outer_classname = "JobsProto";
option java_package = "com.google.cloud.dataproc.v1beta2";
// The JobController provides methods to manage jobs.
service JobController {
// Submits a job to a cluster.
rpc SubmitJob(SubmitJobRequest) returns (Job) {
option (google.api.http) = {
post: "/v1beta2/projects/{project_id}/regions/{region}/jobs:submit"
body: "*"
};
}
// Gets the resource representation for a job in a project.
rpc GetJob(GetJobRequest) returns (Job) {
option (google.api.http) = {
get: "/v1beta2/projects/{project_id}/regions/{region}/jobs/{job_id}"
};
}
// Lists regions/{region}/jobs in a project.
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
option (google.api.http) = {
get: "/v1beta2/projects/{project_id}/regions/{region}/jobs"
};
}
// Updates a job in a project.
rpc UpdateJob(UpdateJobRequest) returns (Job) {
option (google.api.http) = {
patch: "/v1beta2/projects/{project_id}/regions/{region}/jobs/{job_id}"
body: "job"
};
}
// Starts a job cancellation request. To access the job resource
// after cancellation, call
// [regions/{region}/jobs.list](/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/list) or
// [regions/{region}/jobs.get](/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get).
rpc CancelJob(CancelJobRequest) returns (Job) {
option (google.api.http) = {
post: "/v1beta2/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel"
body: "*"
};
}
// Deletes the job from the project. If the job is active, the delete fails,
// and the response returns `FAILED_PRECONDITION`.
rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1beta2/projects/{project_id}/regions/{region}/jobs/{job_id}"
};
}
}
// The runtime logging config of the job.
message LoggingConfig {
// The Log4j level for job execution. When running an
// [Apache Hive](http://hive.apache.org/) job, Cloud
// Dataproc configures the Hive client to an equivalent verbosity level.
enum Level {
// Level is unspecified. Use default level for log4j.
LEVEL_UNSPECIFIED = 0;
// Use ALL level for log4j.
ALL = 1;
// Use TRACE level for log4j.
TRACE = 2;
// Use DEBUG level for log4j.
DEBUG = 3;
// Use INFO level for log4j.
INFO = 4;
// Use WARN level for log4j.
WARN = 5;
// Use ERROR level for log4j.
ERROR = 6;
// Use FATAL level for log4j.
FATAL = 7;
// Turn off log4j.
OFF = 8;
}
// The per-package log levels for the driver. This may include
// "root" package name to configure rootLogger.
// Examples:
// 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'
map<string, Level> driver_log_levels = 2;
}
// A Cloud Dataproc job for running
// [Apache Hadoop MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html)
// jobs on [Apache Hadoop YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).
message HadoopJob {
// Required. Indicates the location of the driver's main class. Specify
// either the jar file that contains the main class or the main class name.
// To specify both, add the jar file to `jar_file_uris`, and then specify
// the main class name in this property.
oneof driver {
// The HCFS URI of the jar file containing the main class.
// Examples:
// 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
// 'hdfs:/tmp/test-samples/custom-wordcount.jar'
// 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
string main_jar_file_uri = 1;
// The name of the driver's main class. The jar file containing the class
// must be in the default CLASSPATH or specified in `jar_file_uris`.
string main_class = 2;
}
// Optional. The arguments to pass to the driver. Do not
// include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as job
// properties, since a collision may occur that causes an incorrect job
// submission.
repeated string args = 3;
// Optional. Jar file URIs to add to the CLASSPATHs of the
// Hadoop driver and tasks.
repeated string jar_file_uris = 4;
// Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied
// to the working directory of Hadoop drivers and distributed tasks. Useful
// for naively parallel tasks.
repeated string file_uris = 5;
// Optional. HCFS URIs of archives to be extracted in the working directory of
// Hadoop drivers and tasks. Supported file types:
// .jar, .tar, .tar.gz, .tgz, or .zip.
repeated string archive_uris = 6;
// Optional. A mapping of property names to values, used to configure Hadoop.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in /etc/hadoop/conf/*-site and
// classes in user code.
map<string, string> properties = 7;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 8;
}
// A Cloud Dataproc job for running [Apache Spark](http://spark.apache.org/)
// applications on YARN.
message SparkJob {
// Required. The specification of the main method to call to drive the job.
// Specify either the jar file that contains the main class or the main class
// name. To pass both a main jar and a main class in that jar, add the jar to
// `CommonJob.jar_file_uris`, and then specify the main class name in `main_class`.
oneof driver {
// The HCFS URI of the jar file that contains the main class.
string main_jar_file_uri = 1;
// The name of the driver's main class. The jar file that contains the class
// must be in the default CLASSPATH or specified in `jar_file_uris`.
string main_class = 2;
}
// Optional. The arguments to pass to the driver. Do not include arguments,
// such as `--conf`, that can be set as job properties, since a collision may
// occur that causes an incorrect job submission.
repeated string args = 3;
// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
// Spark driver and tasks.
repeated string jar_file_uris = 4;
// Optional. HCFS URIs of files to be copied to the working directory of
// Spark drivers and distributed tasks. Useful for naively parallel tasks.
repeated string file_uris = 5;
// Optional. HCFS URIs of archives to be extracted in the working directory
// of Spark drivers and tasks. Supported file types:
// .jar, .tar, .tar.gz, .tgz, and .zip.
repeated string archive_uris = 6;
// Optional. A mapping of property names to values, used to configure Spark.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in
// /etc/spark/conf/spark-defaults.conf and classes in user code.
map<string, string> properties = 7;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 8;
}
// A Cloud Dataproc job for running
// [Apache PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html)
// applications on YARN.
message PySparkJob {
// Required. The HCFS URI of the main Python file to use as the driver. Must
// be a .py file.
string main_python_file_uri = 1;
// Optional. The arguments to pass to the driver. Do not include arguments,
// such as `--conf`, that can be set as job properties, since a collision may
// occur that causes an incorrect job submission.
repeated string args = 2;
// Optional. HCFS file URIs of Python files to pass to the PySpark
// framework. Supported file types: .py, .egg, and .zip.
repeated string python_file_uris = 3;
// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
// Python driver and tasks.
repeated string jar_file_uris = 4;
// Optional. HCFS URIs of files to be copied to the working directory of
// Python drivers and distributed tasks. Useful for naively parallel tasks.
repeated string file_uris = 5;
// Optional. HCFS URIs of archives to be extracted in the working directory of
// .jar, .tar, .tar.gz, .tgz, and .zip.
repeated string archive_uris = 6;
// Optional. A mapping of property names to values, used to configure PySpark.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in
// /etc/spark/conf/spark-defaults.conf and classes in user code.
map<string, string> properties = 7;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 8;
}
// A list of queries to run on a cluster.
message QueryList {
// Required. The queries to execute. You do not need to terminate a query
// with a semicolon. Multiple queries can be specified in one string
// by separating each with a semicolon. Here is an example of an Cloud
// Dataproc API snippet that uses a QueryList to specify a HiveJob:
//
// "hiveJob": {
// "queryList": {
// "queries": [
// "query1",
// "query2",
// "query3;query4",
// ]
// }
// }
repeated string queries = 1;
}
// A Cloud Dataproc job for running [Apache Hive](https://hive.apache.org/)
// queries on YARN.
message HiveJob {
// Required. The sequence of Hive queries to execute, specified as either
// an HCFS file URI or a list of queries.
oneof queries {
// The HCFS URI of the script that contains Hive queries.
string query_file_uri = 1;
// A list of queries.
QueryList query_list = 2;
}
// Optional. Whether to continue executing queries if a query fails.
// The default value is `false`. Setting to `true` can be useful when executing
// independent parallel queries.
bool continue_on_failure = 3;
// Optional. Mapping of query variable names to values (equivalent to the
// Hive command: `SET name="value";`).
map<string, string> script_variables = 4;
// Optional. A mapping of property names and values, used to configure Hive.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml,
// /etc/hive/conf/hive-site.xml, and classes in user code.
map<string, string> properties = 5;
// Optional. HCFS URIs of jar files to add to the CLASSPATH of the
// Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes
// and UDFs.
repeated string jar_file_uris = 6;
}
// A Cloud Dataproc job for running [Apache Spark SQL](http://spark.apache.org/sql/)
// queries.
message SparkSqlJob {
// Required. The sequence of Spark SQL queries to execute, specified as
// either an HCFS file URI or as a list of queries.
oneof queries {
// The HCFS URI of the script that contains SQL queries.
string query_file_uri = 1;
// A list of queries.
QueryList query_list = 2;
}
// Optional. Mapping of query variable names to values (equivalent to the
// Spark SQL command: SET `name="value";`).
map<string, string> script_variables = 3;
// Optional. A mapping of property names to values, used to configure
// Spark SQL's SparkConf. Properties that conflict with values set by the
// Cloud Dataproc API may be overwritten.
map<string, string> properties = 4;
// Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
repeated string jar_file_uris = 56;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 6;
}
// A Cloud Dataproc job for running [Apache Pig](https://pig.apache.org/)
// queries on YARN.
message PigJob {
// Required. The sequence of Pig queries to execute, specified as an HCFS
// file URI or a list of queries.
oneof queries {
// The HCFS URI of the script that contains the Pig queries.
string query_file_uri = 1;
// A list of queries.
QueryList query_list = 2;
}
// Optional. Whether to continue executing queries if a query fails.
// The default value is `false`. Setting to `true` can be useful when executing
// independent parallel queries.
bool continue_on_failure = 3;
// Optional. Mapping of query variable names to values (equivalent to the Pig
// command: `name=[value]`).
map<string, string> script_variables = 4;
// Optional. A mapping of property names to values, used to configure Pig.
// Properties that conflict with values set by the Cloud Dataproc API may be
// overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml,
// /etc/pig/conf/pig.properties, and classes in user code.
map<string, string> properties = 5;
// Optional. HCFS URIs of jar files to add to the CLASSPATH of
// the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
repeated string jar_file_uris = 6;
// Optional. The runtime log config for job execution.
LoggingConfig logging_config = 7;
}
// Cloud Dataproc job config.
message JobPlacement {
// Required. The name of the cluster where the job will be submitted.
string cluster_name = 1;
// Output only. A cluster UUID generated by the Cloud Dataproc service when
// the job is submitted.
string cluster_uuid = 2;
}
// Cloud Dataproc job status.
message JobStatus {
// The job state.
enum State {
// The job state is unknown.
STATE_UNSPECIFIED = 0;
// The job is pending; it has been submitted, but is not yet running.
PENDING = 1;
// Job has been received by the service and completed initial setup;
// it will soon be submitted to the cluster.
SETUP_DONE = 8;
// The job is running on the cluster.
RUNNING = 2;
// A CancelJob request has been received, but is pending.
CANCEL_PENDING = 3;
// Transient in-flight resources have been canceled, and the request to
// cancel the running job has been issued to the cluster.
CANCEL_STARTED = 7;
// The job cancellation was successful.
CANCELLED = 4;
// The job has completed successfully.
DONE = 5;
// The job has completed, but encountered an error.
ERROR = 6;
// Job attempt has failed. The detail field contains failure details for
// this attempt.
//
// Applies to restartable jobs only.
ATTEMPT_FAILURE = 9;
}
// The job substate.
enum Substate {
// The job substate is unknown.
UNSPECIFIED = 0;
// The Job is submitted to the agent.
//
// Applies to RUNNING state.
SUBMITTED = 1;
// The Job has been received and is awaiting execution (it may be waiting
// for a condition to be met). See the "details" field for the reason for
// the delay.
//
// Applies to RUNNING state.
QUEUED = 2;
// The agent-reported status is out of date, which may be caused by a
// loss of communication between the agent and Cloud Dataproc. If the
// agent does not send a timely update, the job will fail.
//
// Applies to RUNNING state.
STALE_STATUS = 3;
}
// Output only. A state message specifying the overall job state.
State state = 1;
// Output only. Optional job state details, such as an error
// description if the state is <code>ERROR</code>.
string details = 2;
// Output only. The time when this state was entered.
google.protobuf.Timestamp state_start_time = 6;
// Output only. Additional state information, which includes
// status reported by the agent.
Substate substate = 7;
}
// Encapsulates the full scoping used to reference a job.
message JobReference {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Optional. The job ID, which must be unique within the project. The job ID
// is generated by the server upon job submission or provided by the user as a
// means to perform retries without creating duplicate jobs. The ID must
// contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or
// hyphens (-). The maximum length is 100 characters.
string job_id = 2;
}
// A YARN application created by a job. Application information is a subset of
// <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</code>.
//
// **Beta Feature**: This report is available for testing purposes only. It may
// be changed before final release.
message YarnApplication {
// The application state, corresponding to
// <code>YarnProtos.YarnApplicationStateProto</code>.
enum State {
// Status is unspecified.
STATE_UNSPECIFIED = 0;
// Status is NEW.
NEW = 1;
// Status is NEW_SAVING.
NEW_SAVING = 2;
// Status is SUBMITTED.
SUBMITTED = 3;
// Status is ACCEPTED.
ACCEPTED = 4;
// Status is RUNNING.
RUNNING = 5;
// Status is FINISHED.
FINISHED = 6;
// Status is FAILED.
FAILED = 7;
// Status is KILLED.
KILLED = 8;
}
// Required. The application name.
string name = 1;
// Required. The application state.
State state = 2;
// Required. The numerical progress of the application, from 1 to 100.
float progress = 3;
// Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or
// TimelineServer that provides application-specific information. The URL uses
// the internal hostname, and requires a proxy server for resolution and,
// possibly, access.
string tracking_url = 4;
}
// A Cloud Dataproc job resource.
message Job {
// Optional. The fully qualified reference to the job, which can be used to
// obtain the equivalent REST path of the job resource. If this property
// is not specified when a job is created, the server generates a
// <code>job_id</code>.
JobReference reference = 1;
// Required. Job information, including how, when, and where to
// run the job.
JobPlacement placement = 2;
// Required. The application/framework-specific portion of the job.
oneof type_job {
// Job is a Hadoop job.
HadoopJob hadoop_job = 3;
// Job is a Spark job.
SparkJob spark_job = 4;
// Job is a Pyspark job.
PySparkJob pyspark_job = 5;
// Job is a Hive job.
HiveJob hive_job = 6;
// Job is a Pig job.
PigJob pig_job = 7;
// Job is a SparkSql job.
SparkSqlJob spark_sql_job = 12;
}
// Output only. The job status. Additional application-specific
// status information may be contained in the <code>type_job</code>
// and <code>yarn_applications</code> fields.
JobStatus status = 8;
// Output only. The previous job status.
repeated JobStatus status_history = 13;
// Output only. The collection of YARN applications spun up by this job.
//
// **Beta** Feature: This report is available for testing purposes only. It may
// be changed before final release.
repeated YarnApplication yarn_applications = 9;
// Output only. A URI pointing to the location of the stdout of the job's
// driver program.
string driver_output_resource_uri = 17;
// Output only. If present, the location of miscellaneous control files
// which may be used as part of job setup and handling. If not present,
// control files may be placed in the same location as `driver_output_uri`.
string driver_control_files_uri = 15;
// Optional. The labels to associate with this job.
// Label **keys** must contain 1 to 63 characters, and must conform to
// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
// Label **values** may be empty, but, if present, must contain 1 to 63
// characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
// No more than 32 labels can be associated with a job.
map<string, string> labels = 18;
// Optional. Job scheduling configuration.
JobScheduling scheduling = 20;
}
// Job scheduling options.
message JobScheduling {
// Optional. Maximum number of times per hour a driver may be restarted as
// a result of driver terminating with non-zero code before job is
// reported failed.
//
// A job may be reported as thrashing if driver exits with non-zero code
// 4 times within 10 minute window.
//
// Maximum value is 10.
int32 max_failures_per_hour = 1;
}
// A request to submit a job.
message SubmitJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The job resource.
Job job = 2;
// Optional. A unique id used to identify the request. If the server
// receives two [SubmitJobRequest][google.cloud.dataproc.v1beta2.SubmitJobRequest] requests with the same
// id, then the second request will be ignored and the
// first [Job][google.cloud.dataproc.v1beta2.Job] created and stored in the backend
// is returned.
//
// It is recommended to always set this value to a
// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
//
// The id must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), and hyphens (-). The maximum length is 40 characters.
string request_id = 4;
}
// A request to get the resource representation for a job in a project.
message GetJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The job ID.
string job_id = 2;
}
// A request to list jobs in a project.
message ListJobsRequest {
// A matcher that specifies categories of job states.
enum JobStateMatcher {
// Match all jobs, regardless of state.
ALL = 0;
// Only match jobs in non-terminal states: PENDING, RUNNING, or
// CANCEL_PENDING.
ACTIVE = 1;
// Only match jobs in terminal states: CANCELLED, DONE, or ERROR.
NON_ACTIVE = 2;
}
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 6;
// Optional. The number of results to return in each response.
int32 page_size = 2;
// Optional. The page token, returned by a previous call, to request the
// next page of results.
string page_token = 3;
// Optional. If set, the returned jobs list includes only jobs that were
// submitted to the named cluster.
string cluster_name = 4;
// Optional. Specifies enumerated categories of jobs to list.
// (default = match ALL jobs).
//
// If `filter` is provided, `jobStateMatcher` will be ignored.
JobStateMatcher job_state_matcher = 5;
// Optional. A filter constraining the jobs to list. Filters are
// case-sensitive and have the following syntax:
//
// [field = value] AND [field [= value]] ...
//
// where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
// key. **value** can be `*` to match all values.
// `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
// Only the logical `AND` operator is supported; space-separated items are
// treated as having an implicit `AND` operator.
//
// Example filter:
//
// status.state = ACTIVE AND labels.env = staging AND labels.starred = *
string filter = 7;
}
// A request to update a job.
message UpdateJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 2;
// Required. The job ID.
string job_id = 3;
// Required. The changes to the job.
Job job = 4;
// Required. Specifies the path, relative to <code>Job</code>, of
// the field to update. For example, to update the labels of a Job the
// <code>update_mask</code> parameter would be specified as
// <code>labels</code>, and the `PATCH` request body would specify the new
// value. <strong>Note:</strong> Currently, <code>labels</code> is the only
// field that can be updated.
google.protobuf.FieldMask update_mask = 5;
}
// A list of jobs in a project.
message ListJobsResponse {
// Output only. Jobs list.
repeated Job jobs = 1;
// Optional. This token is included in the response if there are more results
// to fetch. To fetch additional results, provide this value as the
// `page_token` in a subsequent <code>ListJobsRequest</code>.
string next_page_token = 2;
}
// A request to cancel a job.
message CancelJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The job ID.
string job_id = 2;
}
// A request to delete a job.
message DeleteJobRequest {
// Required. The ID of the Google Cloud Platform project that the job
// belongs to.
string project_id = 1;
// Required. The Cloud Dataproc region in which to handle the request.
string region = 3;
// Required. The job ID.
string job_id = 2;
}

View File

@@ -0,0 +1,83 @@
// Copyright 2018 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.cloud.dataproc.v1beta2;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2;dataproc";
option java_multiple_files = true;
option java_outer_classname = "OperationsProto";
option java_package = "com.google.cloud.dataproc.v1beta2";
// The status of the operation.
message ClusterOperationStatus {
// The operation state.
enum State {
// Unused.
UNKNOWN = 0;
// The operation has been created.
PENDING = 1;
// The operation is running.
RUNNING = 2;
// The operation is done; either cancelled or completed.
DONE = 3;
}
// Output only. A message containing the operation state.
State state = 1;
// Output only. A message containing the detailed operation state.
string inner_state = 2;
// Output only. A message containing any operation metadata details.
string details = 3;
// Output only. The time this state was entered.
google.protobuf.Timestamp state_start_time = 4;
}
// Metadata describing the operation.
message ClusterOperationMetadata {
// Output only. Name of the cluster for the operation.
string cluster_name = 7;
// Output only. Cluster UUID for the operation.
string cluster_uuid = 8;
// Output only. Current operation status.
ClusterOperationStatus status = 9;
// Output only. The previous operation status.
repeated ClusterOperationStatus status_history = 10;
// Output only. The operation type.
string operation_type = 11;
// Output only. Short description of operation.
string description = 12;
// Output only. Labels associated with the operation
map<string, string> labels = 13;
// Output only. Errors encountered during operation execution.
repeated string warnings = 14;
}

View File

@@ -0,0 +1,25 @@
// Copyright 2018 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.cloud.dataproc.v1beta2;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2;dataproc";
option java_multiple_files = true;
option java_outer_classname = "SharedProto";
option java_package = "com.google.cloud.dataproc.v1beta2";

View File

@@ -0,0 +1,544 @@
// Copyright 2018 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.cloud.dataproc.v1beta2;
import "google/api/annotations.proto";
import "google/cloud/dataproc/v1beta2/clusters.proto";
import "google/cloud/dataproc/v1beta2/jobs.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2;dataproc";
option java_multiple_files = true;
option java_outer_classname = "WorkflowTemplatesProto";
option java_package = "com.google.cloud.dataproc.v1beta2";
// The API interface for managing Workflow Templates in the
// Cloud Dataproc API.
service WorkflowTemplateService {
// Creates new workflow template.
rpc CreateWorkflowTemplate(CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
post: "/v1beta2/{parent=projects/*/regions/*}/workflowTemplates"
body: "template"
additional_bindings {
post: "/v1beta2/{parent=projects/*/locations/*}/workflowTemplates"
body: "template"
}
};
}
// Retrieves the latest workflow template.
//
// Can retrieve previously instantiated template by specifying optional
// version parameter.
rpc GetWorkflowTemplate(GetWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
get: "/v1beta2/{name=projects/*/regions/*/workflowTemplates/*}"
additional_bindings {
get: "/v1beta2/{name=projects/*/locations/*/workflowTemplates/*}"
}
};
}
// Instantiates a template and begins execution.
//
// The returned Operation can be used to track execution of
// workflow by polling
// [operations.get][google.longrunning.Operations.GetOperation].
// The Operation will complete when entire workflow is finished.
//
// The running workflow can be aborted via
// [operations.cancel][google.longrunning.Operations.CancelOperation].
// This will cause any inflight jobs to be cancelled and workflow-owned
// clusters to be deleted.
//
// The [Operation.metadata][google.longrunning.Operation.metadata] will be
// [WorkflowMetadata][google.cloud.dataproc.v1beta2.WorkflowMetadata].
//
// On successful completion,
// [Operation.response][google.longrunning.Operation.response] will be
// [Empty][google.protobuf.Empty].
rpc InstantiateWorkflowTemplate(InstantiateWorkflowTemplateRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta2/{name=projects/*/regions/*/workflowTemplates/*}:instantiate"
body: "*"
additional_bindings {
post: "/v1beta2/{name=projects/*/locations/*/workflowTemplates/*}:instantiate"
body: "*"
}
};
}
// Instantiates a template and begins execution.
//
// This method is equivalent to executing the sequence
// [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
// [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate].
//
// The returned Operation can be used to track execution of
// workflow by polling
// [operations.get][google.longrunning.Operations.GetOperation].
// The Operation will complete when entire workflow is finished.
//
// The running workflow can be aborted via
// [operations.cancel][google.longrunning.Operations.CancelOperation].
// This will cause any inflight jobs to be cancelled and workflow-owned
// clusters to be deleted.
//
// The [Operation.metadata][google.longrunning.Operation.metadata] will be
// [WorkflowMetadata][google.cloud.dataproc.v1beta2.WorkflowMetadata].
//
// On successful completion,
// [Operation.response][google.longrunning.Operation.response] will be
// [Empty][google.protobuf.Empty].
rpc InstantiateInlineWorkflowTemplate(InstantiateInlineWorkflowTemplateRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta2/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline"
body: "template"
additional_bindings {
post: "/v1beta2/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline"
body: "template"
}
};
}
// Updates (replaces) workflow template. The updated template
// must contain version that matches the current server version.
rpc UpdateWorkflowTemplate(UpdateWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
put: "/v1beta2/{template.name=projects/*/regions/*/workflowTemplates/*}"
body: "template"
additional_bindings {
put: "/v1beta2/{template.name=projects/*/locations/*/workflowTemplates/*}"
body: "template"
}
};
}
// Lists workflows that match the specified filter in the request.
rpc ListWorkflowTemplates(ListWorkflowTemplatesRequest) returns (ListWorkflowTemplatesResponse) {
option (google.api.http) = {
get: "/v1beta2/{parent=projects/*/regions/*}/workflowTemplates"
additional_bindings {
get: "/v1beta2/{parent=projects/*/locations/*}/workflowTemplates"
}
};
}
// Deletes a workflow template. It does not cancel in-progress workflows.
rpc DeleteWorkflowTemplate(DeleteWorkflowTemplateRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1beta2/{name=projects/*/regions/*/workflowTemplates/*}"
additional_bindings {
delete: "/v1beta2/{name=projects/*/locations/*/workflowTemplates/*}"
}
};
}
}
// A Cloud Dataproc workflow template resource.
message WorkflowTemplate {
// Required. The template id.
//
// The id must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), and hyphens (-). Cannot begin or end with underscore
// or hyphen. Must consist of between 3 and 50 characters.
string id = 2;
// Output only. The "resource name" of the template, as described
// in https://cloud.google.com/apis/design/resource_names of the form
// `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
string name = 1;
// Optional. Used to perform a consistent read-modify-write.
//
// This field should be left blank for a `CreateWorkflowTemplate` request. It
// is required for an `UpdateWorkflowTemplate` request, and must match the
// current server version. A typical update template flow would fetch the
// current template with a `GetWorkflowTemplate` request, which will return
// the current template with the `version` field filled in with the
// current server version. The user updates other fields in the template,
// then returns it as part of the `UpdateWorkflowTemplate` request.
int32 version = 3;
// Output only. The time template was created.
google.protobuf.Timestamp create_time = 4;
// Output only. The time template was last updated.
google.protobuf.Timestamp update_time = 5;
// Optional. The labels to associate with this template. These labels
// will be propagated to all jobs and clusters created by the workflow
// instance.
//
// Label **keys** must contain 1 to 63 characters, and must conform to
// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
//
// Label **values** may be empty, but, if present, must contain 1 to 63
// characters, and must conform to
// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
//
// No more than 32 labels can be associated with a template.
map<string, string> labels = 6;
// Required. WorkflowTemplate scheduling information.
WorkflowTemplatePlacement placement = 7;
// Required. The Directed Acyclic Graph of Jobs to submit.
repeated OrderedJob jobs = 8;
}
// Specifies workflow execution target.
//
// Either `managed_cluster` or `cluster_selector` is required.
message WorkflowTemplatePlacement {
// Required. Specifies where workflow executes; either on a managed
// cluster or an existing cluster chosen by labels.
oneof placement {
// Optional. A cluster that is managed by the workflow.
ManagedCluster managed_cluster = 1;
// Optional. A selector that chooses target cluster for jobs based
// on metadata.
//
// The selector is evaluated at the time each job is submitted.
ClusterSelector cluster_selector = 2;
}
}
// Cluster that is managed by the workflow.
message ManagedCluster {
// Required. The cluster name prefix. A unique cluster name will be formed by
// appending a random suffix.
//
// The name must contain only lower-case letters (a-z), numbers (0-9),
// and hyphens (-). Must begin with a letter. Cannot begin or end with
// hyphen. Must consist of between 2 and 35 characters.
string cluster_name = 2;
// Required. The cluster configuration.
ClusterConfig config = 3;
// Optional. The labels to associate with this cluster.
//
// Label keys must be between 1 and 63 characters long, and must conform to
// the following PCRE regular expression:
// [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
//
// Label values must be between 1 and 63 characters long, and must conform to
// the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
//
// No more than 32 labels can be associated with a given cluster.
map<string, string> labels = 4;
}
// A selector that chooses target cluster for jobs based on metadata.
message ClusterSelector {
// Optional. The zone where workflow process executes. This parameter does not
// affect the selection of the cluster.
//
// If unspecified, the zone of the first cluster matching the selector
// is used.
string zone = 1;
// Required. The cluster labels. Cluster must have all labels
// to match.
map<string, string> cluster_labels = 2;
}
// A job executed by the workflow.
message OrderedJob {
// Required. The step id. The id must be unique among all jobs
// within the template.
//
// The step id is used as prefix for job id, as job
// `goog-dataproc-workflow-step-id` label, and in
// [prerequisiteStepIds][google.cloud.dataproc.v1beta2.OrderedJob.prerequisite_step_ids] field from other
// steps.
//
// The id must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), and hyphens (-). Cannot begin or end with underscore
// or hyphen. Must consist of between 3 and 50 characters.
string step_id = 1;
// Required. The job definition.
oneof job_type {
// Job is a Hadoop job.
HadoopJob hadoop_job = 2;
// Job is a Spark job.
SparkJob spark_job = 3;
// Job is a Pyspark job.
PySparkJob pyspark_job = 4;
// Job is a Hive job.
HiveJob hive_job = 5;
// Job is a Pig job.
PigJob pig_job = 6;
// Job is a SparkSql job.
SparkSqlJob spark_sql_job = 7;
}
// Optional. The labels to associate with this job.
//
// Label keys must be between 1 and 63 characters long, and must conform to
// the following regular expression:
// [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
//
// Label values must be between 1 and 63 characters long, and must conform to
// the following regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
//
// No more than 32 labels can be associated with a given job.
map<string, string> labels = 8;
// Optional. Job scheduling configuration.
JobScheduling scheduling = 9;
// Optional. The optional list of prerequisite job step_ids.
// If not specified, the job will start at the beginning of workflow.
repeated string prerequisite_step_ids = 10;
}
// A Cloud Dataproc workflow template resource.
message WorkflowMetadata {
// The operation state.
enum State {
// Unused.
UNKNOWN = 0;
// The operation has been created.
PENDING = 1;
// The operation is running.
RUNNING = 2;
// The operation is done; either cancelled or completed.
DONE = 3;
}
// Output only. The "resource name" of the template.
string template = 1;
// Output only. The version of template at the time of
// workflow instantiation.
int32 version = 2;
// Output only. The create cluster operation metadata.
ClusterOperation create_cluster = 3;
// Output only. The workflow graph.
WorkflowGraph graph = 4;
// Output only. The delete cluster operation metadata.
ClusterOperation delete_cluster = 5;
// Output only. The workflow state.
State state = 6;
// Output only. The name of the managed cluster.
string cluster_name = 7;
// Map from parameter names to values that were used for those parameters.
map<string, string> parameters = 8;
}
// The cluster operation triggered by a workflow.
message ClusterOperation {
// Output only. The id of the cluster operation.
string operation_id = 1;
// Output only. Error, if operation failed.
string error = 2;
// Output only. Indicates the operation is done.
bool done = 3;
}
// The workflow graph.
message WorkflowGraph {
// Output only. The workflow nodes.
repeated WorkflowNode nodes = 1;
}
// The workflow node.
message WorkflowNode {
// The workflow node state.
enum NodeState {
// State is unspecified.
NODE_STATUS_UNSPECIFIED = 0;
// The node is awaiting prerequisite node to finish.
BLOCKED = 1;
// The node is runnable but not running.
RUNNABLE = 2;
// The node is running.
RUNNING = 3;
// The node completed successfully.
COMPLETED = 4;
// The node failed. A node can be marked FAILED because
// its ancestor or peer failed.
FAILED = 5;
}
// Output only. The name of the node.
string step_id = 1;
// Output only. Node's prerequisite nodes.
repeated string prerequisite_step_ids = 2;
// Output only. The job id; populated after the node enters RUNNING state.
string job_id = 3;
// Output only. The node state.
NodeState state = 5;
// Output only. The error detail.
string error = 6;
}
// A request to create a workflow template.
message CreateWorkflowTemplateRequest {
// Required. The "resource name" of the region, as described
// in https://cloud.google.com/apis/design/resource_names of the form
// `projects/{project_id}/regions/{region}`
string parent = 1;
// Required. The Dataproc workflow template to create.
WorkflowTemplate template = 2;
}
// A request to fetch a workflow template.
message GetWorkflowTemplateRequest {
// Required. The "resource name" of the workflow template, as described
// in https://cloud.google.com/apis/design/resource_names of the form
// `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
string name = 1;
// Optional. The version of workflow template to retrieve. Only previously
// instatiated versions can be retrieved.
//
// If unspecified, retrieves the current version.
int32 version = 2;
}
// A request to instantiate a workflow template.
message InstantiateWorkflowTemplateRequest {
// Required. The "resource name" of the workflow template, as described
// in https://cloud.google.com/apis/design/resource_names of the form
// `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
string name = 1;
// Optional. The version of workflow template to instantiate. If specified,
// the workflow will be instantiated only if the current version of
// the workflow template has the supplied version.
//
// This option cannot be used to instantiate a previous version of
// workflow template.
int32 version = 2;
// Optional. A tag that prevents multiple concurrent workflow
// instances with the same tag from running. This mitigates risk of
// concurrent instances started due to retries.
//
// It is recommended to always set this value to a
// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
//
// The tag must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), and hyphens (-). The maximum length is 40 characters.
string instance_id = 3;
}
// A request to instantiate an inline workflow template.
message InstantiateInlineWorkflowTemplateRequest {
// Required. The "resource name" of the workflow template region, as described
// in https://cloud.google.com/apis/design/resource_names of the form
// `projects/{project_id}/regions/{region}`
string parent = 1;
// Required. The workflow template to instantiate.
WorkflowTemplate template = 2;
// Optional. A tag that prevents multiple concurrent workflow
// instances with the same tag from running. This mitigates risk of
// concurrent instances started due to retries.
//
// It is recommended to always set this value to a
// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
//
// The tag must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), and hyphens (-). The maximum length is 40 characters.
string instance_id = 3;
}
// A request to update a workflow template.
message UpdateWorkflowTemplateRequest {
// Required. The updated workflow template.
//
// The `template.version` field must match the current version.
WorkflowTemplate template = 1;
}
// A request to list workflow templates in a project.
message ListWorkflowTemplatesRequest {
// Required. The "resource name" of the region, as described
// in https://cloud.google.com/apis/design/resource_names of the form
// `projects/{project_id}/regions/{region}`
string parent = 1;
// Optional. The maximum number of results to return in each response.
int32 page_size = 2;
// Optional. The page token, returned by a previous call, to request the
// next page of results.
string page_token = 3;
}
// A response to a request to list workflow templates in a project.
message ListWorkflowTemplatesResponse {
// Output only. WorkflowTemplates list.
repeated WorkflowTemplate templates = 1;
// Output only. This token is included in the response if there are more results
// to fetch. To fetch additional results, provide this value as the
// page_token in a subsequent <code>ListWorkflowTemplatesRequest</code>.
string next_page_token = 2;
}
// A request to delete a workflow template.
//
// Currently started workflows will remain running.
message DeleteWorkflowTemplateRequest {
// Required. The "resource name" of the workflow template, as described
// in https://cloud.google.com/apis/design/resource_names of the form
// `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
string name = 1;
// Optional. The version of workflow template to delete. If specified,
// will only delete the template if the current server version matches
// specified version.
int32 version = 2;
}

View File

@@ -0,0 +1,330 @@
// Copyright 2018 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.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "AgentProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// Agents are best described as Natural Language Understanding (NLU) modules
// that transform user requests into actionable data. You can include agents
// in your app, product, or service to determine user intent and respond to the
// user in a natural way.
//
// After you create an agent, you can add [Intents][google.cloud.dialogflow.v2.Intents], [Contexts][google.cloud.dialogflow.v2.Contexts],
// [Entity Types][google.cloud.dialogflow.v2.EntityTypes], [Webhooks][google.cloud.dialogflow.v2.WebhookRequest], and so on to
// manage the flow of a conversation and match user input to predefined intents
// and actions.
//
// You can create an agent using both Dialogflow Standard Edition and
// Dialogflow Enterprise Edition. For details, see
// [Dialogflow Editions](/dialogflow-enterprise/docs/editions).
//
// You can save your agent for backup or versioning by exporting the agent by
// using the [ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent] method. You can import a saved
// agent by using the [ImportAgent][google.cloud.dialogflow.v2.Agents.ImportAgent] method.
//
// Dialogflow provides several
// [prebuilt agents](https://dialogflow.com/docs/prebuilt-agents) for common
// conversation scenarios such as determining a date and time, converting
// currency, and so on.
//
// For more information about agents, see the
// [Dialogflow documentation](https://dialogflow.com/docs/agents).
service Agents {
// Retrieves the specified agent.
rpc GetAgent(GetAgentRequest) returns (Agent) {
option (google.api.http) = {
get: "/v2/{parent=projects/*}/agent"
};
}
// Returns the list of agents.
//
// Since there is at most one conversational agent per project, this method is
// useful primarily for listing all agents across projects the caller has
// access to. One can achieve that with a wildcard project collection id "-".
// Refer to [List
// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
rpc SearchAgents(SearchAgentsRequest) returns (SearchAgentsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*}/agent:search"
};
}
// Trains the specified agent.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc TrainAgent(TrainAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/agent:train"
body: "*"
};
}
// Exports the specified agent to a ZIP file.
//
// Operation <response: [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/agent:export"
body: "*"
};
}
// Imports the specified agent from a ZIP file.
//
// Uploads new intents and entity types without deleting the existing ones.
// Intents and entity types with the same name are replaced with the new
// versions from ImportAgentRequest.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc ImportAgent(ImportAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/agent:import"
body: "*"
};
}
// Restores the specified agent from a ZIP file.
//
// Replaces the current agent version with a new one. All the intents and
// entity types in the older version are deleted.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/agent:restore"
body: "*"
};
}
}
// Represents a conversational agent.
message Agent {
// Match mode determines how intents are detected from user queries.
enum MatchMode {
// Not specified.
MATCH_MODE_UNSPECIFIED = 0;
// Best for agents with a small number of examples in intents and/or wide
// use of templates syntax and composite entities.
MATCH_MODE_HYBRID = 1;
// Can be used for agents with a large number of examples in intents,
// especially the ones using @sys.any or very large developer entities.
MATCH_MODE_ML_ONLY = 2;
}
// Required. The project of this agent.
// Format: `projects/<Project ID>`.
string parent = 1;
// Required. The name of this agent.
string display_name = 2;
// Required. The default language of the agent as a language tag. See
// [Language Support](https://dialogflow.com/docs/reference/language) for a
// list of the currently supported language codes.
// This field cannot be set by the `Update` method.
string default_language_code = 3;
// Optional. The list of all languages supported by this agent (except for the
// `default_language_code`).
repeated string supported_language_codes = 4;
// Required. The time zone of this agent from the
// [time zone database](https://www.iana.org/time-zones), e.g.,
// America/New_York, Europe/Paris.
string time_zone = 5;
// Optional. The description of this agent.
// The maximum length is 500 characters. If exceeded, the request is rejected.
string description = 6;
// Optional. The URI of the agent's avatar.
// Avatars are used throughout the Dialogflow console and in the self-hosted
// [Web Demo](https://dialogflow.com/docs/integrations/web-demo) integration.
string avatar_uri = 7;
// Optional. Determines whether this agent should log conversation queries.
bool enable_logging = 8;
// Optional. Determines how intents are detected from user queries.
MatchMode match_mode = 9;
// Optional. To filter out false positive results and still get variety in
// matched natural language inputs for your agent, you can tune the machine
// learning classification threshold. If the returned score value is less than
// the threshold value, then a fallback intent is be triggered or, if there
// are no fallback intents defined, no intent will be triggered. The score
// values range from 0.0 (completely uncertain) to 1.0 (completely certain).
// If set to 0.0, the default of 0.3 is used.
float classification_threshold = 10;
}
// The request message for [Agents.GetAgent][google.cloud.dialogflow.v2.Agents.GetAgent].
message GetAgentRequest {
// Required. The project that the agent to fetch is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
}
// The request message for [Agents.SearchAgents][google.cloud.dialogflow.v2.Agents.SearchAgents].
message SearchAgentsRequest {
// Required. The project to list agents from.
// Format: `projects/<Project ID or '-'>`.
string parent = 1;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 2;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 3;
}
// The response message for [Agents.SearchAgents][google.cloud.dialogflow.v2.Agents.SearchAgents].
message SearchAgentsResponse {
// The list of agents. There will be a maximum number of items returned based
// on the page_size field in the request.
repeated Agent agents = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [Agents.TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent].
message TrainAgentRequest {
// Required. The project that the agent to train is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
}
// The request message for [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent].
message ExportAgentRequest {
// Required. The project that the agent to export is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
// Optional. The Google Cloud Storage URI to export the agent to.
// Note: The URI must start with
// "gs://". If left unspecified, the serialized agent is returned inline.
string agent_uri = 2;
}
// The response message for [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent].
message ExportAgentResponse {
// Required. The exported agent.
oneof agent {
// The URI to a file containing the exported agent. This field is populated
// only if `agent_uri` is specified in `ExportAgentRequest`.
string agent_uri = 1;
// The exported agent.
//
// Example for how to export an agent to a zip file via a command line:
//
// curl \
// 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:export'\
// -X POST \
// -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
// -H 'Accept: application/json' \
// -H 'Content-Type: application/json' \
// --compressed \
// --data-binary '{}' \
// | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/' \
// | base64 --decode > <agent zip file>
bytes agent_content = 2;
}
}
// The request message for [Agents.ImportAgent][google.cloud.dialogflow.v2.Agents.ImportAgent].
message ImportAgentRequest {
// Required. The project that the agent to import is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
// Required. The agent to import.
oneof agent {
// The URI to a Google Cloud Storage file containing the agent to import.
// Note: The URI must start with "gs://".
string agent_uri = 2;
// The agent to import.
//
// Example for how to import an agent via the command line:
//
// curl \
// 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:import\
// -X POST \
// -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
// -H 'Accept: application/json' \
// -H 'Content-Type: application/json' \
// --compressed \
// --data-binary "{
// 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
// }"
bytes agent_content = 3;
}
}
// The request message for [Agents.RestoreAgent][google.cloud.dialogflow.v2.Agents.RestoreAgent].
message RestoreAgentRequest {
// Required. The project that the agent to restore is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
// Required. The agent to restore.
oneof agent {
// The URI to a Google Cloud Storage file containing the agent to restore.
// Note: The URI must start with "gs://".
string agent_uri = 2;
// The agent to restore.
//
// Example for how to restore an agent via the command line:
//
// curl \
// 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:restore\
// -X POST \
// -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
// -H 'Accept: application/json' \
// -H 'Content-Type: application/json' \
// --compressed \
// --data-binary "{
// 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
// }" \
bytes agent_content = 3;
}
}

View File

@@ -0,0 +1,177 @@
// Copyright 2018 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.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "ContextProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// A context represents additional information included with user input or with
// an intent returned by the Dialogflow API. Contexts are helpful for
// differentiating user input which may be vague or have a different meaning
// depending on additional details from your application such as user setting
// and preferences, previous user input, where the user is in your application,
// geographic location, and so on.
//
// You can include contexts as input parameters of a
// [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) request,
// or as output contexts included in the returned intent.
// Contexts expire when an intent is matched, after the number of `DetectIntent`
// requests specified by the `lifespan_count` parameter, or after 10 minutes
// if no intents are matched for a `DetectIntent` request.
//
// For more information about contexts, see the
// [Dialogflow documentation](https://dialogflow.com/docs/contexts).
service Contexts {
// Returns the list of all contexts in the specified session.
rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/agent/sessions/*}/contexts"
};
}
// Retrieves the specified context.
rpc GetContext(GetContextRequest) returns (Context) {
option (google.api.http) = {
get: "/v2/{name=projects/*/agent/sessions/*/contexts/*}"
};
}
// Creates a context.
rpc CreateContext(CreateContextRequest) returns (Context) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent/sessions/*}/contexts"
body: "context"
};
}
// Updates the specified context.
rpc UpdateContext(UpdateContextRequest) returns (Context) {
option (google.api.http) = {
patch: "/v2/{context.name=projects/*/agent/sessions/*/contexts/*}"
body: "context"
};
}
// Deletes the specified context.
rpc DeleteContext(DeleteContextRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/agent/sessions/*/contexts/*}"
};
}
// Deletes all active contexts in the specified session.
rpc DeleteAllContexts(DeleteAllContextsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{parent=projects/*/agent/sessions/*}/contexts"
};
}
}
// Represents a context.
message Context {
// Required. The unique identifier of the context. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`.
string name = 1;
// Optional. The number of conversational query requests after which the
// context expires. If set to `0` (the default) the context expires
// immediately. Contexts expire automatically after 10 minutes even if there
// are no matching queries.
int32 lifespan_count = 2;
// Optional. The collection of parameters associated with this context.
// Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for
// syntax.
google.protobuf.Struct parameters = 3;
}
// The request message for [Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts].
message ListContextsRequest {
// Required. The session to list all contexts from.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
string parent = 1;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 2;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 3;
}
// The response message for [Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts].
message ListContextsResponse {
// The list of contexts. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated Context contexts = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [Contexts.GetContext][google.cloud.dialogflow.v2.Contexts.GetContext].
message GetContextRequest {
// Required. The name of the context. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`.
string name = 1;
}
// The request message for [Contexts.CreateContext][google.cloud.dialogflow.v2.Contexts.CreateContext].
message CreateContextRequest {
// Required. The session to create a context for.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
string parent = 1;
// Required. The context to create.
Context context = 2;
}
// The request message for [Contexts.UpdateContext][google.cloud.dialogflow.v2.Contexts.UpdateContext].
message UpdateContextRequest {
// Required. The context to update.
Context context = 1;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 2;
}
// The request message for [Contexts.DeleteContext][google.cloud.dialogflow.v2.Contexts.DeleteContext].
message DeleteContextRequest {
// Required. The name of the context to delete. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`.
string name = 1;
}
// The request message for [Contexts.DeleteAllContexts][google.cloud.dialogflow.v2.Contexts.DeleteAllContexts].
message DeleteAllContextsRequest {
// Required. The name of the session to delete all contexts from. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>`.
string parent = 1;
}

View File

@@ -0,0 +1,419 @@
// Copyright 2018 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.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "EntityTypeProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// Entities are extracted from user input and represent parameters that are
// meaningful to your application. For example, a date range, a proper name
// such as a geographic location or landmark, and so on. Entities represent
// actionable data for your application.
//
// When you define an entity, you can also include synonyms that all map to
// that entity. For example, "soft drink", "soda", "pop", and so on.
//
// There are three types of entities:
//
// * **System** - entities that are defined by the Dialogflow API for common
// data types such as date, time, currency, and so on. A system entity is
// represented by the `EntityType` type.
//
// * **Developer** - entities that are defined by you that represent
// actionable data that is meaningful to your application. For example,
// you could define a `pizza.sauce` entity for red or white pizza sauce,
// a `pizza.cheese` entity for the different types of cheese on a pizza,
// a `pizza.topping` entity for different toppings, and so on. A developer
// entity is represented by the `EntityType` type.
//
// * **User** - entities that are built for an individual user such as
// favorites, preferences, playlists, and so on. A user entity is
// represented by the [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] type.
//
// For more information about entity types, see the
// [Dialogflow documentation](https://dialogflow.com/docs/entities).
service EntityTypes {
// Returns the list of all entity types in the specified agent.
rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/agent}/entityTypes"
};
}
// Retrieves the specified entity type.
rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) {
option (google.api.http) = {
get: "/v2/{name=projects/*/agent/entityTypes/*}"
};
}
// Creates an entity type in the specified agent.
rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent}/entityTypes"
body: "entity_type"
};
}
// Updates the specified entity type.
rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) {
option (google.api.http) = {
patch: "/v2/{entity_type.name=projects/*/agent/entityTypes/*}"
body: "entity_type"
};
}
// Deletes the specified entity type.
rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/agent/entityTypes/*}"
};
}
// Updates/Creates multiple entity types in the specified agent.
//
// Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc BatchUpdateEntityTypes(BatchUpdateEntityTypesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent}/entityTypes:batchUpdate"
body: "*"
};
}
// Deletes entity types in the specified agent.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc BatchDeleteEntityTypes(BatchDeleteEntityTypesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent}/entityTypes:batchDelete"
body: "*"
};
}
// Creates multiple new entities in the specified entity type (extends the
// existing collection of entries).
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
rpc BatchCreateEntities(BatchCreateEntitiesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate"
body: "*"
};
}
// Updates entities in the specified entity type (replaces the existing
// collection of entries).
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc BatchUpdateEntities(BatchUpdateEntitiesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate"
body: "*"
};
}
// Deletes entities in the specified entity type.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc BatchDeleteEntities(BatchDeleteEntitiesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete"
body: "*"
};
}
}
// Represents an entity type.
// Entity types serve as a tool for extracting parameter values from natural
// language queries.
message EntityType {
// Optional. Represents an entity.
message Entity {
// Required.
// For `KIND_MAP` entity types:
// A canonical name to be used in place of synonyms.
// For `KIND_LIST` entity types:
// A string that can contain references to other entity types (with or
// without aliases).
string value = 1;
// Required. A collection of synonyms. For `KIND_LIST` entity types this
// must contain exactly one synonym equal to `value`.
repeated string synonyms = 2;
}
// Represents kinds of entities.
enum Kind {
// Not specified. This value should be never used.
KIND_UNSPECIFIED = 0;
// Map entity types allow mapping of a group of synonyms to a canonical
// value.
KIND_MAP = 1;
// List entity types contain a set of entries that do not map to canonical
// values. However, list entity types can contain references to other entity
// types (with or without aliases).
KIND_LIST = 2;
}
// Represents different entity type expansion modes. Automated expansion
// allows an agent to recognize values that have not been explicitly listed in
// the entity (for example, new kinds of shopping list items).
enum AutoExpansionMode {
// Auto expansion disabled for the entity.
AUTO_EXPANSION_MODE_UNSPECIFIED = 0;
// Allows an agent to recognize values that have not been explicitly
// listed in the entity.
AUTO_EXPANSION_MODE_DEFAULT = 1;
}
// Required for all methods except `create` (`create` populates the name
// automatically.
// The unique identifier of the entity type. Format:
// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
string name = 1;
// Required. The name of the entity.
string display_name = 2;
// Required. Indicates the kind of entity type.
Kind kind = 3;
// Optional. Indicates whether the entity type can be automatically
// expanded.
AutoExpansionMode auto_expansion_mode = 4;
// Optional. The collection of entities associated with the entity type.
repeated Entity entities = 6;
}
// The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes].
message ListEntityTypesRequest {
// Required. The agent to list all entity types from.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Optional. The language to list entity synonyms for. If not specified,
// the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 3;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 4;
}
// The response message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes].
message ListEntityTypesResponse {
// The list of agent entity types. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated EntityType entity_types = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.v2.EntityTypes.GetEntityType].
message GetEntityTypeRequest {
// Required. The name of the entity type.
// Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
string name = 1;
// Optional. The language to retrieve entity synonyms for. If not specified,
// the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
}
// The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.v2.EntityTypes.CreateEntityType].
message CreateEntityTypeRequest {
// Required. The agent to create a entity type for.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Required. The entity type to create.
EntityType entity_type = 2;
// Optional. The language of entity synonyms defined in `entity_type`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
}
// The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType].
message UpdateEntityTypeRequest {
// Required. The entity type to update.
// Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
EntityType entity_type = 1;
// Optional. The language of entity synonyms defined in `entity_type`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 3;
}
// The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.v2.EntityTypes.DeleteEntityType].
message DeleteEntityTypeRequest {
// Required. The name of the entity type to delete.
// Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
string name = 1;
}
// The request message for [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes].
message BatchUpdateEntityTypesRequest {
// Required. The name of the agent to update or create entity types in.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Required. The source of the entity type batch.
//
// For each entity type in the batch:
// * If `name` is specified, we update an existing entity type.
// * If `name` is not specified, we create a new entity type.
oneof entity_type_batch {
// The URI to a Google Cloud Storage file containing entity types to update
// or create. The file format can either be a serialized proto (of
// EntityBatch type) or a JSON object. Note: The URI must start with
// "gs://".
string entity_type_batch_uri = 2;
// The collection of entity type to update or create.
EntityTypeBatch entity_type_batch_inline = 3;
}
// Optional. The language of entity synonyms defined in `entity_types`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 4;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 5;
}
// The response message for [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes].
message BatchUpdateEntityTypesResponse {
// The collection of updated or created entity types.
repeated EntityType entity_types = 1;
}
// The request message for [EntityTypes.BatchDeleteEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypes].
message BatchDeleteEntityTypesRequest {
// Required. The name of the agent to delete all entities types for. Format:
// `projects/<Project ID>/agent`.
string parent = 1;
// Required. The names entity types to delete. All names must point to the
// same agent as `parent`.
repeated string entity_type_names = 2;
}
// The request message for [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities].
message BatchCreateEntitiesRequest {
// Required. The name of the entity type to create entities in. Format:
// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
string parent = 1;
// Required. The collection of entities to create.
repeated EntityType.Entity entities = 2;
// Optional. The language of entity synonyms defined in `entities`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
}
// The response message for [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities].
message BatchUpdateEntitiesRequest {
// Required. The name of the entity type to update the entities in. Format:
// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
string parent = 1;
// Required. The collection of new entities to replace the existing entities.
repeated EntityType.Entity entities = 2;
// Optional. The language of entity synonyms defined in `entities`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 4;
}
// The request message for [EntityTypes.BatchDeleteEntities][google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntities].
message BatchDeleteEntitiesRequest {
// Required. The name of the entity type to delete entries for. Format:
// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
string parent = 1;
// Required. The canonical `values` of the entities to delete. Note that
// these are not fully-qualified names, i.e. they don't start with
// `projects/<Project ID>`.
repeated string entity_values = 2;
// Optional. The language of entity synonyms defined in `entities`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
}
// This message is a wrapper around a collection of entity types.
message EntityTypeBatch {
// A collection of entity types.
repeated EntityType entity_types = 1;
}

View File

@@ -0,0 +1,811 @@
// Copyright 2018 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.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/cloud/dialogflow/v2/context.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "IntentProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// An intent represents a mapping between input from a user and an action to
// be taken by your application. When you pass user input to the
// [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) method, the
// Dialogflow API analyzes the input and searches
// for a matching intent. If no match is found, the Dialogflow API returns a
// fallback intent (`is_fallback` = true).
//
// You can provide additional information for the Dialogflow API to use to
// match user input to an intent by adding the following to your intent.
//
// * **Contexts** - provide additional context for intent analysis. For
// example, if an intent is related to an object in your application that
// plays music, you can provide a context to determine when to match the
// intent if the user input is “turn it off”. You can include a context
// that matches the intent when there is previous user input of
// "play music", and not when there is previous user input of
// "turn on the light".
//
// * **Events** - allow for matching an intent by using an event name
// instead of user input. Your application can provide an event name and
// related parameters to the Dialogflow API to match an intent. For
// example, when your application starts, you can send a welcome event
// with a user name parameter to the Dialogflow API to match an intent with
// a personalized welcome message for the user.
//
// * **Training phrases** - provide examples of user input to train the
// Dialogflow API agent to better match intents.
//
// For more information about intents, see the
// [Dialogflow documentation](https://dialogflow.com/docs/intents).
service Intents {
// Returns the list of all intents in the specified agent.
rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/agent}/intents"
};
}
// Retrieves the specified intent.
rpc GetIntent(GetIntentRequest) returns (Intent) {
option (google.api.http) = {
get: "/v2/{name=projects/*/agent/intents/*}"
};
}
// Creates an intent in the specified agent.
rpc CreateIntent(CreateIntentRequest) returns (Intent) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent}/intents"
body: "intent"
};
}
// Updates the specified intent.
rpc UpdateIntent(UpdateIntentRequest) returns (Intent) {
option (google.api.http) = {
patch: "/v2/{intent.name=projects/*/agent/intents/*}"
body: "intent"
};
}
// Deletes the specified intent.
rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/agent/intents/*}"
};
}
// Updates/Creates multiple intents in the specified agent.
//
// Operation <response: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
rpc BatchUpdateIntents(BatchUpdateIntentsRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent}/intents:batchUpdate"
body: "*"
};
}
// Deletes intents in the specified agent.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
rpc BatchDeleteIntents(BatchDeleteIntentsRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent}/intents:batchDelete"
body: "*"
};
}
}
// Represents an intent.
// Intents convert a number of user expressions or patterns into an action. An
// action is an extraction of a user command or sentence semantics.
message Intent {
// Represents an example or template that the agent is trained on.
message TrainingPhrase {
// Represents a part of a training phrase.
message Part {
// Required. The text corresponding to the example or template,
// if there are no annotations. For
// annotated examples, it is the text for one of the example's parts.
string text = 1;
// Optional. The entity type name prefixed with `@`. This field is
// required for the annotated part of the text and applies only to
// examples.
string entity_type = 2;
// Optional. The parameter name for the value extracted from the
// annotated part of the example.
string alias = 3;
// Optional. Indicates whether the text was manually annotated by the
// developer.
bool user_defined = 4;
}
// Represents different types of training phrases.
enum Type {
// Not specified. This value should never be used.
TYPE_UNSPECIFIED = 0;
// Examples do not contain @-prefixed entity type names, but example parts
// can be annotated with entity types.
EXAMPLE = 1;
// Templates are not annotated with entity types, but they can contain
// @-prefixed entity type names as substrings.
TEMPLATE = 2;
}
// Required. The unique identifier of this training phrase.
string name = 1;
// Required. The type of the training phrase.
Type type = 2;
// Required. The collection of training phrase parts (can be annotated).
// Fields: `entity_type`, `alias` and `user_defined` should be populated
// only for the annotated parts of the training phrase.
repeated Part parts = 3;
// Optional. Indicates how many times this example or template was added to
// the intent. Each time a developer adds an existing sample by editing an
// intent or training, this counter is increased.
int32 times_added_count = 4;
}
// Represents intent parameters.
message Parameter {
// The unique identifier of this parameter.
string name = 1;
// Required. The name of the parameter.
string display_name = 2;
// Optional. The definition of the parameter value. It can be:
// - a constant string,
// - a parameter value defined as `$parameter_name`,
// - an original parameter value defined as `$parameter_name.original`,
// - a parameter value from some context defined as
// `#context_name.parameter_name`.
string value = 3;
// Optional. The default value to use when the `value` yields an empty
// result.
// Default values can be extracted from contexts by using the following
// syntax: `#context_name.parameter_name`.
string default_value = 4;
// Optional. The name of the entity type, prefixed with `@`, that
// describes values of the parameter. If the parameter is
// required, this must be provided.
string entity_type_display_name = 5;
// Optional. Indicates whether the parameter is required. That is,
// whether the intent cannot be completed without collecting the parameter
// value.
bool mandatory = 6;
// Optional. The collection of prompts that the agent can present to the
// user in order to collect value for the parameter.
repeated string prompts = 7;
// Optional. Indicates whether the parameter represents a list of values.
bool is_list = 8;
}
// Corresponds to the `Response` field in the Dialogflow console.
message Message {
// The text response message.
message Text {
// Optional. The collection of the agent's responses.
repeated string text = 1;
}
// The image response message.
message Image {
// Optional. The public URI to an image file.
string image_uri = 1;
// Optional. A text description of the image to be used for accessibility,
// e.g., screen readers.
string accessibility_text = 2;
}
// The quick replies response message.
message QuickReplies {
// Optional. The title of the collection of quick replies.
string title = 1;
// Optional. The collection of quick replies.
repeated string quick_replies = 2;
}
// The card response message.
message Card {
// Optional. Contains information about a button.
message Button {
// Optional. The text to show on the button.
string text = 1;
// Optional. The text to send back to the Dialogflow API or a URI to
// open.
string postback = 2;
}
// Optional. The title of the card.
string title = 1;
// Optional. The subtitle of the card.
string subtitle = 2;
// Optional. The public URI to an image file for the card.
string image_uri = 3;
// Optional. The collection of card buttons.
repeated Button buttons = 4;
}
// The simple response message containing speech or text.
message SimpleResponse {
// One of text_to_speech or ssml must be provided. The plain text of the
// speech output. Mutually exclusive with ssml.
string text_to_speech = 1;
// One of text_to_speech or ssml must be provided. Structured spoken
// response to the user in the SSML format. Mutually exclusive with
// text_to_speech.
string ssml = 2;
// Optional. The text to display.
string display_text = 3;
}
// The collection of simple response candidates.
// This message in `QueryResult.fulfillment_messages` and
// `WebhookResponse.fulfillment_messages` should contain only one
// `SimpleResponse`.
message SimpleResponses {
// Required. The list of simple responses.
repeated SimpleResponse simple_responses = 1;
}
// The basic card message. Useful for displaying information.
message BasicCard {
// The button object that appears at the bottom of a card.
message Button {
// Opens the given URI.
message OpenUriAction {
// Required. The HTTP or HTTPS scheme URI.
string uri = 1;
}
// Required. The title of the button.
string title = 1;
// Required. Action to take when a user taps on the button.
OpenUriAction open_uri_action = 2;
}
// Optional. The title of the card.
string title = 1;
// Optional. The subtitle of the card.
string subtitle = 2;
// Required, unless image is present. The body text of the card.
string formatted_text = 3;
// Optional. The image for the card.
Image image = 4;
// Optional. The collection of card buttons.
repeated Button buttons = 5;
}
// The suggestion chip message that the user can tap to quickly post a reply
// to the conversation.
message Suggestion {
// Required. The text shown the in the suggestion chip.
string title = 1;
}
// The collection of suggestions.
message Suggestions {
// Required. The list of suggested replies.
repeated Suggestion suggestions = 1;
}
// The suggestion chip message that allows the user to jump out to the app
// or website associated with this agent.
message LinkOutSuggestion {
// Required. The name of the app or site this chip is linking to.
string destination_name = 1;
// Required. The URI of the app or site to open when the user taps the
// suggestion chip.
string uri = 2;
}
// The card for presenting a list of options to select from.
message ListSelect {
// An item in the list.
message Item {
// Required. Additional information about this option.
SelectItemInfo info = 1;
// Required. The title of the list item.
string title = 2;
// Optional. The main text describing the item.
string description = 3;
// Optional. The image to display.
Image image = 4;
}
// Optional. The overall title of the list.
string title = 1;
// Required. List items.
repeated Item items = 2;
}
// The card for presenting a carousel of options to select from.
message CarouselSelect {
// An item in the carousel.
message Item {
// Required. Additional info about the option item.
SelectItemInfo info = 1;
// Required. Title of the carousel item.
string title = 2;
// Optional. The body text of the card.
string description = 3;
// Optional. The image to display.
Image image = 4;
}
// Required. Carousel items.
repeated Item items = 1;
}
// Additional info about the select item for when it is triggered in a
// dialog.
message SelectItemInfo {
// Required. A unique key that will be sent back to the agent if this
// response is given.
string key = 1;
// Optional. A list of synonyms that can also be used to trigger this
// item in dialog.
repeated string synonyms = 2;
}
// Represents different platforms that a rich message can be intended for.
enum Platform {
// Not specified.
PLATFORM_UNSPECIFIED = 0;
// Facebook.
FACEBOOK = 1;
// Slack.
SLACK = 2;
// Telegram.
TELEGRAM = 3;
// Kik.
KIK = 4;
// Skype.
SKYPE = 5;
// Line.
LINE = 6;
// Viber.
VIBER = 7;
// Actions on Google.
// When using Actions on Google, you can choose one of the specific
// Intent.Message types that mention support for Actions on Google,
// or you can use the advanced Intent.Message.payload field.
// The payload field provides access to AoG features not available in the
// specific message types.
// If using the Intent.Message.payload field, it should have a structure
// similar to the JSON message shown here. For more information, see
// [Actions on Google Webhook
// Format](https://developers.google.com/actions/dialogflow/webhook)
// <pre>{
// "expectUserResponse": true,
// "isSsml": false,
// "noInputPrompts": [],
// "richResponse": {
// "items": [
// {
// "simpleResponse": {
// "displayText": "hi",
// "textToSpeech": "hello"
// }
// }
// ],
// "suggestions": [
// {
// "title": "Say this"
// },
// {
// "title": "or this"
// }
// ]
// },
// "systemIntent": {
// "data": {
// "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
// "listSelect": {
// "items": [
// {
// "optionInfo": {
// "key": "key1",
// "synonyms": [
// "key one"
// ]
// },
// "title": "must not be empty, but unique"
// },
// {
// "optionInfo": {
// "key": "key2",
// "synonyms": [
// "key two"
// ]
// },
// "title": "must not be empty, but unique"
// }
// ]
// }
// },
// "intent": "actions.intent.OPTION"
// }
// }</pre>
ACTIONS_ON_GOOGLE = 8;
}
// Required. The rich response message.
oneof message {
// The text response.
Text text = 1;
// The image response.
Image image = 2;
// The quick replies response.
QuickReplies quick_replies = 3;
// The card response.
Card card = 4;
// Returns a response containing a custom, platform-specific payload.
// See the Intent.Message.Platform type for a description of the
// structure that may be required for your platform.
google.protobuf.Struct payload = 5;
// The voice and text-only responses for Actions on Google.
SimpleResponses simple_responses = 7;
// The basic card response for Actions on Google.
BasicCard basic_card = 8;
// The suggestion chips for Actions on Google.
Suggestions suggestions = 9;
// The link out suggestion chip for Actions on Google.
LinkOutSuggestion link_out_suggestion = 10;
// The list card response for Actions on Google.
ListSelect list_select = 11;
// The carousel card response for Actions on Google.
CarouselSelect carousel_select = 12;
}
// Optional. The platform that this message is intended for.
Platform platform = 6;
}
// Represents a single followup intent in the chain.
message FollowupIntentInfo {
// The unique identifier of the followup intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string followup_intent_name = 1;
// The unique identifier of the followup intent parent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string parent_followup_intent_name = 2;
}
// Represents the different states that webhooks can be in.
enum WebhookState {
// Webhook is disabled in the agent and in the intent.
WEBHOOK_STATE_UNSPECIFIED = 0;
// Webhook is enabled in the agent and in the intent.
WEBHOOK_STATE_ENABLED = 1;
// Webhook is enabled in the agent and in the intent. Also, each slot
// filling prompt is forwarded to the webhook.
WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2;
}
// Required for all methods except `create` (`create` populates the name
// automatically.
// The unique identifier of this intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string name = 1;
// Required. The name of this intent.
string display_name = 2;
// Required. Indicates whether webhooks are enabled for the intent.
WebhookState webhook_state = 6;
// Optional. The priority of this intent. Higher numbers represent higher
// priorities. Zero or negative numbers mean that the intent is disabled.
int32 priority = 3;
// Optional. Indicates whether this is a fallback intent.
bool is_fallback = 4;
// Optional. Indicates whether Machine Learning is disabled for the intent.
// Note: If `ml_diabled` setting is set to true, then this intent is not
// taken into account during inference in `ML ONLY` match mode. Also,
// auto-markup in the UI is turned off.
bool ml_disabled = 19;
// Optional. The list of context names required for this intent to be
// triggered.
// Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
repeated string input_context_names = 7;
// Optional. The collection of event names that trigger the intent.
// If the collection of input contexts is not empty, all of the contexts must
// be present in the active user session for an event to trigger this intent.
repeated string events = 8;
// Optional. The collection of examples/templates that the agent is
// trained on.
repeated TrainingPhrase training_phrases = 9;
// Optional. The name of the action associated with the intent.
string action = 10;
// Optional. The collection of contexts that are activated when the intent
// is matched. Context messages in this collection should not set the
// parameters field. Setting the `lifespan_count` to 0 will reset the context
// when the intent is matched.
// Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
repeated Context output_contexts = 11;
// Optional. Indicates whether to delete all contexts in the current
// session when this intent is matched.
bool reset_contexts = 12;
// Optional. The collection of parameters associated with the intent.
repeated Parameter parameters = 13;
// Optional. The collection of rich messages corresponding to the
// `Response` field in the Dialogflow console.
repeated Message messages = 14;
// Optional. The list of platforms for which the first response will be
// taken from among the messages assigned to the DEFAULT_PLATFORM.
repeated Message.Platform default_response_platforms = 15;
// The unique identifier of the root intent in the chain of followup intents.
// It identifies the correct followup intents chain for this intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string root_followup_intent_name = 16;
// The unique identifier of the parent intent in the chain of followup
// intents.
// It identifies the parent followup intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string parent_followup_intent_name = 17;
// Optional. Collection of information about all followup intents that have
// name of this intent as a root_name.
repeated FollowupIntentInfo followup_intent_info = 18;
}
// The request message for [Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents].
message ListIntentsRequest {
// Required. The agent to list all intents from.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Optional. The language to list training phrases, parameters and rich
// messages for. If not specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent before they can be used.
string language_code = 2;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 3;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 4;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 5;
}
// The response message for [Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents].
message ListIntentsResponse {
// The list of agent intents. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated Intent intents = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [Intents.GetIntent][google.cloud.dialogflow.v2.Intents.GetIntent].
message GetIntentRequest {
// Required. The name of the intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string name = 1;
// Optional. The language to retrieve training phrases, parameters and rich
// messages for. If not specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 3;
}
// The request message for [Intents.CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent].
message CreateIntentRequest {
// Required. The agent to create a intent for.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Required. The intent to create.
Intent intent = 2;
// Optional. The language of training phrases, parameters and rich messages
// defined in `intent`. If not specified, the agent's default language is
// used. [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 4;
}
// The request message for [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent].
message UpdateIntentRequest {
// Required. The intent to update.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
Intent intent = 1;
// Optional. The language of training phrases, parameters and rich messages
// defined in `intent`. If not specified, the agent's default language is
// used. [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 3;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 4;
}
// The request message for [Intents.DeleteIntent][google.cloud.dialogflow.v2.Intents.DeleteIntent].
message DeleteIntentRequest {
// Required. The name of the intent to delete.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string name = 1;
}
// The request message for [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents].
message BatchUpdateIntentsRequest {
// Required. The name of the agent to update or create intents in.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Required. The source of the intent batch.
oneof intent_batch {
// The URI to a Google Cloud Storage file containing intents to update or
// create. The file format can either be a serialized proto (of IntentBatch
// type) or JSON object. Note: The URI must start with "gs://".
string intent_batch_uri = 2;
// The collection of intents to update or create.
IntentBatch intent_batch_inline = 3;
}
// Optional. The language of training phrases, parameters and rich messages
// defined in `intents`. If not specified, the agent's default language is
// used. [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 4;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 5;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 6;
}
// The response message for [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents].
message BatchUpdateIntentsResponse {
// The collection of updated or created intents.
repeated Intent intents = 1;
}
// The request message for [Intents.BatchDeleteIntents][google.cloud.dialogflow.v2.Intents.BatchDeleteIntents].
message BatchDeleteIntentsRequest {
// Required. The name of the agent to delete all entities types for. Format:
// `projects/<Project ID>/agent`.
string parent = 1;
// Required. The collection of intents to delete. Only intent `name` must be
// filled in.
repeated Intent intents = 2;
}
// This message is a wrapper around a collection of intents.
message IntentBatch {
// A collection of intents.
repeated Intent intents = 1;
}
// Represents the options for views of an intent.
// An intent can be a sizable object. Therefore, we provide a resource view that
// does not return training phrases in the response by default.
enum IntentView {
// Training phrases field is not populated in the response.
INTENT_VIEW_UNSPECIFIED = 0;
// All fields are populated.
INTENT_VIEW_FULL = 1;
}

View File

@@ -0,0 +1,478 @@
// Copyright 2018 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.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/cloud/dialogflow/v2/context.proto";
import "google/cloud/dialogflow/v2/intent.proto";
import "google/cloud/dialogflow/v2/session_entity_type.proto";
import "google/protobuf/struct.proto";
import "google/rpc/status.proto";
import "google/type/latlng.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "SessionProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// A session represents an interaction with a user. You retrieve user input
// and pass it to the [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) method to determine
// user intent and respond.
service Sessions {
// Processes a natural language query and returns structured, actionable data
// as a result. This method is not idempotent, because it may cause contexts
// and session entity types to be updated, which in turn might affect
// results of future queries.
rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) {
option (google.api.http) = {
post: "/v2/{session=projects/*/agent/sessions/*}:detectIntent"
body: "*"
};
}
// Processes a natural language query in audio format in a streaming fashion
// and returns structured, actionable data as a result. This method is only
// available via the gRPC API (not REST).
rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse);
}
// The request to detect user's intent.
message DetectIntentRequest {
// Required. The name of the session this query is sent to. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>`. It's up to the API
// caller to choose an appropriate session ID. It can be a random number or
// some type of user identifier (preferably hashed). The length of the session
// ID must not exceed 36 bytes.
string session = 1;
// Optional. The parameters of this query.
QueryParameters query_params = 2;
// Required. The input specification. It can be set to:
//
// 1. an audio config
// which instructs the speech recognizer how to process the speech audio,
//
// 2. a conversational query in the form of text, or
//
// 3. an event that specifies which intent to trigger.
QueryInput query_input = 3;
// Optional. The natural language speech audio to be processed. This field
// should be populated iff `query_input` is set to an input audio config.
// A single request can contain up to 1 minute of speech audio data.
bytes input_audio = 5;
}
// The message returned from the DetectIntent method.
message DetectIntentResponse {
// The unique identifier of the response. It can be used to
// locate a response in the training example set or for reporting issues.
string response_id = 1;
// The results of the conversational query or event processing.
QueryResult query_result = 2;
// Specifies the status of the webhook request. `webhook_status`
// is never populated in webhook requests.
google.rpc.Status webhook_status = 3;
}
// Represents the parameters of the conversational query.
message QueryParameters {
// Optional. The time zone of this conversational query from the
// [time zone database](https://www.iana.org/time-zones), e.g.,
// America/New_York, Europe/Paris. If not provided, the time zone specified in
// agent settings is used.
string time_zone = 1;
// Optional. The geo location of this conversational query.
google.type.LatLng geo_location = 2;
// Optional. The collection of contexts to be activated before this query is
// executed.
repeated Context contexts = 3;
// Optional. Specifies whether to delete all contexts in the current session
// before the new ones are activated.
bool reset_contexts = 4;
// Optional. The collection of session entity types to replace or extend
// developer entities with for this query only. The entity synonyms apply
// to all languages.
repeated SessionEntityType session_entity_types = 5;
// Optional. This field can be used to pass custom data into the webhook
// associated with the agent. Arbitrary JSON objects are supported.
google.protobuf.Struct payload = 6;
}
// Represents the query input. It can contain either:
//
// 1. An audio config which
// instructs the speech recognizer how to process the speech audio.
//
// 2. A conversational query in the form of text,.
//
// 3. An event that specifies which intent to trigger.
message QueryInput {
// Required. The input specification.
oneof input {
// Instructs the speech recognizer how to process the speech audio.
InputAudioConfig audio_config = 1;
// The natural language text to be processed.
TextInput text = 2;
// The event to be processed.
EventInput event = 3;
}
}
// Represents the result of conversational query or event processing.
message QueryResult {
// The original conversational query text:
// - If natural language text was provided as input, `query_text` contains
// a copy of the input.
// - If natural language speech audio was provided as input, `query_text`
// contains the speech recognition result. If speech recognizer produced
// multiple alternatives, a particular one is picked.
// - If an event was provided as input, `query_text` is not set.
string query_text = 1;
// The language that was triggered during intent detection.
// See [Language Support](https://dialogflow.com/docs/reference/language)
// for a list of the currently supported language codes.
string language_code = 15;
// The Speech recognition confidence between 0.0 and 1.0. A higher number
// indicates an estimated greater likelihood that the recognized words are
// correct. The default of 0.0 is a sentinel value indicating that confidence
// was not set.
//
// You should not rely on this field as it isn't guaranteed to be accurate, or
// even set. In particular this field isn't set in Webhook calls and for
// StreamingDetectIntent since the streaming endpoint has separate confidence
// estimates per portion of the audio in StreamingRecognitionResult.
float speech_recognition_confidence = 2;
// The action name from the matched intent.
string action = 3;
// The collection of extracted parameters.
google.protobuf.Struct parameters = 4;
// This field is set to:
// - `false` if the matched intent has required parameters and not all of
// the required parameter values have been collected.
// - `true` if all required parameter values have been collected, or if the
// matched intent doesn't contain any required parameters.
bool all_required_params_present = 5;
// The text to be pronounced to the user or shown on the screen.
string fulfillment_text = 6;
// The collection of rich messages to present to the user.
repeated Intent.Message fulfillment_messages = 7;
// If the query was fulfilled by a webhook call, this field is set to the
// value of the `source` field returned in the webhook response.
string webhook_source = 8;
// If the query was fulfilled by a webhook call, this field is set to the
// value of the `payload` field returned in the webhook response.
google.protobuf.Struct webhook_payload = 9;
// The collection of output contexts. If applicable,
// `output_contexts.parameters` contains entries with name
// `<parameter name>.original` containing the original parameter values
// before the query.
repeated Context output_contexts = 10;
// The intent that matched the conversational query. Some, not
// all fields are filled in this message, including but not limited to:
// `name`, `display_name` and `webhook_state`.
Intent intent = 11;
// The intent detection confidence. Values range from 0.0
// (completely uncertain) to 1.0 (completely certain).
float intent_detection_confidence = 12;
// The free-form diagnostic info. For example, this field
// could contain webhook call latency.
google.protobuf.Struct diagnostic_info = 14;
}
// The top-level message sent by the client to the
// `StreamingDetectIntent` method.
//
// Multiple request messages should be sent in order:
//
// 1. The first message must contain `session`, `query_input` plus optionally
// `query_params` and/or `single_utterance`. The message must not contain `input_audio`.
//
// 2. If `query_input` was set to a streaming input audio config,
// all subsequent messages must contain only `input_audio`.
// Otherwise, finish the request stream.
message StreamingDetectIntentRequest {
// Required. The name of the session the query is sent to.
// Format of the session name:
// `projects/<Project ID>/agent/sessions/<Session ID>`. Its up to the API
// caller to choose an appropriate <Session ID>. It can be a random number or
// some type of user identifier (preferably hashed). The length of the session
// ID must not exceed 36 characters.
string session = 1;
// Optional. The parameters of this query.
QueryParameters query_params = 2;
// Required. The input specification. It can be set to:
//
// 1. an audio config which instructs the speech recognizer how to process
// the speech audio,
//
// 2. a conversational query in the form of text, or
//
// 3. an event that specifies which intent to trigger.
QueryInput query_input = 3;
// Optional. If `false` (default), recognition does not cease until the
// client closes the stream.
// If `true`, the recognizer will detect a single spoken utterance in input
// audio. Recognition ceases when it detects the audio's voice has
// stopped or paused. In this case, once a detected intent is received, the
// client should close the stream and start a new request with a new stream as
// needed.
// This setting is ignored when `query_input` is a piece of text or an event.
bool single_utterance = 4;
// Optional. The input audio content to be recognized. Must be sent if
// `query_input` was set to a streaming input audio config. The complete audio
// over all streaming messages must not exceed 1 minute.
bytes input_audio = 6;
}
// The top-level message returned from the
// `StreamingDetectIntent` method.
//
// Multiple response messages can be returned in order:
//
// 1. If the input was set to streaming audio, the first one or more messages
// contain `recognition_result`. Each `recognition_result` represents a more
// complete transcript of what the user said. The last `recognition_result`
// has `is_final` set to `true`.
//
// 2. The next message contains `response_id`, `query_result`
// and optionally `webhook_status` if a WebHook was called.
message StreamingDetectIntentResponse {
// The unique identifier of the response. It can be used to
// locate a response in the training example set or for reporting issues.
string response_id = 1;
// The result of speech recognition.
StreamingRecognitionResult recognition_result = 2;
// The result of the conversational query or event processing.
QueryResult query_result = 3;
// Specifies the status of the webhook request.
google.rpc.Status webhook_status = 4;
}
// Contains a speech recognition result corresponding to a portion of the audio
// that is currently being processed or an indication that this is the end
// of the single requested utterance.
//
// Example:
//
// 1. transcript: "tube"
//
// 2. transcript: "to be a"
//
// 3. transcript: "to be"
//
// 4. transcript: "to be or not to be"
// is_final: true
//
// 5. transcript: " that's"
//
// 6. transcript: " that is"
//
// 7. recognition_event_type: `RECOGNITION_EVENT_END_OF_SINGLE_UTTERANCE`
//
// 8. transcript: " that is the question"
// is_final: true
//
// Only two of the responses contain final results (#4 and #8 indicated by
// `is_final: true`). Concatenating these generates the full transcript: "to be
// or not to be that is the question".
//
// In each response we populate:
//
// * for `MESSAGE_TYPE_TRANSCRIPT`: `transcript` and possibly `is_final`.
//
// * for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `event_type`.
message StreamingRecognitionResult {
// Type of the response message.
enum MessageType {
// Not specified. Should never be used.
MESSAGE_TYPE_UNSPECIFIED = 0;
// Message contains a (possibly partial) transcript.
TRANSCRIPT = 1;
// Event indicates that the server has detected the end of the user's speech
// utterance and expects no additional speech. Therefore, the server will
// not process additional audio (although it may subsequently return
// additional results). The client should stop sending additional audio
// data, half-close the gRPC connection, and wait for any additional results
// until the server closes the gRPC connection. This message is only sent if
// `single_utterance` was set to `true`, and is not used otherwise.
END_OF_SINGLE_UTTERANCE = 2;
}
// Type of the result message.
MessageType message_type = 1;
// Transcript text representing the words that the user spoke.
// Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;
// The default of 0.0 is a sentinel value indicating `confidence` was not set.
// If `false`, the `StreamingRecognitionResult` represents an
// interim result that may change. If `true`, the recognizer will not return
// any further hypotheses about this piece of the audio. May only be populated
// for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
bool is_final = 3;
// The Speech confidence between 0.0 and 1.0 for the current portion of audio.
// A higher number indicates an estimated greater likelihood that the
// recognized words are correct. The default of 0.0 is a sentinel value
// indicating that confidence was not set.
//
// This field is typically only provided if `is_final` is true and you should
// not rely on it being accurate or even set.
float confidence = 4;
}
// Instructs the speech recognizer how to process the audio content.
message InputAudioConfig {
// Required. Audio encoding of the audio content to process.
AudioEncoding audio_encoding = 1;
// Required. Sample rate (in Hertz) of the audio content sent in the query.
// Refer to [Cloud Speech API documentation](/speech/docs/basics) for more
// details.
int32 sample_rate_hertz = 2;
// Required. The language of the supplied audio. Dialogflow does not do
// translations. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
string language_code = 3;
// Optional. The collection of phrase hints which are used to boost accuracy
// of speech recognition.
// Refer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints)
// for more details.
repeated string phrase_hints = 4;
}
// Represents the natural language text to be processed.
message TextInput {
// Required. The UTF-8 encoded natural language text to be processed.
// Text length must not exceed 256 bytes.
string text = 1;
// Required. The language of this conversational query. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
string language_code = 2;
}
// Events allow for matching intents by event name instead of the natural
// language input. For instance, input `<event: { name: “welcome_event”,
// parameters: { name: “Sam” } }>` can trigger a personalized welcome response.
// The parameter `name` may be used by the agent in the response:
// `“Hello #welcome_event.name! What can I do for you today?”`.
message EventInput {
// Required. The unique identifier of the event.
string name = 1;
// Optional. The collection of parameters associated with the event.
google.protobuf.Struct parameters = 2;
// Required. The language of this query. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
string language_code = 3;
}
// Audio encoding of the audio content sent in the conversational query request.
// Refer to the [Cloud Speech API documentation](/speech/docs/basics) for more
// details.
enum AudioEncoding {
// Not specified.
AUDIO_ENCODING_UNSPECIFIED = 0;
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
AUDIO_ENCODING_LINEAR_16 = 1;
// [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
// Codec) is the recommended encoding because it is lossless (therefore
// recognition is not compromised) and requires only about half the
// bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and
// 24-bit samples, however, not all fields in `STREAMINFO` are supported.
AUDIO_ENCODING_FLAC = 2;
// 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
AUDIO_ENCODING_MULAW = 3;
// Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
AUDIO_ENCODING_AMR = 4;
// Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
AUDIO_ENCODING_AMR_WB = 5;
// Opus encoded audio frames in Ogg container
// ([OggOpus](https://wiki.xiph.org/OggOpus)).
// `sample_rate_hertz` must be 16000.
AUDIO_ENCODING_OGG_OPUS = 6;
// Although the use of lossy encodings is not recommended, if a very low
// bitrate encoding is required, `OGG_OPUS` is highly preferred over
// Speex encoding. The [Speex](https://speex.org/) encoding supported by
// Dialogflow API has a header byte in each block, as in MIME type
// `audio/x-speex-with-header-byte`.
// It is a variant of the RTP Speex encoding defined in
// [RFC 5574](https://tools.ietf.org/html/rfc5574).
// The stream is a sequence of blocks, one block per RTP packet. Each block
// starts with a byte containing the length of the block, in bytes, followed
// by one or more frames of Speex data, padded to an integral number of
// bytes (octets) as specified in RFC 5574. In other words, each RTP header
// is replaced with a single byte containing the block length. Only Speex
// wideband is supported. `sample_rate_hertz` must be 16000.
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
}

View File

@@ -0,0 +1,184 @@
// Copyright 2018 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.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/cloud/dialogflow/v2/entity_type.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "SessionEntityTypeProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// Entities are extracted from user input and represent parameters that are
// meaningful to your application. For example, a date range, a proper name
// such as a geographic location or landmark, and so on. Entities represent
// actionable data for your application.
//
// Session entity types are referred to as **User** entity types and are
// entities that are built for an individual user such as
// favorites, preferences, playlists, and so on. You can redefine a session
// entity type at the session level.
//
// For more information about entity types, see the
// [Dialogflow documentation](https://dialogflow.com/docs/entities).
service SessionEntityTypes {
// Returns the list of all session entity types in the specified session.
rpc ListSessionEntityTypes(ListSessionEntityTypesRequest) returns (ListSessionEntityTypesResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/agent/sessions/*}/entityTypes"
};
}
// Retrieves the specified session entity type.
rpc GetSessionEntityType(GetSessionEntityTypeRequest) returns (SessionEntityType) {
option (google.api.http) = {
get: "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}"
};
}
// Creates a session entity type.
rpc CreateSessionEntityType(CreateSessionEntityTypeRequest) returns (SessionEntityType) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent/sessions/*}/entityTypes"
body: "session_entity_type"
};
}
// Updates the specified session entity type.
rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest) returns (SessionEntityType) {
option (google.api.http) = {
patch: "/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}"
body: "session_entity_type"
};
}
// Deletes the specified session entity type.
rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}"
};
}
}
// Represents a session entity type.
//
// Extends or replaces a developer entity type at the user session level (we
// refer to the entity types defined at the agent level as "developer entity
// types").
//
// Note: session entity types apply to all queries, regardless of the language.
message SessionEntityType {
// The types of modifications for a session entity type.
enum EntityOverrideMode {
// Not specified. This value should be never used.
ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0;
// The collection of session entities overrides the collection of entities
// in the corresponding developer entity type.
ENTITY_OVERRIDE_MODE_OVERRIDE = 1;
// The collection of session entities extends the collection of entities in
// the corresponding developer entity type.
// Calls to `ListSessionEntityTypes`, `GetSessionEntityType`,
// `CreateSessionEntityType` and `UpdateSessionEntityType` return the full
// collection of entities from the developer entity type in the agent's
// default language and the session entity type.
ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2;
}
// Required. The unique identifier of this session entity type. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
// Display Name>`.
string name = 1;
// Required. Indicates whether the additional data should override or
// supplement the developer entity type definition.
EntityOverrideMode entity_override_mode = 2;
// Required. The collection of entities associated with this session entity
// type.
repeated EntityType.Entity entities = 3;
}
// The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes].
message ListSessionEntityTypesRequest {
// Required. The session to list all session entity types from.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
string parent = 1;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 2;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 3;
}
// The response message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes].
message ListSessionEntityTypesResponse {
// The list of session entity types. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated SessionEntityType session_entity_types = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityType].
message GetSessionEntityTypeRequest {
// Required. The name of the session entity type. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
// Display Name>`.
string name = 1;
}
// The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityType].
message CreateSessionEntityTypeRequest {
// Required. The session to create a session entity type for.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
string parent = 1;
// Required. The session entity type to create.
SessionEntityType session_entity_type = 2;
}
// The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityType].
message UpdateSessionEntityTypeRequest {
// Required. The entity type to update. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
// Display Name>`.
SessionEntityType session_entity_type = 1;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 2;
}
// The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityType].
message DeleteSessionEntityTypeRequest {
// Required. The name of the entity type to delete. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
// Display Name>`.
string name = 1;
}

View File

@@ -0,0 +1,111 @@
// Copyright 2018 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.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/cloud/dialogflow/v2/context.proto";
import "google/cloud/dialogflow/v2/intent.proto";
import "google/cloud/dialogflow/v2/session.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "WebhookProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// The request message for a webhook call.
message WebhookRequest {
// The unique identifier of detectIntent request session.
// Can be used to identify end-user inside webhook implementation.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
string session = 4;
// The unique identifier of the response. Contains the same value as
// `[Streaming]DetectIntentResponse.response_id`.
string response_id = 1;
// The result of the conversational query or event processing. Contains the
// same value as `[Streaming]DetectIntentResponse.query_result`.
QueryResult query_result = 2;
// Optional. The contents of the original request that was passed to
// `[Streaming]DetectIntent` call.
OriginalDetectIntentRequest original_detect_intent_request = 3;
}
// The response message for a webhook call.
message WebhookResponse {
// Optional. The text to be shown on the screen. This value is passed directly
// to `QueryResult.fulfillment_text`.
string fulfillment_text = 1;
// Optional. The collection of rich messages to present to the user. This
// value is passed directly to `QueryResult.fulfillment_messages`.
repeated Intent.Message fulfillment_messages = 2;
// Optional. This value is passed directly to `QueryResult.webhook_source`.
string source = 3;
// Optional. This value is passed directly to `QueryResult.webhook_payload`.
// See the related `fulfillment_messages[i].payload field`, which may be used
// as an alternative to this field.
//
// This field can be used for Actions on Google responses.
// It should have a structure similar to the JSON message shown here. For more
// information, see
// [Actions on Google Webhook
// Format](https://developers.google.com/actions/dialogflow/webhook)
// <pre>{
// "google": {
// "expectUserResponse": true,
// "richResponse": {
// "items": [
// {
// "simpleResponse": {
// "textToSpeech": "this is a simple response"
// }
// }
// ]
// }
// }
// }</pre>
google.protobuf.Struct payload = 4;
// Optional. The collection of output contexts. This value is passed directly
// to `QueryResult.output_contexts`.
repeated Context output_contexts = 5;
// Optional. Makes the platform immediately invoke another `DetectIntent` call
// internally with the specified event as input.
EventInput followup_event_input = 6;
}
// Represents the contents of the original request that was passed to
// the `[Streaming]DetectIntent` call.
message OriginalDetectIntentRequest {
// The source of this request, e.g., `google`, `facebook`, `slack`. It is set
// by Dialogflow-owned servers.
string source = 1;
// Optional. This field is set to the value of `QueryParameters.payload` field
// passed in the request.
google.protobuf.Struct payload = 3;
}

View File

@@ -0,0 +1,334 @@
// Copyright 2018 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.cloud.dialogflow.v2beta1;
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "AgentProto";
option java_package = "com.google.cloud.dialogflow.v2beta1";
option objc_class_prefix = "DF";
// Agents are best described as Natural Language Understanding (NLU) modules
// that transform user requests into actionable data. You can include agents
// in your app, product, or service to determine user intent and respond to the
// user in a natural way.
//
// After you create an agent, you can add [Intents][google.cloud.dialogflow.v2beta1.Intents], [Contexts][google.cloud.dialogflow.v2beta1.Contexts],
// [Entity Types][google.cloud.dialogflow.v2beta1.EntityTypes], [Webhooks][google.cloud.dialogflow.v2beta1.WebhookRequest], and so on to
// manage the flow of a conversation and match user input to predefined intents
// and actions.
//
// You can create an agent using both Dialogflow Standard Edition and
// Dialogflow Enterprise Edition. For details, see
// [Dialogflow Editions](/dialogflow-enterprise/docs/editions).
//
// You can save your agent for backup or versioning by exporting the agent by
// using the [ExportAgent][google.cloud.dialogflow.v2beta1.Agents.ExportAgent] method. You can import a saved
// agent by using the [ImportAgent][google.cloud.dialogflow.v2beta1.Agents.ImportAgent] method.
//
// Dialogflow provides several
// [prebuilt agents](https://dialogflow.com/docs/prebuilt-agents) for common
// conversation scenarios such as determining a date and time, converting
// currency, and so on.
//
// For more information about agents, see the
// [Dialogflow documentation](https://dialogflow.com/docs/agents).
service Agents {
// Retrieves the specified agent.
rpc GetAgent(GetAgentRequest) returns (Agent) {
option (google.api.http) = {
get: "/v2beta1/{parent=projects/*}/agent"
};
}
// Returns the list of agents.
//
// Since there is at most one conversational agent per project, this method is
// useful primarily for listing all agents across projects the caller has
// access to. One can achieve that with a wildcard project collection id "-".
// Refer to [List
// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
rpc SearchAgents(SearchAgentsRequest) returns (SearchAgentsResponse) {
option (google.api.http) = {
get: "/v2beta1/{parent=projects/*}/agent:search"
};
}
// Trains the specified agent.
//
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc TrainAgent(TrainAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*}/agent:train"
body: "*"
};
}
// Exports the specified agent to a ZIP file.
//
//
// Operation <response: [ExportAgentResponse][google.cloud.dialogflow.v2beta1.ExportAgentResponse],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*}/agent:export"
body: "*"
};
}
// Imports the specified agent from a ZIP file.
//
// Uploads new intents and entity types without deleting the existing ones.
// Intents and entity types with the same name are replaced with the new
// versions from ImportAgentRequest.
//
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc ImportAgent(ImportAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*}/agent:import"
body: "*"
};
}
// Restores the specified agent from a ZIP file.
//
// Replaces the current agent version with a new one. All the intents and
// entity types in the older version are deleted.
//
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*}/agent:restore"
body: "*"
};
}
}
// Represents a conversational agent.
message Agent {
// Match mode determines how intents are detected from user queries.
enum MatchMode {
// Not specified.
MATCH_MODE_UNSPECIFIED = 0;
// Best for agents with a small number of examples in intents and/or wide
// use of templates syntax and composite entities.
MATCH_MODE_HYBRID = 1;
// Can be used for agents with a large number of examples in intents,
// especially the ones using @sys.any or very large developer entities.
MATCH_MODE_ML_ONLY = 2;
}
// Required. The project of this agent.
// Format: `projects/<Project ID>`.
string parent = 1;
// Required. The name of this agent.
string display_name = 2;
// Required. The default language of the agent as a language tag. See
// [Language Support](https://dialogflow.com/docs/reference/language) for a
// list of the currently supported language codes.
// This field cannot be set by the `Update` method.
string default_language_code = 3;
// Optional. The list of all languages supported by this agent (except for the
// `default_language_code`).
repeated string supported_language_codes = 4;
// Required. The time zone of this agent from the
// [time zone database](https://www.iana.org/time-zones), e.g.,
// America/New_York, Europe/Paris.
string time_zone = 5;
// Optional. The description of this agent.
// The maximum length is 500 characters. If exceeded, the request is rejected.
string description = 6;
// Optional. The URI of the agent's avatar.
// Avatars are used throughout the Dialogflow console and in the self-hosted
// [Web Demo](https://dialogflow.com/docs/integrations/web-demo) integration.
string avatar_uri = 7;
// Optional. Determines whether this agent should log conversation queries.
bool enable_logging = 8;
// Optional. Determines how intents are detected from user queries.
MatchMode match_mode = 9;
// Optional. To filter out false positive results and still get variety in
// matched natural language inputs for your agent, you can tune the machine
// learning classification threshold. If the returned score value is less than
// the threshold value, then a fallback intent is be triggered or, if there
// are no fallback intents defined, no intent will be triggered. The score
// values range from 0.0 (completely uncertain) to 1.0 (completely certain).
// If set to 0.0, the default of 0.3 is used.
float classification_threshold = 10;
}
// The request message for [Agents.GetAgent][google.cloud.dialogflow.v2beta1.Agents.GetAgent].
message GetAgentRequest {
// Required. The project that the agent to fetch is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
}
// The request message for [Agents.SearchAgents][google.cloud.dialogflow.v2beta1.Agents.SearchAgents].
message SearchAgentsRequest {
// Required. The project to list agents from.
// Format: `projects/<Project ID or '-'>`.
string parent = 1;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 2;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 3;
}
// The response message for [Agents.SearchAgents][google.cloud.dialogflow.v2beta1.Agents.SearchAgents].
message SearchAgentsResponse {
// The list of agents. There will be a maximum number of items returned based
// on the page_size field in the request.
repeated Agent agents = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [Agents.TrainAgent][google.cloud.dialogflow.v2beta1.Agents.TrainAgent].
message TrainAgentRequest {
// Required. The project that the agent to train is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
}
// The request message for [Agents.ExportAgent][google.cloud.dialogflow.v2beta1.Agents.ExportAgent].
message ExportAgentRequest {
// Required. The project that the agent to export is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
// Optional. The Google Cloud Storage URI to export the agent to.
// Note: The URI must start with
// "gs://". If left unspecified, the serialized agent is returned inline.
string agent_uri = 2;
}
// The response message for [Agents.ExportAgent][google.cloud.dialogflow.v2beta1.Agents.ExportAgent].
message ExportAgentResponse {
// Required. The exported agent.
oneof agent {
// The URI to a file containing the exported agent. This field is populated
// only if `agent_uri` is specified in `ExportAgentRequest`.
string agent_uri = 1;
// The exported agent.
//
// Example for how to export an agent to a zip file via a command line:
//
// curl \
// 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:export'\
// -X POST \
// -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
// -H 'Accept: application/json' \
// -H 'Content-Type: application/json' \
// --compressed \
// --data-binary '{}' \
// | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/' \
// | base64 --decode > <agent zip file>
bytes agent_content = 2;
}
}
// The request message for [Agents.ImportAgent][google.cloud.dialogflow.v2beta1.Agents.ImportAgent].
message ImportAgentRequest {
// Required. The project that the agent to import is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
// Required. The agent to import.
oneof agent {
// The URI to a Google Cloud Storage file containing the agent to import.
// Note: The URI must start with "gs://".
string agent_uri = 2;
// The agent to import.
//
// Example for how to import an agent via the command line:
//
// curl \
// 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:import\
// -X POST \
// -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
// -H 'Accept: application/json' \
// -H 'Content-Type: application/json' \
// --compressed \
// --data-binary "{
// 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
// }"
bytes agent_content = 3;
}
}
// The request message for [Agents.RestoreAgent][google.cloud.dialogflow.v2beta1.Agents.RestoreAgent].
message RestoreAgentRequest {
// Required. The project that the agent to restore is associated with.
// Format: `projects/<Project ID>`.
string parent = 1;
// Required. The agent to restore.
oneof agent {
// The URI to a Google Cloud Storage file containing the agent to restore.
// Note: The URI must start with "gs://".
string agent_uri = 2;
// The agent to restore.
//
// Example for how to restore an agent via the command line:
//
// curl \
// 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:restore\
// -X POST \
// -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
// -H 'Accept: application/json' \
// -H 'Content-Type: application/json' \
// --compressed \
// --data-binary "{
// 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
// }" \
bytes agent_content = 3;
}
}

View File

@@ -0,0 +1,230 @@
// Copyright 2018 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.cloud.dialogflow.v2beta1;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "ContextProto";
option java_package = "com.google.cloud.dialogflow.v2beta1";
option objc_class_prefix = "DF";
// A context represents additional information included with user input or with
// an intent returned by the Dialogflow API. Contexts are helpful for
// differentiating user input which may be vague or have a different meaning
// depending on additional details from your application such as user setting
// and preferences, previous user input, where the user is in your application,
// geographic location, and so on.
//
// You can include contexts as input parameters of a
// [DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] (or
// [StreamingDetectIntent][google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntent]) request,
// or as output contexts included in the returned intent.
// Contexts expire when an intent is matched, after the number of `DetectIntent`
// requests specified by the `lifespan_count` parameter, or after 10 minutes
// if no intents are matched for a `DetectIntent` request.
//
// For more information about contexts, see the
// [Dialogflow documentation](https://dialogflow.com/docs/contexts).
service Contexts {
// Returns the list of all contexts in the specified session.
rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) {
option (google.api.http) = {
get: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts"
additional_bindings {
get: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts"
}
};
}
// Retrieves the specified context.
rpc GetContext(GetContextRequest) returns (Context) {
option (google.api.http) = {
get: "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}"
additional_bindings {
get: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}"
}
};
}
// Creates a context.
rpc CreateContext(CreateContextRequest) returns (Context) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts"
body: "context"
additional_bindings {
post: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts"
body: "context"
}
};
}
// Updates the specified context.
rpc UpdateContext(UpdateContextRequest) returns (Context) {
option (google.api.http) = {
patch: "/v2beta1/{context.name=projects/*/agent/sessions/*/contexts/*}"
body: "context"
additional_bindings {
patch: "/v2beta1/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}"
body: "context"
}
};
}
// Deletes the specified context.
rpc DeleteContext(DeleteContextRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}"
additional_bindings {
delete: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}"
}
};
}
// Deletes all active contexts in the specified session.
rpc DeleteAllContexts(DeleteAllContextsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts"
additional_bindings {
delete: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts"
}
};
}
}
// Represents a context.
message Context {
// Required. The unique identifier of the context. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`,
// or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: Environments and
// users are under construction and will be available soon. The Context ID is
// always converted to lowercase. If <Environment ID> is not specified, we
// assume default 'draft' environment. If <User ID> is not specified, we
// assume default '-' user.
string name = 1;
// Optional. The number of conversational query requests after which the
// context expires. If set to `0` (the default) the context expires
// immediately. Contexts expire automatically after 10 minutes even if there
// are no matching queries.
int32 lifespan_count = 2;
// Optional. The collection of parameters associated with this context.
// Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for
// syntax.
google.protobuf.Struct parameters = 3;
}
// The request message for [Contexts.ListContexts][google.cloud.dialogflow.v2beta1.Contexts.ListContexts].
message ListContextsRequest {
// Required. The session to list all contexts from.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>`. Note: Environments and users are under
// construction and will be available soon. If <Environment ID> is not
// specified, we assume default 'draft' environment. If <User ID> is not
// specified, we assume default '-' user.
string parent = 1;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 2;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 3;
}
// The response message for [Contexts.ListContexts][google.cloud.dialogflow.v2beta1.Contexts.ListContexts].
message ListContextsResponse {
// The list of contexts. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated Context contexts = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [Contexts.GetContext][google.cloud.dialogflow.v2beta1.Contexts.GetContext].
message GetContextRequest {
// Required. The name of the context. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`
// or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: Environments and
// users are under construction and will be available soon. If <Environment
// ID> is not specified, we assume default 'draft' environment. If <User ID>
// is not specified, we assume default '-' user.
string name = 1;
}
// The request message for [Contexts.CreateContext][google.cloud.dialogflow.v2beta1.Contexts.CreateContext].
message CreateContextRequest {
// Required. The session to create a context for.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>`. Note: Environments and users are under
// construction and will be available soon. If <Environment ID> is not
// specified, we assume default 'draft' environment. If <User ID> is not
// specified, we assume default '-' user.
string parent = 1;
// Required. The context to create.
Context context = 2;
}
// The request message for [Contexts.UpdateContext][google.cloud.dialogflow.v2beta1.Contexts.UpdateContext].
message UpdateContextRequest {
// Required. The context to update.
Context context = 1;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 2;
}
// The request message for [Contexts.DeleteContext][google.cloud.dialogflow.v2beta1.Contexts.DeleteContext].
message DeleteContextRequest {
// Required. The name of the context to delete. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`
// or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: Environments and
// users are under construction and will be available soon. If <Environment
// ID> is not specified, we assume default 'draft' environment. If <User ID>
// is not specified, we assume default
// '-' user.
string name = 1;
}
// The request message for [Contexts.DeleteAllContexts][google.cloud.dialogflow.v2beta1.Contexts.DeleteAllContexts].
message DeleteAllContextsRequest {
// Required. The name of the session to delete all contexts from. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project
// ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session
// ID>`. Note: Environments and users are under construction and will be
// available soon. If <Environment ID> is not specified we assume default
// 'draft' environment. If <User ID> is not specified, we assume default
// '-' user.
string parent = 1;
}

View File

@@ -0,0 +1,419 @@
// Copyright 2018 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.cloud.dialogflow.v2beta1;
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "EntityTypeProto";
option java_package = "com.google.cloud.dialogflow.v2beta1";
option objc_class_prefix = "DF";
// Entities are extracted from user input and represent parameters that are
// meaningful to your application. For example, a date range, a proper name
// such as a geographic location or landmark, and so on. Entities represent
// actionable data for your application.
//
// When you define an entity, you can also include synonyms that all map to
// that entity. For example, "soft drink", "soda", "pop", and so on.
//
// There are three types of entities:
//
// * **System** - entities that are defined by the Dialogflow API for common
// data types such as date, time, currency, and so on. A system entity is
// represented by the `EntityType` type.
//
// * **Developer** - entities that are defined by you that represent
// actionable data that is meaningful to your application. For example,
// you could define a `pizza.sauce` entity for red or white pizza sauce,
// a `pizza.cheese` entity for the different types of cheese on a pizza,
// a `pizza.topping` entity for different toppings, and so on. A developer
// entity is represented by the `EntityType` type.
//
// * **User** - entities that are built for an individual user such as
// favorites, preferences, playlists, and so on. A user entity is
// represented by the [SessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityType] type.
//
// For more information about entity types, see the
// [Dialogflow documentation](https://dialogflow.com/docs/entities).
service EntityTypes {
// Returns the list of all entity types in the specified agent.
rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) {
option (google.api.http) = {
get: "/v2beta1/{parent=projects/*/agent}/entityTypes"
};
}
// Retrieves the specified entity type.
rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) {
option (google.api.http) = {
get: "/v2beta1/{name=projects/*/agent/entityTypes/*}"
};
}
// Creates an entity type in the specified agent.
rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent}/entityTypes"
body: "entity_type"
};
}
// Updates the specified entity type.
rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) {
option (google.api.http) = {
patch: "/v2beta1/{entity_type.name=projects/*/agent/entityTypes/*}"
body: "entity_type"
};
}
// Deletes the specified entity type.
rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2beta1/{name=projects/*/agent/entityTypes/*}"
};
}
// Updates/Creates multiple entity types in the specified agent.
//
// Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc BatchUpdateEntityTypes(BatchUpdateEntityTypesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent}/entityTypes:batchUpdate"
body: "*"
};
}
// Deletes entity types in the specified agent.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc BatchDeleteEntityTypes(BatchDeleteEntityTypesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent}/entityTypes:batchDelete"
body: "*"
};
}
// Creates multiple new entities in the specified entity type (extends the
// existing collection of entries).
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
rpc BatchCreateEntities(BatchCreateEntitiesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate"
body: "*"
};
}
// Updates entities in the specified entity type (replaces the existing
// collection of entries).
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc BatchUpdateEntities(BatchUpdateEntitiesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate"
body: "*"
};
}
// Deletes entities in the specified entity type.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
rpc BatchDeleteEntities(BatchDeleteEntitiesRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete"
body: "*"
};
}
}
// Represents an entity type.
// Entity types serve as a tool for extracting parameter values from natural
// language queries.
message EntityType {
// Optional. Represents an entity.
message Entity {
// Required.
// For `KIND_MAP` entity types:
// A canonical name to be used in place of synonyms.
// For `KIND_LIST` entity types:
// A string that can contain references to other entity types (with or
// without aliases).
string value = 1;
// Required. A collection of synonyms. For `KIND_LIST` entity types this
// must contain exactly one synonym equal to `value`.
repeated string synonyms = 2;
}
// Represents kinds of entities.
enum Kind {
// Not specified. This value should be never used.
KIND_UNSPECIFIED = 0;
// Map entity types allow mapping of a group of synonyms to a canonical
// value.
KIND_MAP = 1;
// List entity types contain a set of entries that do not map to canonical
// values. However, list entity types can contain references to other entity
// types (with or without aliases).
KIND_LIST = 2;
}
// Represents different entity type expansion modes. Automated expansion
// allows an agent to recognize values that have not been explicitly listed in
// the entity (for example, new kinds of shopping list items).
enum AutoExpansionMode {
// Auto expansion disabled for the entity.
AUTO_EXPANSION_MODE_UNSPECIFIED = 0;
// Allows an agent to recognize values that have not been explicitly
// listed in the entity.
AUTO_EXPANSION_MODE_DEFAULT = 1;
}
// Required for all methods except `create` (`create` populates the name
// automatically.
// The unique identifier of the entity type. Format:
// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
string name = 1;
// Required. The name of the entity.
string display_name = 2;
// Required. Indicates the kind of entity type.
Kind kind = 3;
// Optional. Indicates whether the entity type can be automatically
// expanded.
AutoExpansionMode auto_expansion_mode = 4;
// Optional. The collection of entities associated with the entity type.
repeated Entity entities = 6;
}
// The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.ListEntityTypes].
message ListEntityTypesRequest {
// Required. The agent to list all entity types from.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Optional. The language to list entity synonyms for. If not specified,
// the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 3;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 4;
}
// The response message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.ListEntityTypes].
message ListEntityTypesResponse {
// The list of agent entity types. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated EntityType entity_types = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.v2beta1.EntityTypes.GetEntityType].
message GetEntityTypeRequest {
// Required. The name of the entity type.
// Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
string name = 1;
// Optional. The language to retrieve entity synonyms for. If not specified,
// the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
}
// The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.v2beta1.EntityTypes.CreateEntityType].
message CreateEntityTypeRequest {
// Required. The agent to create a entity type for.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Required. The entity type to create.
EntityType entity_type = 2;
// Optional. The language of entity synonyms defined in `entity_type`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
}
// The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2beta1.EntityTypes.UpdateEntityType].
message UpdateEntityTypeRequest {
// Required. The entity type to update.
// Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
EntityType entity_type = 1;
// Optional. The language of entity synonyms defined in `entity_type`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 3;
}
// The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.v2beta1.EntityTypes.DeleteEntityType].
message DeleteEntityTypeRequest {
// Required. The name of the entity type to delete.
// Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
string name = 1;
}
// The request message for [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntityTypes].
message BatchUpdateEntityTypesRequest {
// Required. The name of the agent to update or create entity types in.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Required. The source of the entity type batch.
//
// For each entity type in the batch:
// * If `name` is specified, we update an existing entity type.
// * If `name` is not specified, we create a new entity type.
oneof entity_type_batch {
// The URI to a Google Cloud Storage file containing entity types to update
// or create. The file format can either be a serialized proto (of
// EntityBatch type) or a JSON object. Note: The URI must start with
// "gs://".
string entity_type_batch_uri = 2;
// The collection of entity type to update or create.
EntityTypeBatch entity_type_batch_inline = 3;
}
// Optional. The language of entity synonyms defined in `entity_types`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 4;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 5;
}
// The response message for [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntityTypes].
message BatchUpdateEntityTypesResponse {
// The collection of updated or created entity types.
repeated EntityType entity_types = 1;
}
// The request message for [EntityTypes.BatchDeleteEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntityTypes].
message BatchDeleteEntityTypesRequest {
// Required. The name of the agent to delete all entities types for. Format:
// `projects/<Project ID>/agent`.
string parent = 1;
// Required. The names entity types to delete. All names must point to the
// same agent as `parent`.
repeated string entity_type_names = 2;
}
// The request message for [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2beta1.EntityTypes.BatchCreateEntities].
message BatchCreateEntitiesRequest {
// Required. The name of the entity type to create entities in. Format:
// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
string parent = 1;
// Required. The collection of entities to create.
repeated EntityType.Entity entities = 2;
// Optional. The language of entity synonyms defined in `entities`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
}
// The response message for [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2beta1.EntityTypes.BatchCreateEntities].
message BatchUpdateEntitiesRequest {
// Required. The name of the entity type to update the entities in. Format:
// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
string parent = 1;
// Required. The collection of new entities to replace the existing entities.
repeated EntityType.Entity entities = 2;
// Optional. The language of entity synonyms defined in `entities`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 4;
}
// The request message for [EntityTypes.BatchDeleteEntities][google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntities].
message BatchDeleteEntitiesRequest {
// Required. The name of the entity type to delete entries for. Format:
// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
string parent = 1;
// Required. The canonical `values` of the entities to delete. Note that
// these are not fully-qualified names, i.e. they don't start with
// `projects/<Project ID>`.
repeated string entity_values = 2;
// Optional. The language of entity synonyms defined in `entities`. If not
// specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
}
// This message is a wrapper around a collection of entity types.
message EntityTypeBatch {
// A collection of entity types.
repeated EntityType entity_types = 1;
}

View File

@@ -0,0 +1,824 @@
// Copyright 2018 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.cloud.dialogflow.v2beta1;
import "google/api/annotations.proto";
import "google/cloud/dialogflow/v2beta1/context.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "IntentProto";
option java_package = "com.google.cloud.dialogflow.v2beta1";
option objc_class_prefix = "DF";
// An intent represents a mapping between input from a user and an action to
// be taken by your application. When you pass user input to the
// [DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] (or
// [StreamingDetectIntent][google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntent]) method, the
// Dialogflow API analyzes the input and searches
// for a matching intent. If no match is found, the Dialogflow API returns a
// fallback intent (`is_fallback` = true).
//
// You can provide additional information for the Dialogflow API to use to
// match user input to an intent by adding the following to your intent.
//
// * **Contexts** - provide additional context for intent analysis. For
// example, if an intent is related to an object in your application that
// plays music, you can provide a context to determine when to match the
// intent if the user input is “turn it off”. You can include a context
// that matches the intent when there is previous user input of
// "play music", and not when there is previous user input of
// "turn on the light".
//
// * **Events** - allow for matching an intent by using an event name
// instead of user input. Your application can provide an event name and
// related parameters to the Dialogflow API to match an intent. For
// example, when your application starts, you can send a welcome event
// with a user name parameter to the Dialogflow API to match an intent with
// a personalized welcome message for the user.
//
// * **Training phrases** - provide examples of user input to train the
// Dialogflow API agent to better match intents.
//
// For more information about intents, see the
// [Dialogflow documentation](https://dialogflow.com/docs/intents).
service Intents {
// Returns the list of all intents in the specified agent.
rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) {
option (google.api.http) = {
get: "/v2beta1/{parent=projects/*/agent}/intents"
};
}
// Retrieves the specified intent.
rpc GetIntent(GetIntentRequest) returns (Intent) {
option (google.api.http) = {
get: "/v2beta1/{name=projects/*/agent/intents/*}"
};
}
// Creates an intent in the specified agent.
rpc CreateIntent(CreateIntentRequest) returns (Intent) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent}/intents"
body: "intent"
};
}
// Updates the specified intent.
rpc UpdateIntent(UpdateIntentRequest) returns (Intent) {
option (google.api.http) = {
patch: "/v2beta1/{intent.name=projects/*/agent/intents/*}"
body: "intent"
};
}
// Deletes the specified intent.
rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2beta1/{name=projects/*/agent/intents/*}"
};
}
// Updates/Creates multiple intents in the specified agent.
//
// Operation <response: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse]>
rpc BatchUpdateIntents(BatchUpdateIntentsRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent}/intents:batchUpdate"
body: "*"
};
}
// Deletes intents in the specified agent.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
rpc BatchDeleteIntents(BatchDeleteIntentsRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent}/intents:batchDelete"
body: "*"
};
}
}
// Represents an intent.
// Intents convert a number of user expressions or patterns into an action. An
// action is an extraction of a user command or sentence semantics.
message Intent {
// Represents an example or template that the agent is trained on.
message TrainingPhrase {
// Represents a part of a training phrase.
message Part {
// Required. The text corresponding to the example or template,
// if there are no annotations. For
// annotated examples, it is the text for one of the example's parts.
string text = 1;
// Optional. The entity type name prefixed with `@`. This field is
// required for the annotated part of the text and applies only to
// examples.
string entity_type = 2;
// Optional. The parameter name for the value extracted from the
// annotated part of the example.
string alias = 3;
// Optional. Indicates whether the text was manually annotated by the
// developer.
bool user_defined = 4;
}
// Represents different types of training phrases.
enum Type {
// Not specified. This value should never be used.
TYPE_UNSPECIFIED = 0;
// Examples do not contain @-prefixed entity type names, but example parts
// can be annotated with entity types.
EXAMPLE = 1;
// Templates are not annotated with entity types, but they can contain
// @-prefixed entity type names as substrings.
TEMPLATE = 2;
}
// Required. The unique identifier of this training phrase.
string name = 1;
// Required. The type of the training phrase.
Type type = 2;
// Required. The collection of training phrase parts (can be annotated).
// Fields: `entity_type`, `alias` and `user_defined` should be populated
// only for the annotated parts of the training phrase.
repeated Part parts = 3;
// Optional. Indicates how many times this example or template was added to
// the intent. Each time a developer adds an existing sample by editing an
// intent or training, this counter is increased.
int32 times_added_count = 4;
}
// Represents intent parameters.
message Parameter {
// The unique identifier of this parameter.
string name = 1;
// Required. The name of the parameter.
string display_name = 2;
// Optional. The definition of the parameter value. It can be:
// - a constant string,
// - a parameter value defined as `$parameter_name`,
// - an original parameter value defined as `$parameter_name.original`,
// - a parameter value from some context defined as
// `#context_name.parameter_name`.
string value = 3;
// Optional. The default value to use when the `value` yields an empty
// result.
// Default values can be extracted from contexts by using the following
// syntax: `#context_name.parameter_name`.
string default_value = 4;
// Optional. The name of the entity type, prefixed with `@`, that
// describes values of the parameter. If the parameter is
// required, this must be provided.
string entity_type_display_name = 5;
// Optional. Indicates whether the parameter is required. That is,
// whether the intent cannot be completed without collecting the parameter
// value.
bool mandatory = 6;
// Optional. The collection of prompts that the agent can present to the
// user in order to collect value for the parameter.
repeated string prompts = 7;
// Optional. Indicates whether the parameter represents a list of values.
bool is_list = 8;
}
// Corresponds to the `Response` field in the Dialogflow console.
message Message {
// The text response message.
message Text {
// Optional. The collection of the agent's responses.
repeated string text = 1;
}
// The image response message.
message Image {
// Optional. The public URI to an image file.
string image_uri = 1;
// Optional. A text description of the image to be used for accessibility,
// e.g., screen readers.
string accessibility_text = 2;
}
// The quick replies response message.
message QuickReplies {
// Optional. The title of the collection of quick replies.
string title = 1;
// Optional. The collection of quick replies.
repeated string quick_replies = 2;
}
// The card response message.
message Card {
// Optional. Contains information about a button.
message Button {
// Optional. The text to show on the button.
string text = 1;
// Optional. The text to send back to the Dialogflow API or a URI to
// open.
string postback = 2;
}
// Optional. The title of the card.
string title = 1;
// Optional. The subtitle of the card.
string subtitle = 2;
// Optional. The public URI to an image file for the card.
string image_uri = 3;
// Optional. The collection of card buttons.
repeated Button buttons = 4;
}
// The simple response message containing speech or text.
message SimpleResponse {
// One of text_to_speech or ssml must be provided. The plain text of the
// speech output. Mutually exclusive with ssml.
string text_to_speech = 1;
// One of text_to_speech or ssml must be provided. Structured spoken
// response to the user in the SSML format. Mutually exclusive with
// text_to_speech.
string ssml = 2;
// Optional. The text to display.
string display_text = 3;
}
// The collection of simple response candidates.
// This message in `QueryResult.fulfillment_messages` and
// `WebhookResponse.fulfillment_messages` should contain only one
// `SimpleResponse`.
message SimpleResponses {
// Required. The list of simple responses.
repeated SimpleResponse simple_responses = 1;
}
// The basic card message. Useful for displaying information.
message BasicCard {
// The button object that appears at the bottom of a card.
message Button {
// Opens the given URI.
message OpenUriAction {
// Required. The HTTP or HTTPS scheme URI.
string uri = 1;
}
// Required. The title of the button.
string title = 1;
// Required. Action to take when a user taps on the button.
OpenUriAction open_uri_action = 2;
}
// Optional. The title of the card.
string title = 1;
// Optional. The subtitle of the card.
string subtitle = 2;
// Required, unless image is present. The body text of the card.
string formatted_text = 3;
// Optional. The image for the card.
Image image = 4;
// Optional. The collection of card buttons.
repeated Button buttons = 5;
}
// The suggestion chip message that the user can tap to quickly post a reply
// to the conversation.
message Suggestion {
// Required. The text shown the in the suggestion chip.
string title = 1;
}
// The collection of suggestions.
message Suggestions {
// Required. The list of suggested replies.
repeated Suggestion suggestions = 1;
}
// The suggestion chip message that allows the user to jump out to the app
// or website associated with this agent.
message LinkOutSuggestion {
// Required. The name of the app or site this chip is linking to.
string destination_name = 1;
// Required. The URI of the app or site to open when the user taps the
// suggestion chip.
string uri = 2;
}
// The card for presenting a list of options to select from.
message ListSelect {
// An item in the list.
message Item {
// Required. Additional information about this option.
SelectItemInfo info = 1;
// Required. The title of the list item.
string title = 2;
// Optional. The main text describing the item.
string description = 3;
// Optional. The image to display.
Image image = 4;
}
// Optional. The overall title of the list.
string title = 1;
// Required. List items.
repeated Item items = 2;
}
// The card for presenting a carousel of options to select from.
message CarouselSelect {
// An item in the carousel.
message Item {
// Required. Additional info about the option item.
SelectItemInfo info = 1;
// Required. Title of the carousel item.
string title = 2;
// Optional. The body text of the card.
string description = 3;
// Optional. The image to display.
Image image = 4;
}
// Required. Carousel items.
repeated Item items = 1;
}
// Additional info about the select item for when it is triggered in a
// dialog.
message SelectItemInfo {
// Required. A unique key that will be sent back to the agent if this
// response is given.
string key = 1;
// Optional. A list of synonyms that can also be used to trigger this
// item in dialog.
repeated string synonyms = 2;
}
// Represents different platforms that a rich message can be intended for.
enum Platform {
// Not specified.
PLATFORM_UNSPECIFIED = 0;
// Facebook.
FACEBOOK = 1;
// Slack.
SLACK = 2;
// Telegram.
TELEGRAM = 3;
// Kik.
KIK = 4;
// Skype.
SKYPE = 5;
// Line.
LINE = 6;
// Viber.
VIBER = 7;
// Actions on Google.
// When using Actions on Google, you can choose one of the specific
// Intent.Message types that mention support for Actions on Google,
// or you can use the advanced Intent.Message.payload field.
// The payload field provides access to AoG features not available in the
// specific message types.
// If using the Intent.Message.payload field, it should have a structure
// similar to the JSON message shown here. For more information, see
// [Actions on Google Webhook
// Format](https://developers.google.com/actions/dialogflow/webhook)
// <pre>{
// "expectUserResponse": true,
// "isSsml": false,
// "noInputPrompts": [],
// "richResponse": {
// "items": [
// {
// "simpleResponse": {
// "displayText": "hi",
// "textToSpeech": "hello"
// }
// }
// ],
// "suggestions": [
// {
// "title": "Say this"
// },
// {
// "title": "or this"
// }
// ]
// },
// "systemIntent": {
// "data": {
// "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
// "listSelect": {
// "items": [
// {
// "optionInfo": {
// "key": "key1",
// "synonyms": [
// "key one"
// ]
// },
// "title": "must not be empty, but unique"
// },
// {
// "optionInfo": {
// "key": "key2",
// "synonyms": [
// "key two"
// ]
// },
// "title": "must not be empty, but unique"
// }
// ]
// }
// },
// "intent": "actions.intent.OPTION"
// }
// }</pre>
ACTIONS_ON_GOOGLE = 8;
}
// Required. The rich response message.
oneof message {
// Returns a text response.
Text text = 1;
// Displays an image.
Image image = 2;
// Displays quick replies.
QuickReplies quick_replies = 3;
// Displays a card.
Card card = 4;
// Returns a response containing a custom, platform-specific payload.
// See the Intent.Message.Platform type for a description of the
// structure that may be required for your platform.
google.protobuf.Struct payload = 5;
// Returns a voice or text-only response for Actions on Google.
SimpleResponses simple_responses = 7;
// Displays a basic card for Actions on Google.
BasicCard basic_card = 8;
// Displays suggestion chips for Actions on Google.
Suggestions suggestions = 9;
// Displays a link out suggestion chip for Actions on Google.
LinkOutSuggestion link_out_suggestion = 10;
// Displays a list card for Actions on Google.
ListSelect list_select = 11;
// Displays a carousel card for Actions on Google.
CarouselSelect carousel_select = 12;
}
// Optional. The platform that this message is intended for.
Platform platform = 6;
}
// Represents a single followup intent in the chain.
message FollowupIntentInfo {
// The unique identifier of the followup intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string followup_intent_name = 1;
// The unique identifier of the followup intent parent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string parent_followup_intent_name = 2;
}
// Represents the different states that webhooks can be in.
enum WebhookState {
// Webhook is disabled in the agent and in the intent.
WEBHOOK_STATE_UNSPECIFIED = 0;
// Webhook is enabled in the agent and in the intent.
WEBHOOK_STATE_ENABLED = 1;
// Webhook is enabled in the agent and in the intent. Also, each slot
// filling prompt is forwarded to the webhook.
WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2;
}
// Required for all methods except `create` (`create` populates the name
// automatically.
// The unique identifier of this intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string name = 1;
// Required. The name of this intent.
string display_name = 2;
// Required. Indicates whether webhooks are enabled for the intent.
WebhookState webhook_state = 6;
// Optional. The priority of this intent. Higher numbers represent higher
// priorities. Zero or negative numbers mean that the intent is disabled.
int32 priority = 3;
// Optional. Indicates whether this is a fallback intent.
bool is_fallback = 4;
// Optional. Indicates whether Machine Learning is enabled for the intent.
// Note: If `ml_enabled` setting is set to false, then this intent is not
// taken into account during inference in `ML ONLY` match mode. Also,
// auto-markup in the UI is turned off.
// DEPRECATED! Please use `ml_disabled` field instead.
// NOTE: If neither `ml_enabled` nor `ml_disabled` field is set, then the
// default value is determined as follows:
// - Before April 15th, 2018 the default is:
// ml_enabled = false / ml_disabled = true.
// - After April 15th, 2018 the default is:
// ml_enabled = true / ml_disabled = false.
bool ml_enabled = 5;
// Optional. Indicates whether Machine Learning is disabled for the intent.
// Note: If `ml_disabled` setting is set to true, then this intent is not
// taken into account during inference in `ML ONLY` match mode. Also,
// auto-markup in the UI is turned off.
bool ml_disabled = 19;
// Optional. The list of context names required for this intent to be
// triggered.
// Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
repeated string input_context_names = 7;
// Optional. The collection of event names that trigger the intent.
// If the collection of input contexts is not empty, all of the contexts must
// be present in the active user session for an event to trigger this intent.
repeated string events = 8;
// Optional. The collection of examples/templates that the agent is
// trained on.
repeated TrainingPhrase training_phrases = 9;
// Optional. The name of the action associated with the intent.
string action = 10;
// Optional. The collection of contexts that are activated when the intent
// is matched. Context messages in this collection should not set the
// parameters field. Setting the `lifespan_count` to 0 will reset the context
// when the intent is matched.
// Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
repeated Context output_contexts = 11;
// Optional. Indicates whether to delete all contexts in the current
// session when this intent is matched.
bool reset_contexts = 12;
// Optional. The collection of parameters associated with the intent.
repeated Parameter parameters = 13;
// Optional. The collection of rich messages corresponding to the
// `Response` field in the Dialogflow console.
repeated Message messages = 14;
// Optional. The list of platforms for which the first response will be
// taken from among the messages assigned to the DEFAULT_PLATFORM.
repeated Message.Platform default_response_platforms = 15;
// The unique identifier of the root intent in the chain of followup intents.
// It identifies the correct followup intents chain for this intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string root_followup_intent_name = 16;
// The unique identifier of the parent intent in the chain of followup
// intents.
// It identifies the parent followup intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string parent_followup_intent_name = 17;
// Optional. Collection of information about all followup intents that have
// name of this intent as a root_name.
repeated FollowupIntentInfo followup_intent_info = 18;
}
// The request message for [Intents.ListIntents][google.cloud.dialogflow.v2beta1.Intents.ListIntents].
message ListIntentsRequest {
// Required. The agent to list all intents from.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Optional. The language to list training phrases, parameters and rich
// messages for. If not specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent before they can be used.
string language_code = 2;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 3;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 4;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 5;
}
// The response message for [Intents.ListIntents][google.cloud.dialogflow.v2beta1.Intents.ListIntents].
message ListIntentsResponse {
// The list of agent intents. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated Intent intents = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [Intents.GetIntent][google.cloud.dialogflow.v2beta1.Intents.GetIntent].
message GetIntentRequest {
// Required. The name of the intent.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string name = 1;
// Optional. The language to retrieve training phrases, parameters and rich
// messages for. If not specified, the agent's default language is used.
// [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 3;
}
// The request message for [Intents.CreateIntent][google.cloud.dialogflow.v2beta1.Intents.CreateIntent].
message CreateIntentRequest {
// Required. The agent to create a intent for.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Required. The intent to create.
Intent intent = 2;
// Optional. The language of training phrases, parameters and rich messages
// defined in `intent`. If not specified, the agent's default language is
// used. [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 3;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 4;
}
// The request message for [Intents.UpdateIntent][google.cloud.dialogflow.v2beta1.Intents.UpdateIntent].
message UpdateIntentRequest {
// Required. The intent to update.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
Intent intent = 1;
// Optional. The language of training phrases, parameters and rich messages
// defined in `intent`. If not specified, the agent's default language is
// used. [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 2;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 3;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 4;
}
// The request message for [Intents.DeleteIntent][google.cloud.dialogflow.v2beta1.Intents.DeleteIntent].
message DeleteIntentRequest {
// Required. The name of the intent to delete.
// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
string name = 1;
}
// The request message for [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntents].
message BatchUpdateIntentsRequest {
// Required. The name of the agent to update or create intents in.
// Format: `projects/<Project ID>/agent`.
string parent = 1;
// Required. The source of the intent batch.
oneof intent_batch {
// The URI to a Google Cloud Storage file containing intents to update or
// create. The file format can either be a serialized proto (of IntentBatch
// type) or JSON object. Note: The URI must start with "gs://".
string intent_batch_uri = 2;
// The collection of intents to update or create.
IntentBatch intent_batch_inline = 3;
}
// Optional. The language of training phrases, parameters and rich messages
// defined in `intents`. If not specified, the agent's default language is
// used. [More than a dozen
// languages](https://dialogflow.com/docs/reference/language) are supported.
// Note: languages must be enabled in the agent, before they can be used.
string language_code = 4;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 5;
// Optional. The resource view to apply to the returned intent.
IntentView intent_view = 6;
}
// The response message for [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntents].
message BatchUpdateIntentsResponse {
// The collection of updated or created intents.
repeated Intent intents = 1;
}
// The request message for [Intents.BatchDeleteIntents][google.cloud.dialogflow.v2beta1.Intents.BatchDeleteIntents].
message BatchDeleteIntentsRequest {
// Required. The name of the agent to delete all entities types for. Format:
// `projects/<Project ID>/agent`.
string parent = 1;
// Required. The collection of intents to delete. Only intent `name` must be
// filled in.
repeated Intent intents = 2;
}
// This message is a wrapper around a collection of intents.
message IntentBatch {
// A collection of intents.
repeated Intent intents = 1;
}
// Represents the options for views of an intent.
// An intent can be a sizable object. Therefore, we provide a resource view that
// does not return training phrases in the response by default.
enum IntentView {
// Training phrases field is not populated in the response.
INTENT_VIEW_UNSPECIFIED = 0;
// All fields are populated.
INTENT_VIEW_FULL = 1;
}

View File

@@ -0,0 +1,492 @@
// Copyright 2018 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.cloud.dialogflow.v2beta1;
import "google/api/annotations.proto";
import "google/cloud/dialogflow/v2beta1/context.proto";
import "google/cloud/dialogflow/v2beta1/intent.proto";
import "google/cloud/dialogflow/v2beta1/session_entity_type.proto";
import "google/protobuf/struct.proto";
import "google/rpc/status.proto";
import "google/type/latlng.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "SessionProto";
option java_package = "com.google.cloud.dialogflow.v2beta1";
option objc_class_prefix = "DF";
// A session represents an interaction with a user. You retrieve user input
// and pass it to the [DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] (or
// [StreamingDetectIntent][google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntent]) method to determine
// user intent and respond.
service Sessions {
// Processes a natural language query and returns structured, actionable data
// as a result. This method is not idempotent, because it may cause contexts
// and session entity types to be updated, which in turn might affect
// results of future queries.
rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) {
option (google.api.http) = {
post: "/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent"
body: "*"
additional_bindings {
post: "/v2beta1/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent"
body: "*"
}
};
}
// Processes a natural language query in audio format in a streaming fashion
// and returns structured, actionable data as a result. This method is only
// available via the gRPC API (not REST).
rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse);
}
// The request to detect user's intent.
message DetectIntentRequest {
// Required. The name of the session this query is sent to. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>`, or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>`. Note: Environments and users are under
// construction and will be available soon. If <Environment ID> is not
// specified, we assume default 'draft' environment. If <User ID> is not
// specified, we are using "-". Its up to the API caller to choose an
// appropriate <Session ID>. and <User Id>. They can be a random numbers or
// some type of user and session identifiers (preferably hashed). The length
// of the <Session ID> and <User ID> must not exceed 36 characters.
string session = 1;
// Optional. The parameters of this query.
QueryParameters query_params = 2;
// Required. The input specification. It can be set to:
//
// 1. an audio config
// which instructs the speech recognizer how to process the speech audio,
//
// 2. a conversational query in the form of text, or
//
// 3. an event that specifies which intent to trigger.
QueryInput query_input = 3;
// Optional. The natural language speech audio to be processed. This field
// should be populated iff `query_input` is set to an input audio config.
// A single request can contain up to 1 minute of speech audio data.
bytes input_audio = 5;
}
// The message returned from the DetectIntent method.
message DetectIntentResponse {
// The unique identifier of the response. It can be used to
// locate a response in the training example set or for reporting issues.
string response_id = 1;
// The results of the conversational query or event processing.
QueryResult query_result = 2;
// Specifies the status of the webhook request. `webhook_status`
// is never populated in webhook requests.
google.rpc.Status webhook_status = 3;
}
// Represents the parameters of the conversational query.
message QueryParameters {
// Optional. The time zone of this conversational query from the
// [time zone database](https://www.iana.org/time-zones), e.g.,
// America/New_York, Europe/Paris. If not provided, the time zone specified in
// agent settings is used.
string time_zone = 1;
// Optional. The geo location of this conversational query.
google.type.LatLng geo_location = 2;
// Optional. The collection of contexts to be activated before this query is
// executed.
repeated Context contexts = 3;
// Optional. Specifies whether to delete all contexts in the current session
// before the new ones are activated.
bool reset_contexts = 4;
// Optional. The collection of session entity types to replace or extend
// developer entities with for this query only. The entity synonyms apply
// to all languages.
repeated SessionEntityType session_entity_types = 5;
// Optional. This field can be used to pass custom data into the webhook
// associated with the agent. Arbitrary JSON objects are supported.
google.protobuf.Struct payload = 6;
}
// Represents the query input. It can contain either:
//
// 1. An audio config which
// instructs the speech recognizer how to process the speech audio.
//
// 2. A conversational query in the form of text,.
//
// 3. An event that specifies which intent to trigger.
message QueryInput {
// Required. The input specification.
oneof input {
// Instructs the speech recognizer how to process the speech audio.
InputAudioConfig audio_config = 1;
// The natural language text to be processed.
TextInput text = 2;
// The event to be processed.
EventInput event = 3;
}
}
// Represents the result of conversational query or event processing.
message QueryResult {
// The original conversational query text:
// - If natural language text was provided as input, `query_text` contains
// a copy of the input.
// - If natural language speech audio was provided as input, `query_text`
// contains the speech recognition result. If speech recognizer produced
// multiple alternatives, a particular one is picked.
// - If an event was provided as input, `query_text` is not set.
string query_text = 1;
// The language that was triggered during intent detection.
// See [Language Support](https://dialogflow.com/docs/reference/language)
// for a list of the currently supported language codes.
string language_code = 15;
// The Speech recognition confidence between 0.0 and 1.0. A higher number
// indicates an estimated greater likelihood that the recognized words are
// correct. The default of 0.0 is a sentinel value indicating that confidence
// was not set.
//
// You should not rely on this field as it isn't guaranteed to be accurate, or
// even set. In particular this field isn't set in Webhook calls and for
// StreamingDetectIntent since the streaming endpoint has separate confidence
// estimates per portion of the audio in StreamingRecognitionResult.
float speech_recognition_confidence = 2;
// The action name from the matched intent.
string action = 3;
// The collection of extracted parameters.
google.protobuf.Struct parameters = 4;
// This field is set to:
// - `false` if the matched intent has required parameters and not all of
// the required parameter values have been collected.
// - `true` if all required parameter values have been collected, or if the
// matched intent doesn't contain any required parameters.
bool all_required_params_present = 5;
// The text to be pronounced to the user or shown on the screen.
string fulfillment_text = 6;
// The collection of rich messages to present to the user.
repeated Intent.Message fulfillment_messages = 7;
// If the query was fulfilled by a webhook call, this field is set to the
// value of the `source` field returned in the webhook response.
string webhook_source = 8;
// If the query was fulfilled by a webhook call, this field is set to the
// value of the `payload` field returned in the webhook response.
google.protobuf.Struct webhook_payload = 9;
// The collection of output contexts. If applicable,
// `output_contexts.parameters` contains entries with name
// `<parameter name>.original` containing the original parameter values
// before the query.
repeated Context output_contexts = 10;
// The intent that matched the conversational query. Some, not
// all fields are filled in this message, including but not limited to:
// `name`, `display_name` and `webhook_state`.
Intent intent = 11;
// The intent detection confidence. Values range from 0.0
// (completely uncertain) to 1.0 (completely certain).
float intent_detection_confidence = 12;
// The free-form diagnostic info. For example, this field
// could contain webhook call latency.
google.protobuf.Struct diagnostic_info = 14;
}
// The top-level message sent by the client to the
// `StreamingDetectIntent` method.
//
// Multiple request messages should be sent in order:
//
// 1. The first message must contain `session`, `query_input` plus optionally
// `query_params` and/or `single_utterance`. The message must not contain `input_audio`.
//
// 2. If `query_input` was set to a streaming input audio config,
// all subsequent messages must contain only `input_audio`.
// Otherwise, finish the request stream.
message StreamingDetectIntentRequest {
// Required. The name of the session the query is sent to.
// Format of the session name:
// `projects/<Project ID>/agent/sessions/<Session ID>`, or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>`. Note: Environments and users are under
// construction and will be available soon. If <Environment ID> is not
// specified, we assume default 'draft' environment. If <User ID> is not
// specified, we are using "-". Its up to the API caller to choose an
// appropriate <Session ID>. and <User Id>. They can be a random numbers or
// some type of user and session identifiers (preferably hashed). The length
// of the <Session ID> and <User ID> must not exceed 36 characters.
string session = 1;
// Optional. The parameters of this query.
QueryParameters query_params = 2;
// Required. The input specification. It can be set to:
//
// 1. an audio config which instructs the speech recognizer how to process
// the speech audio,
//
// 2. a conversational query in the form of text, or
//
// 3. an event that specifies which intent to trigger.
QueryInput query_input = 3;
// Optional. If `false` (default), recognition does not cease until the
// client closes the stream.
// If `true`, the recognizer will detect a single spoken utterance in input
// audio. Recognition ceases when it detects the audio's voice has
// stopped or paused. In this case, once a detected intent is received, the
// client should close the stream and start a new request with a new stream as
// needed.
// This setting is ignored when `query_input` is a piece of text or an event.
bool single_utterance = 4;
// Optional. The input audio content to be recognized. Must be sent if
// `query_input` was set to a streaming input audio config. The complete audio
// over all streaming messages must not exceed 1 minute.
bytes input_audio = 6;
}
// The top-level message returned from the
// `StreamingDetectIntent` method.
//
// Multiple response messages can be returned in order:
//
// 1. If the input was set to streaming audio, the first one or more messages
// contain `recognition_result`. Each `recognition_result` represents a more
// complete transcript of what the user said. The last `recognition_result`
// has `is_final` set to `true`.
//
// 2. The next message contains `response_id`, `query_result`
// and optionally `webhook_status` if a WebHook was called.
message StreamingDetectIntentResponse {
// The unique identifier of the response. It can be used to
// locate a response in the training example set or for reporting issues.
string response_id = 1;
// The result of speech recognition.
StreamingRecognitionResult recognition_result = 2;
// The result of the conversational query or event processing.
QueryResult query_result = 3;
// Specifies the status of the webhook request.
google.rpc.Status webhook_status = 4;
}
// Contains a speech recognition result corresponding to a portion of the audio
// that is currently being processed or an indication that this is the end
// of the single requested utterance.
//
// Example:
//
// 1. transcript: "tube"
//
// 2. transcript: "to be a"
//
// 3. transcript: "to be"
//
// 4. transcript: "to be or not to be"
// is_final: true
//
// 5. transcript: " that's"
//
// 6. transcript: " that is"
//
// 7. recognition_event_type: `RECOGNITION_EVENT_END_OF_SINGLE_UTTERANCE`
//
// 8. transcript: " that is the question"
// is_final: true
//
// Only two of the responses contain final results (#4 and #8 indicated by
// `is_final: true`). Concatenating these generates the full transcript: "to be
// or not to be that is the question".
//
// In each response we populate:
//
// * for `MESSAGE_TYPE_TRANSCRIPT`: `transcript` and possibly `is_final`.
//
// * for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `event_type`.
message StreamingRecognitionResult {
// Type of the response message.
enum MessageType {
// Not specified. Should never be used.
MESSAGE_TYPE_UNSPECIFIED = 0;
// Message contains a (possibly partial) transcript.
TRANSCRIPT = 1;
// Event indicates that the server has detected the end of the user's speech
// utterance and expects no additional speech. Therefore, the server will
// not process additional audio (although it may subsequently return
// additional results). The client should stop sending additional audio
// data, half-close the gRPC connection, and wait for any additional results
// until the server closes the gRPC connection. This message is only sent if
// `single_utterance` was set to `true`, and is not used otherwise.
END_OF_SINGLE_UTTERANCE = 2;
}
// Type of the result message.
MessageType message_type = 1;
// Transcript text representing the words that the user spoke.
// Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;
// The default of 0.0 is a sentinel value indicating `confidence` was not set.
// If `false`, the `StreamingRecognitionResult` represents an
// interim result that may change. If `true`, the recognizer will not return
// any further hypotheses about this piece of the audio. May only be populated
// for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
bool is_final = 3;
// The Speech confidence between 0.0 and 1.0 for the current portion of audio.
// A higher number indicates an estimated greater likelihood that the
// recognized words are correct. The default of 0.0 is a sentinel value
// indicating that confidence was not set.
//
// This field is typically only provided if `is_final` is true and you should
// not rely on it being accurate or even set.
float confidence = 4;
}
// Instructs the speech recognizer how to process the audio content.
message InputAudioConfig {
// Required. Audio encoding of the audio content to process.
AudioEncoding audio_encoding = 1;
// Required. Sample rate (in Hertz) of the audio content sent in the query.
// Refer to [Cloud Speech API documentation](/speech/docs/basics) for more
// details.
int32 sample_rate_hertz = 2;
// Required. The language of the supplied audio. Dialogflow does not do
// translations. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
string language_code = 3;
// Optional. The collection of phrase hints which are used to boost accuracy
// of speech recognition.
// Refer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints)
// for more details.
repeated string phrase_hints = 4;
}
// Represents the natural language text to be processed.
message TextInput {
// Required. The UTF-8 encoded natural language text to be processed.
// Text length must not exceed 256 bytes.
string text = 1;
// Required. The language of this conversational query. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
string language_code = 2;
}
// Events allow for matching intents by event name instead of the natural
// language input. For instance, input `<event: { name: “welcome_event”,
// parameters: { name: “Sam” } }>` can trigger a personalized welcome response.
// The parameter `name` may be used by the agent in the response:
// `“Hello #welcome_event.name! What can I do for you today?”`.
message EventInput {
// Required. The unique identifier of the event.
string name = 1;
// Optional. The collection of parameters associated with the event.
google.protobuf.Struct parameters = 2;
// Required. The language of this query. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
string language_code = 3;
}
// Audio encoding of the audio content sent in the conversational query request.
// Refer to the [Cloud Speech API documentation](/speech/docs/basics) for more
// details.
enum AudioEncoding {
// Not specified.
AUDIO_ENCODING_UNSPECIFIED = 0;
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
AUDIO_ENCODING_LINEAR_16 = 1;
// [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
// Codec) is the recommended encoding because it is lossless (therefore
// recognition is not compromised) and requires only about half the
// bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and
// 24-bit samples, however, not all fields in `STREAMINFO` are supported.
AUDIO_ENCODING_FLAC = 2;
// 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
AUDIO_ENCODING_MULAW = 3;
// Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
AUDIO_ENCODING_AMR = 4;
// Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
AUDIO_ENCODING_AMR_WB = 5;
// Opus encoded audio frames in Ogg container
// ([OggOpus](https://wiki.xiph.org/OggOpus)).
// `sample_rate_hertz` must be 16000.
AUDIO_ENCODING_OGG_OPUS = 6;
// Although the use of lossy encodings is not recommended, if a very low
// bitrate encoding is required, `OGG_OPUS` is highly preferred over
// Speex encoding. The [Speex](https://speex.org/) encoding supported by
// Dialogflow API has a header byte in each block, as in MIME type
// `audio/x-speex-with-header-byte`.
// It is a variant of the RTP Speex encoding defined in
// [RFC 5574](https://tools.ietf.org/html/rfc5574).
// The stream is a sequence of blocks, one block per RTP packet. Each block
// starts with a byte containing the length of the block, in bytes, followed
// by one or more frames of Speex data, padded to an integral number of
// bytes (octets) as specified in RFC 5574. In other words, each RTP header
// is replaced with a single byte containing the block length. Only Speex
// wideband is supported. `sample_rate_hertz` must be 16000.
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
}

View File

@@ -0,0 +1,232 @@
// Copyright 2018 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.cloud.dialogflow.v2beta1;
import "google/api/annotations.proto";
import "google/cloud/dialogflow/v2beta1/entity_type.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "SessionEntityTypeProto";
option java_package = "com.google.cloud.dialogflow.v2beta1";
option objc_class_prefix = "DF";
// Entities are extracted from user input and represent parameters that are
// meaningful to your application. For example, a date range, a proper name
// such as a geographic location or landmark, and so on. Entities represent
// actionable data for your application.
//
// Session entity types are referred to as **User** entity types and are
// entities that are built for an individual user such as
// favorites, preferences, playlists, and so on. You can redefine a session
// entity type at the session level.
//
// For more information about entity types, see the
// [Dialogflow documentation](https://dialogflow.com/docs/entities).
service SessionEntityTypes {
// Returns the list of all session entity types in the specified session.
rpc ListSessionEntityTypes(ListSessionEntityTypesRequest) returns (ListSessionEntityTypesResponse) {
option (google.api.http) = {
get: "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes"
additional_bindings {
get: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes"
}
};
}
// Retrieves the specified session entity type.
rpc GetSessionEntityType(GetSessionEntityTypeRequest) returns (SessionEntityType) {
option (google.api.http) = {
get: "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}"
additional_bindings {
get: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}"
}
};
}
// Creates a session entity type.
rpc CreateSessionEntityType(CreateSessionEntityTypeRequest) returns (SessionEntityType) {
option (google.api.http) = {
post: "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes"
body: "session_entity_type"
additional_bindings {
post: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes"
body: "session_entity_type"
}
};
}
// Updates the specified session entity type.
rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest) returns (SessionEntityType) {
option (google.api.http) = {
patch: "/v2beta1/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}"
body: "session_entity_type"
additional_bindings {
patch: "/v2beta1/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}"
body: "session_entity_type"
}
};
}
// Deletes the specified session entity type.
rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}"
additional_bindings {
delete: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}"
}
};
}
}
// Represents a session entity type.
//
// Extends or replaces a developer entity type at the user session level (we
// refer to the entity types defined at the agent level as "developer entity
// types").
//
// Note: session entity types apply to all queries, regardless of the language.
message SessionEntityType {
// The types of modifications for a session entity type.
enum EntityOverrideMode {
// Not specified. This value should be never used.
ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0;
// The collection of session entities overrides the collection of entities
// in the corresponding developer entity type.
ENTITY_OVERRIDE_MODE_OVERRIDE = 1;
// The collection of session entities extends the collection of entities in
// the corresponding developer entity type.
// Calls to `ListSessionEntityTypes`, `GetSessionEntityType`,
// `CreateSessionEntityType` and `UpdateSessionEntityType` return the full
// collection of entities from the developer entity type in the agent's
// default language and the session entity type.
ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2;
}
// Required. The unique identifier of this session entity type. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
// Display Name>`, or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions
// /<Session ID>/entityTypes/<Entity Type Display Name>`.
// Note: Environments and users are under construction and will be available
// soon. If <Environment ID> is not specified, we assume default 'draft'
// environment. If <User ID> is not specified, we assume default '-' user.
string name = 1;
// Required. Indicates whether the additional data should override or
// supplement the developer entity type definition.
EntityOverrideMode entity_override_mode = 2;
// Required. The collection of entities associated with this session entity
// type.
repeated EntityType.Entity entities = 3;
}
// The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypes].
message ListSessionEntityTypesRequest {
// Required. The session to list all session entity types from.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/
// sessions/<Session ID>`.
// Note: Environments and users are under construction and will be available
// soon. If <Environment ID> is not specified, we assume default 'draft'
// environment. If <User ID> is not specified, we assume default '-' user.
string parent = 1;
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 2;
// Optional. The next_page_token value returned from a previous list request.
string page_token = 3;
}
// The response message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypes].
message ListSessionEntityTypesResponse {
// The list of session entity types. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated SessionEntityType session_entity_types = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.GetSessionEntityType].
message GetSessionEntityTypeRequest {
// Required. The name of the session entity type. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
// Display Name>` or `projects/<Project ID>/agent/environments/<Environment
// ID>/users/<User ID>/sessions/<Session ID>/
// entityTypes/<Entity Type Display Name>`.
// Note: Environments and users re under construction and will be available
// soon. If <Environment ID> is not specified, we assume default 'draft'
// environment. If <User ID> is not specified, we assume default '-' user.
string name = 1;
}
// The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.CreateSessionEntityType].
message CreateSessionEntityTypeRequest {
// Required. The session to create a session entity type for.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/
// sessions/<Session ID>`.
// Note: Environments and users are under construction and will be available
// soon. If <Environment ID> is not specified, we assume default 'draft'
// environment. If <User ID> is not specified, we assume default '-' user.
string parent = 1;
// Required. The session entity type to create.
SessionEntityType session_entity_type = 2;
}
// The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.UpdateSessionEntityType].
message UpdateSessionEntityTypeRequest {
// Required. The entity type to update. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
// Display Name>` or `projects/<Project ID>/agent/environments/<Environment
// ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display
// Name>`.
// Note: Environments and users are under construction and will be available
// soon. If <Environment ID> is not specified, we assume default 'draft'
// environment. If <User ID> is not specified, we assume default '-' user.
SessionEntityType session_entity_type = 1;
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 2;
}
// The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.DeleteSessionEntityType].
message DeleteSessionEntityTypeRequest {
// Required. The name of the entity type to delete. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
// Display Name>` or `projects/<Project ID>/agent/environments/<Environment
// ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display
// Name>`.
// Note: Environments and users are under construction and will be available
// soon. If <Environment ID> is not specified, we assume default 'draft'
// environment. If <User ID> is not specified, we assume default '-' user.
string name = 1;
}

View File

@@ -0,0 +1,111 @@
// Copyright 2018 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.cloud.dialogflow.v2beta1;
import "google/api/annotations.proto";
import "google/cloud/dialogflow/v2beta1/context.proto";
import "google/cloud/dialogflow/v2beta1/intent.proto";
import "google/cloud/dialogflow/v2beta1/session.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "WebhookProto";
option java_package = "com.google.cloud.dialogflow.v2beta1";
option objc_class_prefix = "DF";
// The request message for a webhook call.
message WebhookRequest {
// The unique identifier of detectIntent request session.
// Can be used to identify end-user inside webhook implementation.
// Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
string session = 4;
// The unique identifier of the response. Contains the same value as
// `[Streaming]DetectIntentResponse.response_id`.
string response_id = 1;
// The result of the conversational query or event processing. Contains the
// same value as `[Streaming]DetectIntentResponse.query_result`.
QueryResult query_result = 2;
// Optional. The contents of the original request that was passed to
// `[Streaming]DetectIntent` call.
OriginalDetectIntentRequest original_detect_intent_request = 3;
}
// The response message for a webhook call.
message WebhookResponse {
// Optional. The text to be shown on the screen. This value is passed directly
// to `QueryResult.fulfillment_text`.
string fulfillment_text = 1;
// Optional. The collection of rich messages to present to the user. This
// value is passed directly to `QueryResult.fulfillment_messages`.
repeated Intent.Message fulfillment_messages = 2;
// Optional. This value is passed directly to `QueryResult.webhook_source`.
string source = 3;
// Optional. This value is passed directly to `QueryResult.webhook_payload`.
// See the related `fulfillment_messages[i].payload field`, which may be used
// as an alternative to this field.
//
// This field can be used for Actions on Google responses.
// It should have a structure similar to the JSON message shown here. For more
// information, see
// [Actions on Google Webhook
// Format](https://developers.google.com/actions/dialogflow/webhook)
// <pre>{
// "google": {
// "expectUserResponse": true,
// "richResponse": {
// "items": [
// {
// "simpleResponse": {
// "textToSpeech": "this is a simple response"
// }
// }
// ]
// }
// }
// }</pre>
google.protobuf.Struct payload = 4;
// Optional. The collection of output contexts. This value is passed directly
// to `QueryResult.output_contexts`.
repeated Context output_contexts = 5;
// Optional. Makes the platform immediately invoke another `DetectIntent` call
// internally with the specified event as input.
EventInput followup_event_input = 6;
}
// Represents the contents of the original request that was passed to
// the `[Streaming]DetectIntent` call.
message OriginalDetectIntentRequest {
// The source of this request, e.g., `google`, `facebook`, `slack`. It is set
// by Dialogflow-owned servers.
string source = 1;
// Optional. This field is set to the value of `QueryParameters.payload` field
// passed in the request.
google.protobuf.Struct payload = 3;
}

View File

@@ -0,0 +1,295 @@
// Copyright 2017 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.cloud.functions.v1beta2;
import "google/api/annotations.proto";
import "google/api/auth.proto";
import "google/cloud/functions/v1beta2/operations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v1beta2;functions";
option java_multiple_files = true;
option java_outer_classname = "FunctionsProto";
option java_package = "com.google.cloud.functions.v1beta2";
option objc_class_prefix = "GCF";
// A service that application uses to manipulate triggers and functions.
service CloudFunctionsService {
// Returns a list of functions that belong to the requested project.
rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) {
option (google.api.http) = { get: "/v1beta2/{location=projects/*/locations/*}/functions" };
}
// Returns a function with the given name from the requested project.
rpc GetFunction(GetFunctionRequest) returns (CloudFunction) {
option (google.api.http) = { get: "/v1beta2/{name=projects/*/locations/*/functions/*}" };
}
// Creates a new function. If a function with the given name already exists in
// the specified project, the long running operation will return
// `ALREADY_EXISTS` error.
rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1beta2/{location=projects/*/locations/*}/functions" body: "function" };
}
// Updates existing function.
rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { put: "/v1beta2/{name=projects/*/locations/*/functions/*}" body: "function" };
}
// Deletes a function with the given name from the specified project. If the
// given function is used by some trigger, the trigger will be updated to
// remove this function.
rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { delete: "/v1beta2/{name=projects/*/locations/*/functions/*}" };
}
// Invokes synchronously deployed function. To be used for testing, very
// limited traffic allowed.
rpc CallFunction(CallFunctionRequest) returns (CallFunctionResponse) {
option (google.api.http) = { post: "/v1beta2/{name=projects/*/locations/*/functions/*}:call" body: "*" };
}
}
// Describes a Cloud Function that contains user computation executed in
// response to an event. It encapsulate function and triggers configurations.
message CloudFunction {
// A user-defined name of the function. Function names must be unique
// globally and match pattern `projects/*/locations/*/functions/*`
string name = 1;
// The location of the function source code.
oneof source_code {
// The URL, starting with gs://, pointing to the zip archive which contains
// the function.
string source_archive_url = 14;
// The hosted repository where the function is defined.
SourceRepository source_repository = 3;
}
// An event that triggers the function.
oneof trigger {
// An HTTPS endpoint type of source that can be triggered via URL.
HTTPSTrigger https_trigger = 6;
// A source that fires events in response to a condition in another service.
EventTrigger event_trigger = 12;
}
// Output only. Status of the function deployment.
CloudFunctionStatus status = 7;
// Output only. Name of the most recent operation modifying the function. If
// the function status is `DEPLOYING` or `DELETING`, then it points to the
// active operation.
string latest_operation = 8;
// The name of the function (as defined in source code) that will be
// executed. Defaults to the resource name suffix, if not specified. For
// backward compatibility, if function with given name is not found, then the
// system will try to use function named "function".
// For Node.js this is name of a function exported by the module specified
// in `source_location`.
string entry_point = 9;
// The function execution timeout. Execution is considered failed and
// can be terminated if the function is not completed at the end of the
// timeout period. Defaults to 60 seconds.
google.protobuf.Duration timeout = 10;
// The amount of memory in MB available for a function.
// Defaults to 256MB.
int32 available_memory_mb = 11;
// Output only. The service account of the function.
string service_account = 13;
// Output only. The last update timestamp of a Cloud Function.
google.protobuf.Timestamp update_time = 15;
}
// Describes HTTPSTrigger, could be used to connect web hooks to function.
message HTTPSTrigger {
// Output only. The deployed url for the function.
string url = 1;
}
// Describes EventTrigger, used to request events be sent from another
// service.
message EventTrigger {
// `event_type` names contain the service that is sending an event and the
// kind of event that was fired. Must be of the form
// `providers/*/eventTypes/*` e.g. Directly handle a Message published to
// Google Cloud Pub/Sub `providers/cloud.pubsub/eventTypes/topic.publish`
//
// Handle an object changing in Google Cloud Storage
// `providers/cloud.storage/eventTypes/object.change`
//
// Handle a write to the Firebase Realtime Database
// `providers/firebase.database/eventTypes/data.write`
string event_type = 1;
// Which instance of the source's service should send events. E.g. for Pub/Sub
// this would be a Pub/Sub topic at `projects/*/topics/*`. For Google Cloud
// Storage this would be a bucket at `projects/*/buckets/*`. For any source
// that only supports one instance per-project, this should be the name of the
// project (`projects/*`)
string resource = 2;
}
// Describes the location of the function source in a remote repository.
message SourceRepository {
// URL to the hosted repository where the function is defined. Only paths in
// https://source.developers.google.com domain are supported. The path should
// contain the name of the repository.
string repository_url = 1;
// The path within the repository where the function is defined. The path
// should point to the directory where Cloud Functions files are located. Use
// "/" if the function is defined directly in the root directory of a
// repository.
string source_path = 2;
// The version of a function. Defaults to the latest version of the master
// branch.
oneof version {
// The name of the branch from which the function should be fetched.
string branch = 3;
// The name of the tag that captures the state of the repository from
// which the function should be fetched.
string tag = 4;
// The id of the revision that captures the state of the repository from
// which the function should be fetched.
string revision = 5;
}
// Output only. The id of the revision that was resolved at the moment of
// function creation or update. For example when a user deployed from a
// branch, it will be the revision id of the latest change on this branch at
// that time. If user deployed from revision then this value will be always
// equal to the revision specified by the user.
string deployed_revision = 6;
}
// Request for the `CreateFunction` method.
message CreateFunctionRequest {
// The project and location in which the function should be created, specified
// in the format `projects/*/locations/*`
string location = 1;
// Function to be created.
CloudFunction function = 2;
}
// Request for the `UpdateFunction` method.
message UpdateFunctionRequest {
// The name of the function to be updated.
string name = 1;
// New version of the function.
CloudFunction function = 2;
}
// Request for the `GetFunction` method.
message GetFunctionRequest {
// The name of the function which details should be obtained.
string name = 1;
}
// Request for the `ListFunctions` method.
message ListFunctionsRequest {
// The project and location from which the function should be listed,
// specified in the format `projects/*/locations/*`
// If you want to list functions in all locations, use "-" in place of a
// location.
string location = 1;
// Maximum number of functions to return per call.
int32 page_size = 2;
// The value returned by the last
// `ListFunctionsResponse`; indicates that
// this is a continuation of a prior `ListFunctions` call, and that the
// system should return the next page of data.
string page_token = 3;
}
// Response for the `ListFunctions` method.
message ListFunctionsResponse {
// The functions that match the request.
repeated CloudFunction functions = 1;
// If not empty, indicates that there may be more functions that match
// the request; this value should be passed in a new
// [google.cloud.functions.v1beta2.ListFunctionsRequest][]
// to get more functions.
string next_page_token = 2;
}
// Request for the `DeleteFunction` method.
message DeleteFunctionRequest {
// The name of the function which should be deleted.
string name = 1;
}
// Request for the `CallFunction` method.
message CallFunctionRequest {
// The name of the function to be called.
string name = 1;
// Input to be passed to the function.
string data = 2;
}
// Response of `CallFunction` method.
message CallFunctionResponse {
// Execution id of function invocation.
string execution_id = 1;
// Result populated for successful execution of synchronous function. Will
// not be populated if function does not return a result through context.
string result = 2;
// Either system or user-function generated error. Set if execution
// was not successful.
string error = 3;
}
// Describes the current stage of a deployment.
enum CloudFunctionStatus {
// Status not specified.
STATUS_UNSPECIFIED = 0;
// Successfully deployed.
READY = 1;
// Not deployed correctly - behavior is undefined. The item should be updated
// or deleted to move it out of this state.
FAILED = 2;
// Creation or update in progress.
DEPLOYING = 3;
// Deletion in progress.
DELETING = 4;
}

View File

@@ -0,0 +1,54 @@
// Copyright 2017 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.cloud.functions.v1beta2;
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v1beta2;functions";
option java_multiple_files = true;
option java_outer_classname = "FunctionsOperationsProto";
option java_package = "com.google.cloud.functions.v1beta2";
// Metadata describing an [Operation][google.longrunning.Operation]
message OperationMetadataV1Beta2 {
// Target of the operation - for example
// projects/project-1/locations/region-1/functions/function-1
string target = 1;
// Type of operation.
OperationType type = 2;
// The original request that started the operation.
google.protobuf.Any request = 3;
}
// A type of an operation.
enum OperationType {
// Unknown operation type.
OPERATION_UNSPECIFIED = 0;
// Triggered by CreateFunction call
CREATE_FUNCTION = 1;
// Triggered by UpdateFunction call
UPDATE_FUNCTION = 2;
// Triggered by DeleteFunction call.
DELETE_FUNCTION = 3;
}

View File

@@ -0,0 +1,419 @@
// Copyright 2018 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.cloud.iot.v1;
import "google/api/annotations.proto";
import "google/cloud/iot/v1/resources.proto";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/cloud/iot/v1;iot";
option java_multiple_files = true;
option java_outer_classname = "DeviceManagerProto";
option java_package = "com.google.cloud.iot.v1";
// Internet of things (IoT) service. Allows to manipulate device registry
// instances and the registration of devices (Things) to the cloud.
service DeviceManager {
// Creates a device registry that contains devices.
rpc CreateDeviceRegistry(CreateDeviceRegistryRequest) returns (DeviceRegistry) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/registries"
body: "device_registry"
};
}
// Gets a device registry configuration.
rpc GetDeviceRegistry(GetDeviceRegistryRequest) returns (DeviceRegistry) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/registries/*}"
};
}
// Updates a device registry configuration.
rpc UpdateDeviceRegistry(UpdateDeviceRegistryRequest) returns (DeviceRegistry) {
option (google.api.http) = {
patch: "/v1/{device_registry.name=projects/*/locations/*/registries/*}"
body: "device_registry"
};
}
// Deletes a device registry configuration.
rpc DeleteDeviceRegistry(DeleteDeviceRegistryRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/registries/*}"
};
}
// Lists device registries.
rpc ListDeviceRegistries(ListDeviceRegistriesRequest) returns (ListDeviceRegistriesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/registries"
};
}
// Creates a device in a device registry.
rpc CreateDevice(CreateDeviceRequest) returns (Device) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/registries/*}/devices"
body: "device"
};
}
// Gets details about a device.
rpc GetDevice(GetDeviceRequest) returns (Device) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/registries/*/devices/*}"
additional_bindings {
get: "/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}"
}
};
}
// Updates a device.
rpc UpdateDevice(UpdateDeviceRequest) returns (Device) {
option (google.api.http) = {
patch: "/v1/{device.name=projects/*/locations/*/registries/*/devices/*}"
body: "device"
additional_bindings {
patch: "/v1/{device.name=projects/*/locations/*/registries/*/groups/*/devices/*}"
body: "device"
}
};
}
// Deletes a device.
rpc DeleteDevice(DeleteDeviceRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/registries/*/devices/*}"
additional_bindings {
delete: "/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}"
}
};
}
// List devices in a device registry.
rpc ListDevices(ListDevicesRequest) returns (ListDevicesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/registries/*}/devices"
additional_bindings {
get: "/v1/{parent=projects/*/locations/*/groups/*}/devices"
}
};
}
// Modifies the configuration for the device, which is eventually sent from
// the Cloud IoT Core servers. Returns the modified configuration version and
// its metadata.
rpc ModifyCloudToDeviceConfig(ModifyCloudToDeviceConfigRequest) returns (DeviceConfig) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/registries/*/devices/*}:modifyCloudToDeviceConfig"
body: "*"
additional_bindings {
post: "/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:modifyCloudToDeviceConfig"
body: "*"
}
};
}
// Lists the last few versions of the device configuration in descending
// order (i.e.: newest first).
rpc ListDeviceConfigVersions(ListDeviceConfigVersionsRequest) returns (ListDeviceConfigVersionsResponse) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/registries/*/devices/*}/configVersions"
additional_bindings {
get: "/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/configVersions"
}
};
}
// Lists the last few versions of the device state in descending order (i.e.:
// newest first).
rpc ListDeviceStates(ListDeviceStatesRequest) returns (ListDeviceStatesResponse) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/registries/*/devices/*}/states"
additional_bindings {
get: "/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/states"
}
};
}
// Sets the access control policy on the specified resource. Replaces any
// existing policy.
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = {
post: "/v1/{resource=projects/*/locations/*/registries/*}:setIamPolicy"
body: "*"
additional_bindings {
post: "/v1/{resource=projects/*/locations/*/registries/*/groups/*}:setIamPolicy"
body: "*"
}
};
}
// Gets the access control policy for a resource.
// Returns an empty policy if the resource exists and does not have a policy
// set.
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = {
post: "/v1/{resource=projects/*/locations/*/registries/*}:getIamPolicy"
body: "*"
additional_bindings {
post: "/v1/{resource=projects/*/locations/*/registries/*/groups/*}:getIamPolicy"
body: "*"
}
};
}
// Returns permissions that a caller has on the specified resource.
// If the resource does not exist, this will return an empty set of
// permissions, not a NOT_FOUND error.
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
option (google.api.http) = {
post: "/v1/{resource=projects/*/locations/*/registries/*}:testIamPermissions"
body: "*"
additional_bindings {
post: "/v1/{resource=projects/*/locations/*/registries/*/groups/*}:testIamPermissions"
body: "*"
}
};
}
}
// Request for `CreateDeviceRegistry`.
message CreateDeviceRegistryRequest {
// The project and cloud region where this device registry must be created.
// For example, `projects/example-project/locations/us-central1`.
string parent = 1;
// The device registry. The field `name` must be empty. The server will
// generate that field from the device registry `id` provided and the
// `parent` field.
DeviceRegistry device_registry = 2;
}
// Request for `GetDeviceRegistry`.
message GetDeviceRegistryRequest {
// The name of the device registry. For example,
// `projects/example-project/locations/us-central1/registries/my-registry`.
string name = 1;
}
// Request for `DeleteDeviceRegistry`.
message DeleteDeviceRegistryRequest {
// The name of the device registry. For example,
// `projects/example-project/locations/us-central1/registries/my-registry`.
string name = 1;
}
// Request for `UpdateDeviceRegistry`.
message UpdateDeviceRegistryRequest {
// The new values for the device registry. The `id` field must be empty, and
// the `name` field must indicate the path of the resource. For example,
// `projects/example-project/locations/us-central1/registries/my-registry`.
DeviceRegistry device_registry = 1;
// Only updates the `device_registry` fields indicated by this mask.
// The field mask must not be empty, and it must not contain fields that
// are immutable or only set by the server.
// Mutable top-level fields: `event_notification_config`, `http_config`,
// `mqtt_config`, and `state_notification_config`.
google.protobuf.FieldMask update_mask = 2;
}
// Request for `ListDeviceRegistries`.
message ListDeviceRegistriesRequest {
// The project and cloud region path. For example,
// `projects/example-project/locations/us-central1`.
string parent = 1;
// The maximum number of registries to return in the response. If this value
// is zero, the service will select a default size. A call may return fewer
// objects than requested, but if there is a non-empty `page_token`, it
// indicates that more entries are available.
int32 page_size = 2;
// The value returned by the last `ListDeviceRegistriesResponse`; indicates
// that this is a continuation of a prior `ListDeviceRegistries` call, and
// that the system should return the next page of data.
string page_token = 3;
}
// Response for `ListDeviceRegistries`.
message ListDeviceRegistriesResponse {
// The registries that matched the query.
repeated DeviceRegistry device_registries = 1;
// If not empty, indicates that there may be more registries that match the
// request; this value should be passed in a new
// `ListDeviceRegistriesRequest`.
string next_page_token = 2;
}
// Request for `CreateDevice`.
message CreateDeviceRequest {
// The name of the device registry where this device should be created.
// For example,
// `projects/example-project/locations/us-central1/registries/my-registry`.
string parent = 1;
// The device registration details. The field `name` must be empty. The server
// will generate that field from the device registry `id` provided and the
// `parent` field.
Device device = 2;
}
// Request for `GetDevice`.
message GetDeviceRequest {
// The name of the device. For example,
// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
string name = 1;
// The fields of the `Device` resource to be returned in the response. If the
// field mask is unset or empty, all fields are returned.
google.protobuf.FieldMask field_mask = 2;
}
// Request for `UpdateDevice`.
message UpdateDeviceRequest {
// The new values for the device registry. The `id` and `num_id` fields must
// be empty, and the field `name` must specify the name path. For example,
// `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
Device device = 2;
// Only updates the `device` fields indicated by this mask.
// The field mask must not be empty, and it must not contain fields that
// are immutable or only set by the server.
// Mutable top-level fields: `credentials`, `blocked`, and `metadata`
google.protobuf.FieldMask update_mask = 3;
}
// Request for `DeleteDevice`.
message DeleteDeviceRequest {
// The name of the device. For example,
// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
string name = 1;
}
// Request for `ListDevices`.
message ListDevicesRequest {
// The device registry path. Required. For example,
// `projects/my-project/locations/us-central1/registries/my-registry`.
string parent = 1;
// A list of device numerical ids. If empty, it will ignore this field. This
// field cannot hold more than 10,000 entries.
repeated uint64 device_num_ids = 2;
// A list of device string identifiers. If empty, it will ignore this field.
// For example, `['device0', 'device12']`. This field cannot hold more than
// 10,000 entries.
repeated string device_ids = 3;
// The fields of the `Device` resource to be returned in the response. The
// fields `id`, and `num_id` are always returned by default, along with any
// other fields specified.
google.protobuf.FieldMask field_mask = 4;
// The maximum number of devices to return in the response. If this value
// is zero, the service will select a default size. A call may return fewer
// objects than requested, but if there is a non-empty `page_token`, it
// indicates that more entries are available.
int32 page_size = 100;
// The value returned by the last `ListDevicesResponse`; indicates
// that this is a continuation of a prior `ListDevices` call, and
// that the system should return the next page of data.
string page_token = 101;
}
// Response for `ListDevices`.
message ListDevicesResponse {
// The devices that match the request.
repeated Device devices = 1;
// If not empty, indicates that there may be more devices that match the
// request; this value should be passed in a new `ListDevicesRequest`.
string next_page_token = 2;
}
// Request for `ModifyCloudToDeviceConfig`.
message ModifyCloudToDeviceConfigRequest {
// The name of the device. For example,
// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
string name = 1;
// The version number to update. If this value is zero, it will not check the
// version number of the server and will always update the current version;
// otherwise, this update will fail if the version number found on the server
// does not match this version number. This is used to support multiple
// simultaneous updates without losing data.
int64 version_to_update = 2;
// The configuration data for the device.
bytes binary_data = 3;
}
// Request for `ListDeviceConfigVersions`.
message ListDeviceConfigVersionsRequest {
// The name of the device. For example,
// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
string name = 1;
// The number of versions to list. Versions are listed in decreasing order of
// the version number. The maximum number of versions retained is 10. If this
// value is zero, it will return all the versions available.
int32 num_versions = 2;
}
// Response for `ListDeviceConfigVersions`.
message ListDeviceConfigVersionsResponse {
// The device configuration for the last few versions. Versions are listed
// in decreasing order, starting from the most recent one.
repeated DeviceConfig device_configs = 1;
}
// Request for `ListDeviceStates`.
message ListDeviceStatesRequest {
// The name of the device. For example,
// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
string name = 1;
// The number of states to list. States are listed in descending order of
// update time. The maximum number of states retained is 10. If this
// value is zero, it will return all the states available.
int32 num_states = 2;
}
// Response for `ListDeviceStates`.
message ListDeviceStatesResponse {
// The last few device states. States are listed in descending order of server
// update time, starting from the most recent one.
repeated DeviceState device_states = 1;
}

View File

@@ -0,0 +1,385 @@
// Copyright 2018 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.cloud.iot.v1;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/cloud/iot/v1;iot";
option java_multiple_files = true;
option java_outer_classname = "ResourcesProto";
option java_package = "com.google.cloud.iot.v1";
// The device resource.
message Device {
// The user-defined device identifier. The device ID must be unique
// within a device registry.
string id = 1;
// The resource path name. For example,
// `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
// `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
// When `name` is populated as a response from the service, it always ends
// in the device numeric ID.
string name = 2;
// [Output only] A server-defined unique numeric ID for the device. This is a
// more compact way to identify devices, and it is globally unique.
uint64 num_id = 3;
// The credentials used to authenticate this device. To allow credential
// rotation without interruption, multiple device credentials can be bound to
// this device. No more than 3 credentials can be bound to a single device at
// a time. When new credentials are added to a device, they are verified
// against the registry credentials. For details, see the description of the
// `DeviceRegistry.credentials` field.
repeated DeviceCredential credentials = 12;
// [Output only] The last time an MQTT `PINGREQ` was received. This field
// applies only to devices connecting through MQTT. MQTT clients usually only
// send `PINGREQ` messages if the connection is idle, and no other messages
// have been sent. Timestamps are periodically collected and written to
// storage; they may be stale by a few minutes.
google.protobuf.Timestamp last_heartbeat_time = 7;
// [Output only] The last time a telemetry event was received. Timestamps are
// periodically collected and written to storage; they may be stale by a few
// minutes.
google.protobuf.Timestamp last_event_time = 8;
// [Output only] The last time a state event was received. Timestamps are
// periodically collected and written to storage; they may be stale by a few
// minutes.
google.protobuf.Timestamp last_state_time = 20;
// [Output only] The last time a cloud-to-device config version acknowledgment
// was received from the device. This field is only for configurations
// sent through MQTT.
google.protobuf.Timestamp last_config_ack_time = 14;
// [Output only] The last time a cloud-to-device config version was sent to
// the device.
google.protobuf.Timestamp last_config_send_time = 18;
// If a device is blocked, connections or requests from this device will fail.
// Can be used to temporarily prevent the device from connecting if, for
// example, the sensor is generating bad data and needs maintenance.
bool blocked = 19;
// [Output only] The time the most recent error occurred, such as a failure to
// publish to Cloud Pub/Sub. This field is the timestamp of
// 'last_error_status'.
google.protobuf.Timestamp last_error_time = 10;
// [Output only] The error message of the most recent error, such as a failure
// to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this
// field. If no errors have occurred, this field has an empty message
// and the status code 0 == OK. Otherwise, this field is expected to have a
// status code other than OK.
google.rpc.Status last_error_status = 11;
// The most recent device configuration, which is eventually sent from
// Cloud IoT Core to the device. If not present on creation, the
// configuration will be initialized with an empty payload and version value
// of `1`. To update this field after creation, use the
// `DeviceManager.ModifyCloudToDeviceConfig` method.
DeviceConfig config = 13;
// [Output only] The state most recently received from the device. If no state
// has been reported, this field is not present.
DeviceState state = 16;
// The metadata key-value pairs assigned to the device. This metadata is not
// interpreted or indexed by Cloud IoT Core. It can be used to add contextual
// information for the device.
//
// Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and
// be less than 128 bytes in length.
//
// Values are free-form strings. Each value must be less than or equal to 32
// KB in size.
//
// The total size of all keys and values must be less than 256 KB, and the
// maximum number of key-value pairs is 500.
map<string, string> metadata = 17;
}
// A container for a group of devices.
message DeviceRegistry {
// The identifier of this device registry. For example, `myRegistry`.
string id = 1;
// The resource path name. For example,
// `projects/example-project/locations/us-central1/registries/my-registry`.
string name = 2;
// The configuration for notification of telemetry events received from the
// device. All telemetry events that were successfully published by the
// device and acknowledged by Cloud IoT Core are guaranteed to be
// delivered to Cloud Pub/Sub. If multiple configurations match a message,
// only the first matching configuration is used. If you try to publish a
// device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
// for the device's registry, the connection closes automatically. If you try
// to do so using an HTTP connection, an error is returned. Up to 10
// configurations may be provided.
repeated EventNotificationConfig event_notification_configs = 10;
// The configuration for notification of new states received from the device.
// State updates are guaranteed to be stored in the state history, but
// notifications to Cloud Pub/Sub are not guaranteed. For example, if
// permissions are misconfigured or the specified topic doesn't exist, no
// notification will be published but the state will still be stored in Cloud
// IoT Core.
StateNotificationConfig state_notification_config = 7;
// The MQTT configuration for this device registry.
MqttConfig mqtt_config = 4;
// The DeviceService (HTTP) configuration for this device registry.
HttpConfig http_config = 9;
// The credentials used to verify the device credentials. No more than 10
// credentials can be bound to a single registry at a time. The verification
// process occurs at the time of device creation or update. If this field is
// empty, no verification is performed. Otherwise, the credentials of a newly
// created device or added credentials of an updated device should be signed
// with one of these registry credentials.
//
// Note, however, that existing devices will never be affected by
// modifications to this list of credentials: after a device has been
// successfully created in a registry, it should be able to connect even if
// its registry credentials are revoked, deleted, or modified.
repeated RegistryCredential credentials = 8;
}
// The configuration of MQTT for a device registry.
message MqttConfig {
// If enabled, allows connections using the MQTT protocol. Otherwise, MQTT
// connections to this registry will fail.
MqttState mqtt_enabled_state = 1;
}
// The configuration of the HTTP bridge for a device registry.
message HttpConfig {
// If enabled, allows devices to use DeviceService via the HTTP protocol.
// Otherwise, any requests to DeviceService will fail for this registry.
HttpState http_enabled_state = 1;
}
// The configuration for forwarding telemetry events.
message EventNotificationConfig {
// If the subfolder name matches this string exactly, this configuration will
// be used. The string must not include the leading '/' character. If empty,
// all strings are matched. This field is used only for telemetry events;
// subfolders are not supported for state changes.
string subfolder_matches = 2;
// A Cloud Pub/Sub topic name. For example,
// `projects/myProject/topics/deviceEvents`.
string pubsub_topic_name = 1;
}
// The configuration for notification of new states received from the device.
message StateNotificationConfig {
// A Cloud Pub/Sub topic name. For example,
// `projects/myProject/topics/deviceEvents`.
string pubsub_topic_name = 1;
}
// A server-stored registry credential used to validate device credentials.
message RegistryCredential {
// The credential data. Reserved for expansion in the future.
oneof credential {
// A public key certificate used to verify the device credentials.
PublicKeyCertificate public_key_certificate = 1;
}
}
// Details of an X.509 certificate. For informational purposes only.
message X509CertificateDetails {
// The entity that signed the certificate.
string issuer = 1;
// The entity the certificate and public key belong to.
string subject = 2;
// The time the certificate becomes valid.
google.protobuf.Timestamp start_time = 3;
// The time the certificate becomes invalid.
google.protobuf.Timestamp expiry_time = 4;
// The algorithm used to sign the certificate.
string signature_algorithm = 5;
// The type of public key in the certificate.
string public_key_type = 6;
}
// A public key certificate format and data.
message PublicKeyCertificate {
// The certificate format.
PublicKeyCertificateFormat format = 1;
// The certificate data.
string certificate = 2;
// [Output only] The certificate details. Used only for X.509 certificates.
X509CertificateDetails x509_details = 3;
}
// A server-stored device credential used for authentication.
message DeviceCredential {
// The credential data. Reserved for expansion in the future.
oneof credential {
// A public key used to verify the signature of JSON Web Tokens (JWTs).
// When adding a new device credential, either via device creation or via
// modifications, this public key credential may be required to be signed by
// one of the registry level certificates. More specifically, if the
// registry contains at least one certificate, any new device credential
// must be signed by one of the registry certificates. As a result,
// when the registry contains certificates, only X.509 certificates are
// accepted as device credentials. However, if the registry does
// not contain a certificate, self-signed certificates and public keys will
// be accepted. New device credentials must be different from every
// registry-level certificate.
PublicKeyCredential public_key = 2;
}
// [Optional] The time at which this credential becomes invalid. This
// credential will be ignored for new client authentication requests after
// this timestamp; however, it will not be automatically deleted.
google.protobuf.Timestamp expiration_time = 6;
}
// A public key format and data.
message PublicKeyCredential {
// The format of the key.
PublicKeyFormat format = 1;
// The key data.
string key = 2;
}
// The device configuration. Eventually delivered to devices.
message DeviceConfig {
// [Output only] The version of this update. The version number is assigned by
// the server, and is always greater than 0 after device creation. The
// version must be 0 on the `CreateDevice` request if a `config` is
// specified; the response of `CreateDevice` will always have a value of 1.
int64 version = 1;
// [Output only] The time at which this configuration version was updated in
// Cloud IoT Core. This timestamp is set by the server.
google.protobuf.Timestamp cloud_update_time = 2;
// [Output only] The time at which Cloud IoT Core received the
// acknowledgment from the device, indicating that the device has received
// this configuration version. If this field is not present, the device has
// not yet acknowledged that it received this version. Note that when
// the config was sent to the device, many config versions may have been
// available in Cloud IoT Core while the device was disconnected, and on
// connection, only the latest version is sent to the device. Some
// versions may never be sent to the device, and therefore are never
// acknowledged. This timestamp is set by Cloud IoT Core.
google.protobuf.Timestamp device_ack_time = 3;
// The device configuration data.
bytes binary_data = 4;
}
// The device state, as reported by the device.
message DeviceState {
// [Output only] The time at which this state version was updated in Cloud
// IoT Core.
google.protobuf.Timestamp update_time = 1;
// The device state data.
bytes binary_data = 2;
}
// Indicates whether an MQTT connection is enabled or disabled. See the field
// description for details.
enum MqttState {
// No MQTT state specified. If not specified, MQTT will be enabled by default.
MQTT_STATE_UNSPECIFIED = 0;
// Enables a MQTT connection.
MQTT_ENABLED = 1;
// Disables a MQTT connection.
MQTT_DISABLED = 2;
}
// Indicates whether DeviceService (HTTP) is enabled or disabled for the
// registry. See the field description for details.
enum HttpState {
// No HTTP state specified. If not specified, DeviceService will be
// enabled by default.
HTTP_STATE_UNSPECIFIED = 0;
// Enables DeviceService (HTTP) service for the registry.
HTTP_ENABLED = 1;
// Disables DeviceService (HTTP) service for the registry.
HTTP_DISABLED = 2;
}
// The supported formats for the public key.
enum PublicKeyCertificateFormat {
// The format has not been specified. This is an invalid default value and
// must not be used.
UNSPECIFIED_PUBLIC_KEY_CERTIFICATE_FORMAT = 0;
// An X.509v3 certificate ([RFC5280](https://www.ietf.org/rfc/rfc5280.txt)),
// encoded in base64, and wrapped by `-----BEGIN CERTIFICATE-----` and
// `-----END CERTIFICATE-----`.
X509_CERTIFICATE_PEM = 1;
}
// The supported formats for the public key.
enum PublicKeyFormat {
// The format has not been specified. This is an invalid default value and
// must not be used.
UNSPECIFIED_PUBLIC_KEY_FORMAT = 0;
// An RSA public key encoded in base64, and wrapped by
// `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----`. This can be
// used to verify `RS256` signatures in JWT tokens ([RFC7518](
// https://www.ietf.org/rfc/rfc7518.txt)).
RSA_PEM = 3;
// As RSA_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
// https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
// `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
RSA_X509_PEM = 1;
// Public key for the ECDSA algorithm using P-256 and SHA-256, encoded in
// base64, and wrapped by `-----BEGIN PUBLIC KEY-----` and `-----END
// PUBLIC KEY-----`. This can be used to verify JWT tokens with the `ES256`
// algorithm ([RFC7518](https://www.ietf.org/rfc/rfc7518.txt)). This curve is
// defined in [OpenSSL](https://www.openssl.org/) as the `prime256v1` curve.
ES256_PEM = 2;
// As ES256_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
// https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
// `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
ES256_X509_PEM = 4;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,950 @@
// Copyright 2017 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.cloud.language.v1beta1;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/language/v1beta1;language";
option java_multiple_files = true;
option java_outer_classname = "LanguageServiceProto";
option java_package = "com.google.cloud.language.v1beta1";
// Provides text analysis operations such as sentiment analysis and entity
// recognition.
service LanguageService {
// Analyzes the sentiment of the provided text.
rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) {
option (google.api.http) = { post: "/v1beta1/documents:analyzeSentiment" body: "*" };
}
// Finds named entities (currently proper names and common nouns) in the text
// along with entity types, salience, mentions for each entity, and
// other properties.
rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) {
option (google.api.http) = { post: "/v1beta1/documents:analyzeEntities" body: "*" };
}
// Analyzes the syntax of the text and provides sentence boundaries and
// tokenization along with part of speech tags, dependency trees, and other
// properties.
rpc AnalyzeSyntax(AnalyzeSyntaxRequest) returns (AnalyzeSyntaxResponse) {
option (google.api.http) = { post: "/v1beta1/documents:analyzeSyntax" body: "*" };
}
// A convenience method that provides all the features that analyzeSentiment,
// analyzeEntities, and analyzeSyntax provide in one call.
rpc AnnotateText(AnnotateTextRequest) returns (AnnotateTextResponse) {
option (google.api.http) = { post: "/v1beta1/documents:annotateText" body: "*" };
}
}
// ################################################################ #
//
// Represents the input to API methods.
message Document {
// The document types enum.
enum Type {
// The content type is not specified.
TYPE_UNSPECIFIED = 0;
// Plain text
PLAIN_TEXT = 1;
// HTML
HTML = 2;
}
// Required. If the type is not set or is `TYPE_UNSPECIFIED`,
// returns an `INVALID_ARGUMENT` error.
Type type = 1;
// The source of the document: a string containing the content or a
// Google Cloud Storage URI.
oneof source {
// The content of the input in string format.
string content = 2;
// The Google Cloud Storage URI where the file content is located.
// This URI must be of the form: gs://bucket_name/object_name. For more
// details, see https://cloud.google.com/storage/docs/reference-uris.
// NOTE: Cloud Storage object versioning is not supported.
string gcs_content_uri = 3;
}
// The language of the document (if not specified, the language is
// automatically detected). Both ISO and BCP-47 language codes are
// accepted.<br>
// [Language Support](https://cloud.google.com/natural-language/docs/languages)
// lists currently supported languages for each API method.
// If the language (either specified by the caller or automatically detected)
// is not supported by the called API method, an `INVALID_ARGUMENT` error
// is returned.
string language = 4;
}
// Represents a sentence in the input document.
message Sentence {
// The sentence text.
TextSpan text = 1;
// For calls to [AnalyzeSentiment][] or if
// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
// true, this field will contain the sentiment for the sentence.
Sentiment sentiment = 2;
}
// Represents a phrase in the text that is a known entity, such as
// a person, an organization, or location. The API associates information, such
// as salience and mentions, with entities.
message Entity {
// The type of the entity.
enum Type {
// Unknown
UNKNOWN = 0;
// Person
PERSON = 1;
// Location
LOCATION = 2;
// Organization
ORGANIZATION = 3;
// Event
EVENT = 4;
// Work of art
WORK_OF_ART = 5;
// Consumer goods
CONSUMER_GOOD = 6;
// Other types
OTHER = 7;
}
// The representative name for the entity.
string name = 1;
// The entity type.
Type type = 2;
// Metadata associated with the entity.
//
// Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
// available. The associated keys are "wikipedia_url" and "mid", respectively.
map<string, string> metadata = 3;
// The salience score associated with the entity in the [0, 1.0] range.
//
// The salience score for an entity provides information about the
// importance or centrality of that entity to the entire document text.
// Scores closer to 0 are less salient, while scores closer to 1.0 are highly
// salient.
float salience = 4;
// The mentions of this entity in the input document. The API currently
// supports proper noun mentions.
repeated EntityMention mentions = 5;
}
// Represents the smallest syntactic building block of the text.
message Token {
// The token text.
TextSpan text = 1;
// Parts of speech tag for this token.
PartOfSpeech part_of_speech = 2;
// Dependency tree parse for this token.
DependencyEdge dependency_edge = 3;
// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
string lemma = 4;
}
// Represents the feeling associated with the entire text or entities in
// the text.
message Sentiment {
// DEPRECATED FIELD - This field is being deprecated in
// favor of score. Please refer to our documentation at
// https://cloud.google.com/natural-language/docs for more information.
float polarity = 1;
// A non-negative number in the [0, +inf) range, which represents
// the absolute magnitude of sentiment regardless of score (positive or
// negative).
float magnitude = 2;
// Sentiment score between -1.0 (negative sentiment) and 1.0
// (positive sentiment).
float score = 3;
}
// Represents part of speech information for a token.
message PartOfSpeech {
// The part of speech tags enum.
enum Tag {
// Unknown
UNKNOWN = 0;
// Adjective
ADJ = 1;
// Adposition (preposition and postposition)
ADP = 2;
// Adverb
ADV = 3;
// Conjunction
CONJ = 4;
// Determiner
DET = 5;
// Noun (common and proper)
NOUN = 6;
// Cardinal number
NUM = 7;
// Pronoun
PRON = 8;
// Particle or other function word
PRT = 9;
// Punctuation
PUNCT = 10;
// Verb (all tenses and modes)
VERB = 11;
// Other: foreign words, typos, abbreviations
X = 12;
// Affix
AFFIX = 13;
}
// The characteristic of a verb that expresses time flow during an event.
enum Aspect {
// Aspect is not applicable in the analyzed language or is not predicted.
ASPECT_UNKNOWN = 0;
// Perfective
PERFECTIVE = 1;
// Imperfective
IMPERFECTIVE = 2;
// Progressive
PROGRESSIVE = 3;
}
// The grammatical function performed by a noun or pronoun in a phrase,
// clause, or sentence. In some languages, other parts of speech, such as
// adjective and determiner, take case inflection in agreement with the noun.
enum Case {
// Case is not applicable in the analyzed language or is not predicted.
CASE_UNKNOWN = 0;
// Accusative
ACCUSATIVE = 1;
// Adverbial
ADVERBIAL = 2;
// Complementive
COMPLEMENTIVE = 3;
// Dative
DATIVE = 4;
// Genitive
GENITIVE = 5;
// Instrumental
INSTRUMENTAL = 6;
// Locative
LOCATIVE = 7;
// Nominative
NOMINATIVE = 8;
// Oblique
OBLIQUE = 9;
// Partitive
PARTITIVE = 10;
// Prepositional
PREPOSITIONAL = 11;
// Reflexive
REFLEXIVE_CASE = 12;
// Relative
RELATIVE_CASE = 13;
// Vocative
VOCATIVE = 14;
}
// Depending on the language, Form can be categorizing different forms of
// verbs, adjectives, adverbs, etc. For example, categorizing inflected
// endings of verbs and adjectives or distinguishing between short and long
// forms of adjectives and participles
enum Form {
// Form is not applicable in the analyzed language or is not predicted.
FORM_UNKNOWN = 0;
// Adnomial
ADNOMIAL = 1;
// Auxiliary
AUXILIARY = 2;
// Complementizer
COMPLEMENTIZER = 3;
// Final ending
FINAL_ENDING = 4;
// Gerund
GERUND = 5;
// Realis
REALIS = 6;
// Irrealis
IRREALIS = 7;
// Short form
SHORT = 8;
// Long form
LONG = 9;
// Order form
ORDER = 10;
// Specific form
SPECIFIC = 11;
}
// Gender classes of nouns reflected in the behaviour of associated words.
enum Gender {
// Gender is not applicable in the analyzed language or is not predicted.
GENDER_UNKNOWN = 0;
// Feminine
FEMININE = 1;
// Masculine
MASCULINE = 2;
// Neuter
NEUTER = 3;
}
// The grammatical feature of verbs, used for showing modality and attitude.
enum Mood {
// Mood is not applicable in the analyzed language or is not predicted.
MOOD_UNKNOWN = 0;
// Conditional
CONDITIONAL_MOOD = 1;
// Imperative
IMPERATIVE = 2;
// Indicative
INDICATIVE = 3;
// Interrogative
INTERROGATIVE = 4;
// Jussive
JUSSIVE = 5;
// Subjunctive
SUBJUNCTIVE = 6;
}
// Count distinctions.
enum Number {
// Number is not applicable in the analyzed language or is not predicted.
NUMBER_UNKNOWN = 0;
// Singular
SINGULAR = 1;
// Plural
PLURAL = 2;
// Dual
DUAL = 3;
}
// The distinction between the speaker, second person, third person, etc.
enum Person {
// Person is not applicable in the analyzed language or is not predicted.
PERSON_UNKNOWN = 0;
// First
FIRST = 1;
// Second
SECOND = 2;
// Third
THIRD = 3;
// Reflexive
REFLEXIVE_PERSON = 4;
}
// This category shows if the token is part of a proper name.
enum Proper {
// Proper is not applicable in the analyzed language or is not predicted.
PROPER_UNKNOWN = 0;
// Proper
PROPER = 1;
// Not proper
NOT_PROPER = 2;
}
// Reciprocal features of a pronoun.
enum Reciprocity {
// Reciprocity is not applicable in the analyzed language or is not
// predicted.
RECIPROCITY_UNKNOWN = 0;
// Reciprocal
RECIPROCAL = 1;
// Non-reciprocal
NON_RECIPROCAL = 2;
}
// Time reference.
enum Tense {
// Tense is not applicable in the analyzed language or is not predicted.
TENSE_UNKNOWN = 0;
// Conditional
CONDITIONAL_TENSE = 1;
// Future
FUTURE = 2;
// Past
PAST = 3;
// Present
PRESENT = 4;
// Imperfect
IMPERFECT = 5;
// Pluperfect
PLUPERFECT = 6;
}
// The relationship between the action that a verb expresses and the
// participants identified by its arguments.
enum Voice {
// Voice is not applicable in the analyzed language or is not predicted.
VOICE_UNKNOWN = 0;
// Active
ACTIVE = 1;
// Causative
CAUSATIVE = 2;
// Passive
PASSIVE = 3;
}
// The part of speech tag.
Tag tag = 1;
// The grammatical aspect.
Aspect aspect = 2;
// The grammatical case.
Case case = 3;
// The grammatical form.
Form form = 4;
// The grammatical gender.
Gender gender = 5;
// The grammatical mood.
Mood mood = 6;
// The grammatical number.
Number number = 7;
// The grammatical person.
Person person = 8;
// The grammatical properness.
Proper proper = 9;
// The grammatical reciprocity.
Reciprocity reciprocity = 10;
// The grammatical tense.
Tense tense = 11;
// The grammatical voice.
Voice voice = 12;
}
// Represents dependency parse tree information for a token.
message DependencyEdge {
// The parse label enum for the token.
enum Label {
// Unknown
UNKNOWN = 0;
// Abbreviation modifier
ABBREV = 1;
// Adjectival complement
ACOMP = 2;
// Adverbial clause modifier
ADVCL = 3;
// Adverbial modifier
ADVMOD = 4;
// Adjectival modifier of an NP
AMOD = 5;
// Appositional modifier of an NP
APPOS = 6;
// Attribute dependent of a copular verb
ATTR = 7;
// Auxiliary (non-main) verb
AUX = 8;
// Passive auxiliary
AUXPASS = 9;
// Coordinating conjunction
CC = 10;
// Clausal complement of a verb or adjective
CCOMP = 11;
// Conjunct
CONJ = 12;
// Clausal subject
CSUBJ = 13;
// Clausal passive subject
CSUBJPASS = 14;
// Dependency (unable to determine)
DEP = 15;
// Determiner
DET = 16;
// Discourse
DISCOURSE = 17;
// Direct object
DOBJ = 18;
// Expletive
EXPL = 19;
// Goes with (part of a word in a text not well edited)
GOESWITH = 20;
// Indirect object
IOBJ = 21;
// Marker (word introducing a subordinate clause)
MARK = 22;
// Multi-word expression
MWE = 23;
// Multi-word verbal expression
MWV = 24;
// Negation modifier
NEG = 25;
// Noun compound modifier
NN = 26;
// Noun phrase used as an adverbial modifier
NPADVMOD = 27;
// Nominal subject
NSUBJ = 28;
// Passive nominal subject
NSUBJPASS = 29;
// Numeric modifier of a noun
NUM = 30;
// Element of compound number
NUMBER = 31;
// Punctuation mark
P = 32;
// Parataxis relation
PARATAXIS = 33;
// Participial modifier
PARTMOD = 34;
// The complement of a preposition is a clause
PCOMP = 35;
// Object of a preposition
POBJ = 36;
// Possession modifier
POSS = 37;
// Postverbal negative particle
POSTNEG = 38;
// Predicate complement
PRECOMP = 39;
// Preconjunt
PRECONJ = 40;
// Predeterminer
PREDET = 41;
// Prefix
PREF = 42;
// Prepositional modifier
PREP = 43;
// The relationship between a verb and verbal morpheme
PRONL = 44;
// Particle
PRT = 45;
// Associative or possessive marker
PS = 46;
// Quantifier phrase modifier
QUANTMOD = 47;
// Relative clause modifier
RCMOD = 48;
// Complementizer in relative clause
RCMODREL = 49;
// Ellipsis without a preceding predicate
RDROP = 50;
// Referent
REF = 51;
// Remnant
REMNANT = 52;
// Reparandum
REPARANDUM = 53;
// Root
ROOT = 54;
// Suffix specifying a unit of number
SNUM = 55;
// Suffix
SUFF = 56;
// Temporal modifier
TMOD = 57;
// Topic marker
TOPIC = 58;
// Clause headed by an infinite form of the verb that modifies a noun
VMOD = 59;
// Vocative
VOCATIVE = 60;
// Open clausal complement
XCOMP = 61;
// Name suffix
SUFFIX = 62;
// Name title
TITLE = 63;
// Adverbial phrase modifier
ADVPHMOD = 64;
// Causative auxiliary
AUXCAUS = 65;
// Helper auxiliary
AUXVV = 66;
// Rentaishi (Prenominal modifier)
DTMOD = 67;
// Foreign words
FOREIGN = 68;
// Keyword
KW = 69;
// List for chains of comparable items
LIST = 70;
// Nominalized clause
NOMC = 71;
// Nominalized clausal subject
NOMCSUBJ = 72;
// Nominalized clausal passive
NOMCSUBJPASS = 73;
// Compound of numeric modifier
NUMC = 74;
// Copula
COP = 75;
// Dislocated relation (for fronted/topicalized elements)
DISLOCATED = 76;
}
// Represents the head of this token in the dependency tree.
// This is the index of the token which has an arc going to this token.
// The index is the position of the token in the array of tokens returned
// by the API method. If this token is a root token, then the
// `head_token_index` is its own index.
int32 head_token_index = 1;
// The parse label for the token.
Label label = 2;
}
// Represents a mention for an entity in the text. Currently, proper noun
// mentions are supported.
message EntityMention {
// The supported types of mentions.
enum Type {
// Unknown
TYPE_UNKNOWN = 0;
// Proper name
PROPER = 1;
// Common noun (or noun compound)
COMMON = 2;
}
// The mention text.
TextSpan text = 1;
// The type of the entity mention.
Type type = 2;
}
// Represents an output piece of text.
message TextSpan {
// The content of the output text.
string content = 1;
// The API calculates the beginning offset of the content in the original
// document according to the [EncodingType][google.cloud.language.v1beta1.EncodingType] specified in the API request.
int32 begin_offset = 2;
}
// The sentiment analysis request message.
message AnalyzeSentimentRequest {
// Input document.
Document document = 1;
// The encoding type used by the API to calculate sentence offsets for the
// sentence sentiment.
EncodingType encoding_type = 2;
}
// The sentiment analysis response message.
message AnalyzeSentimentResponse {
// The overall sentiment of the input document.
Sentiment document_sentiment = 1;
// The language of the text, which will be the same as the language specified
// in the request or, if not specified, the automatically-detected language.
// See [Document.language][google.cloud.language.v1beta1.Document.language] field for more details.
string language = 2;
// The sentiment for all the sentences in the document.
repeated Sentence sentences = 3;
}
// The entity analysis request message.
message AnalyzeEntitiesRequest {
// Input document.
Document document = 1;
// The encoding type used by the API to calculate offsets.
EncodingType encoding_type = 2;
}
// The entity analysis response message.
message AnalyzeEntitiesResponse {
// The recognized entities in the input document.
repeated Entity entities = 1;
// The language of the text, which will be the same as the language specified
// in the request or, if not specified, the automatically-detected language.
// See [Document.language][google.cloud.language.v1beta1.Document.language] field for more details.
string language = 2;
}
// The syntax analysis request message.
message AnalyzeSyntaxRequest {
// Input document.
Document document = 1;
// The encoding type used by the API to calculate offsets.
EncodingType encoding_type = 2;
}
// The syntax analysis response message.
message AnalyzeSyntaxResponse {
// Sentences in the input document.
repeated Sentence sentences = 1;
// Tokens, along with their syntactic information, in the input document.
repeated Token tokens = 2;
// The language of the text, which will be the same as the language specified
// in the request or, if not specified, the automatically-detected language.
// See [Document.language][google.cloud.language.v1beta1.Document.language] field for more details.
string language = 3;
}
// The request message for the text annotation API, which can perform multiple
// analysis types (sentiment, entities, and syntax) in one call.
message AnnotateTextRequest {
// All available features for sentiment, syntax, and semantic analysis.
// Setting each one to true will enable that specific analysis for the input.
message Features {
// Extract syntax information.
bool extract_syntax = 1;
// Extract entities.
bool extract_entities = 2;
// Extract document-level sentiment.
bool extract_document_sentiment = 3;
}
// Input document.
Document document = 1;
// The enabled features.
Features features = 2;
// The encoding type used by the API to calculate offsets.
EncodingType encoding_type = 3;
}
// The text annotations response message.
message AnnotateTextResponse {
// Sentences in the input document. Populated if the user enables
// [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_syntax].
repeated Sentence sentences = 1;
// Tokens, along with their syntactic information, in the input document.
// Populated if the user enables
// [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_syntax].
repeated Token tokens = 2;
// Entities, along with their semantic information, in the input document.
// Populated if the user enables
// [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_entities].
repeated Entity entities = 3;
// The overall sentiment for the document. Populated if the user enables
// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_document_sentiment].
Sentiment document_sentiment = 4;
// The language of the text, which will be the same as the language specified
// in the request or, if not specified, the automatically-detected language.
// See [Document.language][google.cloud.language.v1beta1.Document.language] field for more details.
string language = 5;
}
// Represents the text encoding that the caller uses to process the output.
// Providing an `EncodingType` is recommended because the API provides the
// beginning offsets for various outputs, such as tokens and mentions, and
// languages that natively use different text encodings may access offsets
// differently.
enum EncodingType {
// If `EncodingType` is not specified, encoding-dependent information (such as
// `begin_offset`) will be set at `-1`.
NONE = 0;
// Encoding-dependent information (such as `begin_offset`) is calculated based
// on the UTF-8 encoding of the input. C++ and Go are examples of languages
// that use this encoding natively.
UTF8 = 1;
// Encoding-dependent information (such as `begin_offset`) is calculated based
// on the UTF-16 encoding of the input. Java and Javascript are examples of
// languages that use this encoding natively.
UTF16 = 2;
// Encoding-dependent information (such as `begin_offset`) is calculated based
// on the UTF-32 encoding of the input. Python is an example of a language
// that uses this encoding natively.
UTF32 = 3;
}

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More