1// Copyright 2022 Google LLC 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 15syntax = "proto3"; 16 17package google.cloud.cloudsetup.logging.v1; 18 19import "google/api/resource.proto"; 20import "google/rpc/status.proto"; 21 22option go_package = "cloud.google.com/go/cloudsetup/logging/apiv1/loggingpb;loggingpb"; 23option java_multiple_files = true; 24option java_outer_classname = "CompleteDeploymentProto"; 25option java_package = "com.google.cloud.cloudsetup.logging.v1"; 26option csharp_namespace = "Google.Cloud.CloudSetup.Logging.V1"; 27option php_namespace = "Google\\Cloud\\CloudSetup\\Logging\\V1"; 28option ruby_package = "Google::Cloud::CloudSetup::Logging::V1"; 29 30// JSON payload for the Cloud Logging event: 31// `organizations/[organizationId]/logs/cloudsetup.googleapis.com%2Fcomplete_deployment`. 32// This event gets emitted upon completion of a config deployment as part of the 33// Cloud Setup Checklist. 34// 35// The deployment can fail even if it returns a 36// `config.googleapis.com/Deployment`. The state of that message will be 37// `FAILED`. Hence, if there is a `value` present, the `state` can still be, 38// `FAILED`. The message for the error or failure will be on the `error` or the 39// `value` if the Operation results in an error or if the `state` of the 40// Deployment is `FAILED`, respectively. 41message CompleteDeploymentEvent { 42 // State of the completed deployment. 43 enum State { 44 // The zero value. It is applied when `state` is unset. Do not use. 45 STATE_UNSPECIFIED = 0; 46 47 // Indicates that a Deployment value was present when the config deployment 48 // finished and the State was anything other than FAILED. 49 SUCCEEDED = 1; 50 51 // Indicates that the Operation result was an error or the Deployment 52 // `state` was FAILED. 53 FAILED = 2; 54 } 55 56 oneof result { 57 // Result of the Deployment recorded upon completion. 58 CompleteDeploymentResult value = 1; 59 60 // Result of the Deployment if the `Operation` results in an error. 61 google.rpc.Status error = 2; 62 } 63 64 // The `state` of this deployment completion event. 65 State state = 3; 66 67 // Flag to indicate if deployment is preview only. 68 bool preview_only = 4; 69} 70 71// This message is used when the CompleteDeploymentEvent has a value. 72message CompleteDeploymentResult { 73 // This is the Deployment that completed. 74 // Format is projects/{project}/locations/{location}/deployments/{name}. 75 string deployment = 1 [(google.api.resource_reference) = { 76 type: "config.googleapis.com/Deployment" 77 }]; 78 79 // This is the Preview that completed. 80 // Format is projects/{project}/locations/{location}/previews/{preview} 81 string preview = 3 [ 82 (google.api.resource_reference) = { type: "config.googleapis.com/Preview" } 83 ]; 84 85 // The message that is returned when a deployment completes. This **can** be 86 // an error message if the `Deployment` `state` is `FAILED`. 87 string message = 2; 88} 89