go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cipd/api/admin/v1/admin.proto (about) 1 // Copyright 2018 The LUCI Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 syntax = "proto3"; 16 17 package cipd; 18 19 option go_package = "go.chromium.org/luci/cipd/api/admin/v1;api"; 20 21 import "google/protobuf/empty.proto"; 22 import "go.chromium.org/luci/server/dsmapper/dsmapperpb/messages.proto"; 23 24 25 // Administrative API used by CIPD service administrators for internal needs. 26 // 27 // ACLed to administrators. Must not be used by end clients. There's no backward 28 // compatibility promises. 29 service Admin { 30 // Launches a mapping job that examines and/or fixes datastore entities. 31 rpc LaunchJob(JobConfig) returns (JobID); 32 // Initiates an abort of a mapping job. 33 rpc AbortJob(JobID) returns (google.protobuf.Empty); 34 // Returns state of a mapping job. 35 rpc GetJobState(JobID) returns (JobState); 36 37 // Fixes (right inside the handler) tags marked by the given mapper job. 38 rpc FixMarkedTags(JobID) returns (TagFixReport); 39 } 40 41 42 // Supported mapping jobs. 43 enum MapperKind { 44 MAPPER_KIND_UNSPECIFIED = 0; 45 // Dump names of all packages to GAE logs, to test mapping jobs framework. 46 ENUMERATE_PACKAGES = 1; 47 // Find tags that don't pass ValidateInstanceTag and marks them. 48 FIND_MALFORMED_TAGS = 2; 49 // Exports all tags into a BigQuery table 'exported_tags'. 50 EXPORT_TAGS_TO_BQ = 3; 51 } 52 53 54 // Defines what a mapping job should do. 55 message JobConfig { 56 MapperKind kind = 1; 57 string comment = 2; // arbitrary human readable string 58 bool dry_run = 3; 59 } 60 61 62 // Identifies an instance of a mapping job. 63 message JobID { 64 int64 job_id = 1; 65 } 66 67 68 // Details about a mapping job. 69 message JobState { 70 // Original job config, exactly as it was submitted to LaunchJob. 71 JobConfig config = 1; 72 // Current state of the job and all its shards. 73 luci.server.dsmapper.JobInfo info = 2; 74 } 75 76 77 // Result of running FixMarkedTags. 78 message TagFixReport { 79 message Tag { 80 string pkg = 1; 81 string instance = 2; 82 string broken_tag = 3; 83 string fixed_tag = 4; // or "" if it was deleted 84 } 85 repeated Tag fixed = 1; 86 }