| // Copyright 2018 The LUCI Authors. |
| // |
| // 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 cipd; |
| |
| option go_package = "go.chromium.org/luci/cipd/api/admin/v1;api"; |
| |
| import "google/protobuf/empty.proto"; |
| import "go.chromium.org/luci/server/dsmapper/dsmapperpb/messages.proto"; |
| |
| |
| // Administrative API used by CIPD service administrators for internal needs. |
| // |
| // ACLed to administrators. Must not be used by end clients. There's no backward |
| // compatibility promises. |
| service Admin { |
| // Launches a mapping job that examines and/or fixes datastore entities. |
| rpc LaunchJob(JobConfig) returns (JobID); |
| // Initiates an abort of a mapping job. |
| rpc AbortJob(JobID) returns (google.protobuf.Empty); |
| // Returns state of a mapping job. |
| rpc GetJobState(JobID) returns (JobState); |
| |
| // Fixes (right inside the handler) tags marked by the given mapper job. |
| rpc FixMarkedTags(JobID) returns (TagFixReport); |
| } |
| |
| |
| // Supported mapping jobs. |
| enum MapperKind { |
| MAPPER_KIND_UNSPECIFIED = 0; |
| // Dump names of all packages to GAE logs, to test mapping jobs framework. |
| ENUMERATE_PACKAGES = 1; |
| // Find tags that don't pass ValidateInstanceTag and marks them. |
| FIND_MALFORMED_TAGS = 2; |
| // Exports all tags into a BigQuery table 'exported_tags'. |
| EXPORT_TAGS_TO_BQ = 3; |
| } |
| |
| |
| // Defines what a mapping job should do. |
| message JobConfig { |
| MapperKind kind = 1; |
| string comment = 2; // arbitrary human readable string |
| bool dry_run = 3; |
| } |
| |
| |
| // Identifies an instance of a mapping job. |
| message JobID { |
| int64 job_id = 1; |
| } |
| |
| |
| // Details about a mapping job. |
| message JobState { |
| // Original job config, exactly as it was submitted to LaunchJob. |
| JobConfig config = 1; |
| // Current state of the job and all its shards. |
| luci.server.dsmapper.JobInfo info = 2; |
| } |
| |
| |
| // Result of running FixMarkedTags. |
| message TagFixReport { |
| message Tag { |
| string pkg = 1; |
| string instance = 2; |
| string broken_tag = 3; |
| string fixed_tag = 4; // or "" if it was deleted |
| } |
| repeated Tag fixed = 1; |
| } |