fix templates

This commit is contained in:
2025-02-22 22:21:51 -07:00
parent 9fe376d3ea
commit 60d7e07114
99 changed files with 31 additions and 9 deletions

View File

@ -0,0 +1,352 @@
# This file was automatically generated by BuildFileGenerator
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
proto_library(
name = "servicemanagement_proto",
srcs = [
"resources.proto",
"servicemanager.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:config_change_proto",
"//google/api:field_behavior_proto",
"//google/api:metric_proto",
"//google/api:quota_proto",
"//google/api:service_proto",
"//google/longrunning:operations_proto",
"//google/rpc:status_proto",
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
proto_library_with_info(
name = "servicemanagement_proto_with_info",
deps = [
":servicemanagement_proto",
"//google/cloud:common_resources_proto",
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "servicemanagement_java_proto",
deps = [":servicemanagement_proto"],
)
java_grpc_library(
name = "servicemanagement_java_grpc",
srcs = [":servicemanagement_proto"],
deps = [":servicemanagement_java_proto"],
)
java_gapic_library(
name = "servicemanagement_java_gapic",
srcs = [":servicemanagement_proto_with_info"],
gapic_yaml = "servicemanagement_gapic.yaml",
grpc_service_config = "servicemanagement_grpc_service_config.json",
test_deps = [
":servicemanagement_java_grpc",
],
deps = [
":servicemanagement_java_proto",
"//google/api:api_java_proto",
],
)
java_gapic_test(
name = "servicemanagement_java_gapic_test_suite",
test_classes = [
"com.google.cloud.api.servicemanagement.v1.ServiceManagerClientTest",
],
runtime_deps = [":servicemanagement_java_gapic_test"],
)
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-api-servicemanagement-v1-java",
deps = [
":servicemanagement_java_gapic",
":servicemanagement_java_grpc",
":servicemanagement_java_proto",
":servicemanagement_proto",
],
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library(
name = "servicemanagement_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/api/servicemanagement/v1",
protos = [":servicemanagement_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/api:configchange_go_proto",
"//google/api:metric_go_proto",
"//google/api:serviceconfig_go_proto",
"//google/longrunning:longrunning_go_proto",
"//google/rpc:status_go_proto",
],
)
go_gapic_library(
name = "servicemanagement_go_gapic",
srcs = [":servicemanagement_proto_with_info"],
grpc_service_config = "servicemanagement_grpc_service_config.json",
importpath = "cloud.google.com/go/api/servicemanagement/apiv1;servicemanagement",
service_yaml = "servicemanagement_v1.yaml",
deps = [
":servicemanagement_go_proto",
"//google/api:serviceconfig_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go//longrunning:go_default_library",
"@com_google_cloud_go//longrunning/autogen:go_default_library",
"@io_bazel_rules_go//proto/wkt:any_go_proto",
],
)
go_test(
name = "servicemanagement_go_gapic_test",
srcs = [":servicemanagement_go_gapic_srcjar_test"],
embed = [":servicemanagement_go_gapic"],
importpath = "cloud.google.com/go/api/servicemanagement/apiv1",
)
# Open Source Packages
go_gapic_assembly_pkg(
name = "gapi-cloud-api-servicemanagement-v1-go",
deps = [
":servicemanagement_go_gapic",
":servicemanagement_go_gapic_srcjar-test.srcjar",
":servicemanagement_go_proto",
],
)
##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
)
py_gapic_library(
name = "servicemanagement_py_gapic",
srcs = [":servicemanagement_proto"],
grpc_service_config = "servicemanagement_grpc_service_config.json",
opt_args = [
"warehouse-package-name=google-cloud-service-management",
"python-gapic-namespace=google.cloud",
"python-gapic-name=servicemanagement",
]
)
# Open Source Packages
py_gapic_assembly_pkg(
name = "google-cloud-servicemanagement-v1-py",
deps = [
":servicemanagement_py_gapic",
],
)
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "servicemanagement_php_proto",
deps = [":servicemanagement_proto"],
)
php_grpc_library(
name = "servicemanagement_php_grpc",
srcs = [":servicemanagement_proto"],
deps = [":servicemanagement_php_proto"],
)
php_gapic_library(
name = "servicemanagement_php_gapic",
srcs = [":servicemanagement_proto_with_info"],
grpc_service_config = "servicemanagement_grpc_service_config.json",
service_yaml = "servicemanagement_v1.yaml",
deps = [
":servicemanagement_php_grpc",
":servicemanagement_php_proto",
],
)
# Open Source Packages
php_gapic_assembly_pkg(
name = "google-cloud-api-servicemanagement-v1-php",
deps = [
":servicemanagement_php_gapic",
":servicemanagement_php_grpc",
":servicemanagement_php_proto",
],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library(
name = "servicemanagement_nodejs_gapic",
package_name = "@google-cloud/service-management",
src = ":servicemanagement_proto_with_info",
extra_protoc_parameters = ["metadata"],
grpc_service_config = "servicemanagement_grpc_service_config.json",
package = "google.api.servicemanagement.v1",
service_yaml = "servicemanagement_v1.yaml",
deps = [],
)
nodejs_gapic_assembly_pkg(
name = "api-servicemanagement-v1-nodejs",
deps = [
":servicemanagement_nodejs_gapic",
":servicemanagement_proto",
],
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "servicemanagement_ruby_proto",
deps = [":servicemanagement_proto"],
)
ruby_grpc_library(
name = "servicemanagement_ruby_grpc",
srcs = [":servicemanagement_proto"],
deps = [":servicemanagement_ruby_proto"],
)
ruby_cloud_gapic_library(
name = "servicemanagement_ruby_gapic",
srcs = [":servicemanagement_proto_with_info"],
extra_protoc_parameters = [
"ruby-cloud-gem-name=google-cloud-service_management-v1",
"ruby-cloud-env-prefix=SERVICE_MANAGEMENT",
"ruby-cloud-product-url=https://cloud.google.com/service-infrastructure/docs/overview/",
"ruby-cloud-api-id=servicemanagement.googleapis.com",
"ruby-cloud-api-shortname=servicemanagement",
],
ruby_cloud_description = "Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers.",
ruby_cloud_title = "Service Management API V1",
deps = [
":servicemanagement_ruby_grpc",
":servicemanagement_ruby_proto",
],
)
# Open Source Packages
ruby_gapic_assembly_pkg(
name = "google-cloud-api-servicemanagement-v1-ruby",
deps = [
":servicemanagement_ruby_gapic",
":servicemanagement_ruby_grpc",
":servicemanagement_ruby_proto",
],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "servicemanagement_csharp_proto",
deps = [":servicemanagement_proto"],
)
csharp_grpc_library(
name = "servicemanagement_csharp_grpc",
srcs = [":servicemanagement_proto"],
deps = [":servicemanagement_csharp_proto"],
)
csharp_gapic_library(
name = "servicemanagement_csharp_gapic",
srcs = [":servicemanagement_proto_with_info"],
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
grpc_service_config = "servicemanagement_grpc_service_config.json",
deps = [
":servicemanagement_csharp_grpc",
":servicemanagement_csharp_proto",
],
)
# Open Source Packages
csharp_gapic_assembly_pkg(
name = "google-cloud-api-servicemanagement-v1-csharp",
deps = [
":servicemanagement_csharp_gapic",
":servicemanagement_csharp_grpc",
":servicemanagement_csharp_proto",
],
)
##############################################################################
# C++
##############################################################################
# Put your C++ rules here

View File

@ -0,0 +1,304 @@
// Copyright 2019 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.servicemanagement.v1;
import "google/api/annotations.proto";
import "google/api/config_change.proto";
import "google/api/field_behavior.proto";
import "google/api/metric.proto";
import "google/api/quota.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/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";
option ruby_package = "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](https://cloud.google.com/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 percentage 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. Must be no longer than 63 characters
// and 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 [(google.api.field_behavior) = OPTIONAL];
// 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,6 @@
type: com.google.api.codegen.ConfigProto
config_schema_version: 2.0.0
# The settings of generated code in a specific language.
language_settings:
java:
package_name: com.google.cloud.api.servicemanagement.v1

View File

@ -0,0 +1,12 @@
{
"methodConfig": [
{
"name": [
{
"service": "google.api.servicemanagement.v1.ServiceManager"
}
],
"timeout": "10s"
}
]
}

View File

@ -0,0 +1,275 @@
type: google.api.Service
config_version: 2
name: servicemanagement.googleapis.com
title: Service Management API
apis:
- name: google.api.servicemanagement.v1.ServiceManager
types:
- name: google.api.servicemanagement.v1.ConfigRef
- name: google.api.servicemanagement.v1.ConfigSource
- name: google.api.servicemanagement.v1.DisableServiceResponse
- name: google.api.servicemanagement.v1.EnableServiceResponse
- name: google.api.servicemanagement.v1.OperationMetadata
- name: google.api.servicemanagement.v1.Rollout
- name: google.api.servicemanagement.v1.SubmitConfigSourceResponse
- name: google.api.servicemanagement.v1.UndeleteServiceResponse
documentation:
summary: |-
Google Service Management allows service producers to publish their
services on Google Cloud Platform so that they can be discovered and used
by service consumers.
overview: |-
Google Service Management manages a set of *services*. Service Management
allows *service producers* to
publish their services on Google Cloud Platform so that they can be
discovered and used by *service consumers*. It also handles the tasks of
tracking
service lifecycle and programming various backend systems -- such as
[Stackdriver Logging](https://cloud.google.com/stackdriver),
[Stackdriver Monitoring](https://cloud.google.com/stackdriver) -- to
support the managed services.
If you are a service producer, you can use the Google Service Management
API and [Google Cloud SDK (gcloud)](/sdk) to publish and manage your
services.
Each managed service has a service configuration which declares various
aspects of the service such as its API surface, along with parameters to
configure the supporting backend systems, such as logging and monitoring.
If you build your service using
[Google Cloud Endpoints](https://cloud.google.com/endpoints/), the service
configuration will be handled automatically.
If you are a service consumer and want to use a managed service, you can
use the Google Service Management API or [Google Cloud
Console](https://console.cloud.google.com) to activate the service for
your [Google developer
project](https://developers.google.com/console/help/new/), then start
using its APIs and functions.
## Managed services
REST URL:
`https://servicemanagement.googleapis.com/v1/services/{service-name}` <br
/> REST schema is defined
[here](/service-management/reference/rest/v1/services).
A managed service refers to a network service managed by
Service Management. Each managed service has a unique name, such as
`example.googleapis.com`, which must be a valid fully-qualified DNS name,
as per RFC 1035.
A managed service typically provides some REST APIs and/or other
functions to their service consumers, such as mobile apps or cloud
services.
Service producers can use methods, such as
[services.create](/service-management/reference/rest/v1/services/create),
[services.delete](/service-management/reference/rest/v1/services/delete),
[services.undelete](/service-management/reference/rest/v1/services/undelete), to
manipulate their managed services.
## Service producers
A service producer is the Google developer project responsible for
publishing and maintaining a managed service. Each managed service is
owned by exactly one service producer.
## Service consumers
A service consumer is a Google developer project that has enabled and can
invoke APIs on a managed service. A managed service can have many service
consumers.
## Service configuration
REST URL:
`https://servicemanagement.googleapis.com/v1/services/{service-name}/configs/{config_id}`
<br /> REST schema is defined
[here](/service-management/reference/rest/v1/services.configs).
Each managed service is described by a service configuration which covers
a wide range of features, including its name, title, RPC API
definitions,
REST API definitions, documentation, authentication, and more.
To change the configuration of a managed service, the service producer
needs to publish an updated service configuration to Service
Management.
Service Management keeps a history of published
service configurations, making it possible to easily retrace how a
service's configuration evolved over time. Service configurations can be
published
using the [services.configs.create](/service-management/reference/rest/v1/services.configs/create) or
[services.configs.submit](/service-management/reference/rest/v1/services.configs/submit) methods. Alternatively,
`services.configs.submit` allows publishing an
[OpenAPI](https://github.com/OAI/OpenAPI-Specification) specification,
formerly known as the Swagger Specification, which is automatically
converted to a corresponding service configuration.
## Service rollout
REST URL:
`https://servicemanagement.googleapis.com/v1/services/{service-name}/rollouts/{rollout-id}`
<br /> REST schema is defined
[here](/service-management/reference/rest/v1/services.rollouts).
A `Rollout` defines how Google Service Management should deploy service
configurations to backend systems and how the configurations take effect
at runtime. It lets service producers specify multiple service
configuration
versions to be deployed together, and a strategy that indicates how they
should be used.
Updating a managed service's configuration can be dangerous, as a
configuration error can lead to a service outage. To mitigate risks,
Service Management
supports gradual rollout of service configuration changes. This feature
gives service producers time to identity potential issues and rollback
service
configuration changes in case of errors, thus minimizing the customer
impact of bad configurations. For example, you could specify that 5% of
traffic uses configuration 1, while the remaining 95% uses configuration
2.
Service Management keeps a history of rollouts so that service
producers can undo to previous configuration versions. You can rollback a
configuration by initiating a new `Rollout` that clones a previously
submitted
rollout record.
rules:
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
description: |-
Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
description: |-
Sets the access control policy on the specified resource. Replaces
any existing policy.
Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and
PERMISSION_DENIED
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
description: |-
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.
Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization
checking. This operation may "fail open" without warning.
- selector: google.longrunning.Operations.ListOperations
description: Lists service operations that match the specified filter in the request.
backend:
rules:
- selector: 'google.api.servicemanagement.v1.ServiceManager.*'
deadline: 10.0
- selector: google.api.servicemanagement.v1.ServiceManager.CreateServiceConfig
deadline: 20.0
- selector: 'google.iam.v1.IAMPolicy.*'
deadline: 10.0
- selector: 'google.longrunning.Operations.*'
deadline: 10.0
http:
rules:
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
post: '/v1/{resource=services/*}:getIamPolicy'
body: '*'
additional_bindings:
- post: '/v1/{resource=services/*/consumers/*}:getIamPolicy'
body: '*'
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
post: '/v1/{resource=services/*}:setIamPolicy'
body: '*'
additional_bindings:
- post: '/v1/{resource=services/*/consumers/*}:setIamPolicy'
body: '*'
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
post: '/v1/{resource=services/*}:testIamPermissions'
body: '*'
additional_bindings:
- post: '/v1/{resource=services/*/consumers/*}:testIamPermissions'
body: '*'
- selector: google.longrunning.Operations.ListOperations
get: /v1/operations
authentication:
rules:
- selector: 'google.api.servicemanagement.v1.ServiceManager.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/service.management
- selector: google.api.servicemanagement.v1.ServiceManager.GetService
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/service.management,
https://www.googleapis.com/auth/service.management.readonly
- selector: google.api.servicemanagement.v1.ServiceManager.GetServiceConfig
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/service.management,
https://www.googleapis.com/auth/service.management.readonly
- selector: google.api.servicemanagement.v1.ServiceManager.GetServiceRollout
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/service.management,
https://www.googleapis.com/auth/service.management.readonly
- selector: google.api.servicemanagement.v1.ServiceManager.ListServiceConfigs
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/service.management,
https://www.googleapis.com/auth/service.management.readonly
- selector: google.api.servicemanagement.v1.ServiceManager.ListServiceRollouts
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/service.management,
https://www.googleapis.com/auth/service.management.readonly
- selector: google.api.servicemanagement.v1.ServiceManager.ListServices
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/service.management,
https://www.googleapis.com/auth/service.management.readonly
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/service.management,
https://www.googleapis.com/auth/service.management.readonly
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/service.management
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/service.management,
https://www.googleapis.com/auth/service.management.readonly
- selector: 'google.longrunning.Operations.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/service.management

View File

@ -0,0 +1,560 @@
// Copyright 2019 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.servicemanagement.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.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/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";
option ruby_package = "Google::Cloud::ServiceManagement::V1";
// [Google Service Management API](https://cloud.google.com/service-management/overview)
service ServiceManager {
option (google.api.default_host) = "servicemanagement.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/cloud-platform.read-only,"
"https://www.googleapis.com/auth/service.management,"
"https://www.googleapis.com/auth/service.management.readonly";
// 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"
};
option (google.api.method_signature) = "producer_project_id,consumer_id";
}
// 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}"
};
option (google.api.method_signature) = "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"
};
option (google.api.method_signature) = "service";
option (google.longrunning.operation_info) = {
response_type: "google.api.servicemanagement.v1.ManagedService"
metadata_type: "google.api.servicemanagement.v1.OperationMetadata"
};
}
// 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}"
};
option (google.api.method_signature) = "service_name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.api.servicemanagement.v1.OperationMetadata"
};
}
// 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"
};
option (google.api.method_signature) = "service_name";
option (google.longrunning.operation_info) = {
response_type: "google.api.servicemanagement.v1.UndeleteServiceResponse"
metadata_type: "google.api.servicemanagement.v1.OperationMetadata"
};
}
// 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"
};
option (google.api.method_signature) = "service_name";
}
// 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"
}
};
option (google.api.method_signature) = "service_name,config_id,view";
}
// 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"
};
option (google.api.method_signature) = "service_name,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: "*"
};
option (google.api.method_signature) = "service_name,config_source,validate_only";
option (google.longrunning.operation_info) = {
response_type: "google.api.servicemanagement.v1.SubmitConfigSourceResponse"
metadata_type: "google.api.servicemanagement.v1.OperationMetadata"
};
}
// 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"
};
option (google.api.method_signature) = "service_name,filter";
}
// 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}"
};
option (google.api.method_signature) = "service_name,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"
};
option (google.api.method_signature) = "service_name,rollout";
option (google.longrunning.operation_info) = {
response_type: "google.api.servicemanagement.v1.Rollout"
metadata_type: "google.api.servicemanagement.v1.OperationMetadata"
};
}
// 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: "*"
};
option (google.api.method_signature) = "new_config,old_config";
}
// 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 deprecated = true;
option (google.api.http) = {
post: "/v1/services/{service_name}:enable"
body: "*"
};
option (google.api.method_signature) = "service_name,consumer_id";
option (google.longrunning.operation_info) = {
response_type: "google.api.servicemanagement.v1.EnableServiceResponse"
metadata_type: "google.api.servicemanagement.v1.OperationMetadata"
};
}
// 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 deprecated = true;
option (google.api.http) = {
post: "/v1/services/{service_name}:disable"
body: "*"
};
option (google.api.method_signature) = "service_name,consumer_id";
option (google.longrunning.operation_info) = {
response_type: "google.api.servicemanagement.v1.DisableServiceResponse"
metadata_type: "google.api.servicemanagement.v1.OperationMetadata"
};
}
}
// Request message for `ListServices` method.
message ListServicesRequest {
// Include services produced by the specified project.
string producer_project_id = 1;
// The max number of items to include in the response list. Page size is 50
// if not specified. Maximum value is 100.
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 [deprecated = true];
}
// 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 {
// Required. The name of the service. See the `ServiceManager` overview for naming
// requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request message for CreateService method.
message CreateServiceRequest {
// Required. Initial values for the service resource.
ManagedService service = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request message for DeleteService method.
message DeleteServiceRequest {
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request message for UndeleteService method.
message UndeleteServiceRequest {
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
}
// 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;
}
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The id of the service configuration resource.
//
// This field must be specified for the server to return all fields, including
// `SourceInfo`.
string config_id = 2 [(google.api.field_behavior) = REQUIRED];
// Specifies which parts of the Service Config should be returned in the
// response.
ConfigView view = 3;
}
// Request message for ListServiceConfigs method.
message ListServiceConfigsRequest {
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// The token of the page to retrieve.
string page_token = 2;
// The max number of items to include in the response list. Page size is 50
// if not specified. Maximum value is 100.
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 {
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The service configuration resource.
google.api.Service service_config = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for SubmitConfigSource method.
message SubmitConfigSourceRequest {
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The source configuration for the service.
ConfigSource config_source = 2 [(google.api.field_behavior) = REQUIRED];
// 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 [(google.api.field_behavior) = OPTIONAL];
}
// Response message for SubmitConfigSource method.
message SubmitConfigSourceResponse {
// The generated service configuration.
google.api.Service service_config = 1;
}
// Request message for 'CreateServiceRollout'
message CreateServiceRolloutRequest {
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The rollout resource. The `service_name` field is output only.
Rollout rollout = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for 'ListServiceRollouts'
message ListServiceRolloutsRequest {
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// The token of the page to retrieve.
string page_token = 2;
// The max number of items to include in the response list. Page size is 50
// if not specified. Maximum value is 100.
int32 page_size = 3;
// Required. 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 [(google.api.field_behavior) = REQUIRED];
}
// 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 {
// Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
// for naming requirements. For example: `example.googleapis.com`.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The id of the rollout resource.
string rollout_id = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for EnableService method.
message EnableServiceRequest {
// Required. Name of the service to enable. Specifying an unknown service name will
// cause the request to fail.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. 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 [(google.api.field_behavior) = REQUIRED];
}
// Operation payload for EnableService method.
message EnableServiceResponse {
}
// Request message for DisableService method.
message DisableServiceRequest {
// Required. Name of the service to disable. Specifying an unknown service name
// will cause the request to fail.
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. 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 [(google.api.field_behavior) = REQUIRED];
}
// Operation payload for DisableService method.
message DisableServiceResponse {
}
// Request message for GenerateConfigReport method.
message GenerateConfigReportRequest {
// Required. 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 [(google.api.field_behavior) = REQUIRED];
// Optional. 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 [(google.api.field_behavior) = OPTIONAL];
}
// 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;
}