pulumi/sdk/proto/analyzer.proto

43 lines
1.6 KiB
Protocol Buffer
Raw Normal View History

2017-06-23 23:53:41 +02:00
// Copyright 2016-2017, Pulumi Corporation
//
// 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";
import "google/protobuf/struct.proto";
package lumirpc;
// Analyzer is a pluggable service that checks entire projects/stacks/snapshots, and/or individual resources,
// for arbitrary issues. These might be style, policy, correctness, security, or performance related.
service Analyzer {
// Analyze analyzes a single resource object, and returns any errors that it finds.
rpc Analyze(AnalyzeRequest) returns (AnalyzeResponse) {}
}
message AnalyzeRequest {
string type = 1; // the type token of the resource.
google.protobuf.Struct properties = 2; // the full properties to use for validation.
Initial support for output properties (1 of 3) This change includes approximately 1/3rd of the change necessary to support output properties, as per pulumi/lumi#90. In short, the runtime now has a new hidden type, Latent<T>, which represents a "speculative" value, whose eventual type will be T, that we can use during evaluation in various ways. Namely, operations against Latent<T>s generally produce new Latent<U>s. During planning, any Latent<T>s that end up in resource properties are transformed into "unknown" property values. An unknown property value is legal only during planning-time activities, such as Check, Name, and InspectChange. As a result, those RPC interfaces have been updated to include lookaside maps indicating which properties have unknown values. My intent is to add some helper functions to make dealing with this circumstance more correct-by-construction. For now, using an unresolved Latent<T> in a conditional will lead to an error. See pulumi/lumi#67. Speculating beyond these -- by supporting iterative planning and application -- is something we want to support eventually, but it makes sense to do that as an additive change beyond this initial support. That is a missing 1/3. Finally, the other missing 1/3rd which will happen much sooner than the rest is restructuing plan application so that it will correctly observe resolution of Latent<T> values. Right now, the evaluation happens in one single pass, prior to the application, and so Latent<T>s never actually get witnessed in a resolved state.
2017-05-24 02:32:59 +02:00
map<string, bool> unknowns = 3; // the optional set of properties whose values are unknown.
}
message AnalyzeResponse {
repeated AnalyzeFailure failures = 1; // the failures (or empty if none).
}
message AnalyzeFailure {
string property = 1; // the property that the analyzer rejected (or "" if general).
string reason = 2; // the reason that the analyzer rejected the request.
}