-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
resource.proto
161 lines (142 loc) 路 11.2 KB
/
resource.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// Copyright 2016-2022, 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/empty.proto";
import "google/protobuf/struct.proto";
import "pulumi/provider.proto";
import "pulumi/alias.proto";
package pulumirpc;
option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go;pulumirpc";
// ResourceMonitor is the interface a source uses to talk back to the planning monitor orchestrating the execution.
service ResourceMonitor {
rpc SupportsFeature(SupportsFeatureRequest) returns (SupportsFeatureResponse) {}
rpc Invoke(ResourceInvokeRequest) returns (InvokeResponse) {}
rpc StreamInvoke(ResourceInvokeRequest) returns (stream InvokeResponse) {}
rpc Call(CallRequest) returns (CallResponse) {}
rpc ReadResource(ReadResourceRequest) returns (ReadResourceResponse) {}
rpc RegisterResource(RegisterResourceRequest) returns (RegisterResourceResponse) {}
rpc RegisterResourceOutputs(RegisterResourceOutputsRequest) returns (google.protobuf.Empty) {}
}
// SupportsFeatureRequest allows a client to test if the resource monitor supports a certain feature, which it may use
// to control the format or types of messages it sends.
message SupportsFeatureRequest {
string id = 1; // the ID of the feature to test support for.
}
message SupportsFeatureResponse {
bool hasSupport = 1; // true when the resource monitor supports this feature.
}
// There is a clear distinction here between the "properties" bag sent across the wire as part of these RPCs and
// properties that exist on Pulumi resources as projected into the target language. It is important to call out that the
// properties here are in the format that a provider will expect. This is to say that they are usually in camel case.
// If a language wants to project properties in a format *other* than camel-case, it is the job of the language to
// ensure that the properties are translated into camel case before invoking an RPC.
// ReadResourceRequest contains enough information to uniquely qualify and read a resource's state.
message ReadResourceRequest {
string id = 1; // the ID of the resource to read.
string type = 2; // the type of the resource object.
string name = 3; // the name, for URN purposes, of the object.
string parent = 4; // an optional parent URN that this child resource belongs to.
google.protobuf.Struct properties = 5; // optional state sufficient to uniquely identify the resource.
repeated string dependencies = 6; // a list of URNs that this read depends on, as observed by the language host.
string provider = 7; // an optional reference to the provider to use for this read.
string version = 8; // the version of the provider to use when servicing this request.
bool acceptSecrets = 9; // when true operations should return secrets as strongly typed.
repeated string additionalSecretOutputs = 10; // a list of output properties that should also be treated as secret, in addition to ones we detect.
// We used to declare an alias field here, but nothing ever used it. But to ensure we don't confuse any
// old plugins/monitors making sure that field doesn't get reused.
reserved "aliases";
reserved 11;
bool acceptResources = 12; // when true operations should return resource references as strongly typed.
string pluginDownloadURL = 13; // the server url of the provider to use when servicing this request.
}
// ReadResourceResponse contains the result of reading a resource's state.
message ReadResourceResponse {
string urn = 1; // the URN for this resource.
google.protobuf.Struct properties = 2; // the state of the resource read from the live environment.
}
// RegisterResourceRequest contains information about a resource object that was newly allocated.
message RegisterResourceRequest {
// PropertyDependencies describes the resources that a particular property depends on.
message PropertyDependencies {
repeated string urns = 1; // A list of URNs this property depends on.
}
// CustomTimeouts allows a user to be able to create a set of custom timeout parameters.
message CustomTimeouts {
string create = 1; // The create resource timeout represented as a string e.g. 5m.
string update = 2; // The update resource timeout represented as a string e.g. 5m.
string delete = 3; // The delete resource timeout represented as a string e.g. 5m.
}
string type = 1; // the type of the object allocated.
string name = 2; // the name, for URN purposes, of the object.
string parent = 3; // an optional parent URN that this child resource belongs to.
bool custom = 4; // true if the resource is a custom, managed by a plugin's CRUD operations.
google.protobuf.Struct object = 5; // an object produced by the interpreter/source.
bool protect = 6; // true if the resource should be marked protected.
repeated string dependencies = 7; // a list of URNs that this resource depends on, as observed by the language host.
string provider = 8; // an optional reference to the provider to manage this resource's CRUD operations.
map<string, PropertyDependencies> propertyDependencies = 9; // a map from property keys to the dependencies of the property.
bool deleteBeforeReplace = 10; // true if this resource should be deleted before replacement.
string version = 11; // the version of the provider to use when servicing this request.
repeated string ignoreChanges = 12; // a list of property selectors to ignore during updates.
bool acceptSecrets = 13; // when true operations should return secrets as strongly typed.
repeated string additionalSecretOutputs = 14; // a list of output properties that should also be treated as secret, in addition to ones we detect.
repeated string aliasURNs = 15; // a list of additional URNs that should be considered the same.
string importId = 16; // if set, this resource's state should be imported from the given ID.
CustomTimeouts customTimeouts = 17; // ability to pass a custom Timeout block.
bool deleteBeforeReplaceDefined = 18; // true if the deleteBeforeReplace property should be treated as defined even if it is false.
bool supportsPartialValues = 19; // true if the request is from an SDK that supports partially-known properties during preview.
bool remote = 20; // true if the resource is a plugin-managed component resource.
bool acceptResources = 21; // when true operations should return resource references as strongly typed.
map<string, string> providers = 22; // an optional reference to the provider map to manage this resource's CRUD operations.
repeated string replaceOnChanges = 23; // a list of properties that if changed should force a replacement.
string pluginDownloadURL = 24; // the server URL of the provider to use when servicing this request.
bool retainOnDelete = 25; // if true the engine will not call the resource providers delete method for this resource.
repeated Alias aliases = 26; // a list of additional aliases that should be considered the same.
string deletedWith = 27; // if set the engine will not call the resource providers delete method for this resource when specified resource is deleted.
// Indicates that alias specs are specified correctly according to the spec.
// Older versions of the Node.js SDK did not send alias specs correctly.
// If this is not set to true and the engine detects the request is from the
// Node.js runtime, the engine will transform incorrect alias specs into
// correct ones.
// Other SDKs that are correctly specifying alias specs could set this to
// true, but it's not necessary.
bool aliasSpecs = 28;
}
// RegisterResourceResponse is returned by the engine after a resource has finished being initialized. It includes the
// auto-assigned URN, the provider-assigned ID, and any other properties initialized by the engine.
message RegisterResourceResponse {
// PropertyDependencies describes the resources that a particular property depends on.
message PropertyDependencies {
repeated string urns = 1; // A list of URNs this property depends on.
}
string urn = 1; // the URN assigned by the engine.
string id = 2; // the unique ID assigned by the provider.
google.protobuf.Struct object = 3; // the resulting object properties, including provider defaults.
bool stable = 4; // if true, the object's state is stable and may be trusted not to change.
repeated string stables = 5; // an optional list of guaranteed-stable properties.
map<string, PropertyDependencies> propertyDependencies = 6; // a map from property keys to the dependencies of the property.
}
// RegisterResourceOutputsRequest adds extra resource outputs created by the program after registration has occurred.
message RegisterResourceOutputsRequest {
string urn = 1; // the URN for the resource to attach output properties to.
google.protobuf.Struct outputs = 2; // additional output properties to add to the existing resource.
}
message ResourceInvokeRequest {
string tok = 1; // the function token to invoke.
google.protobuf.Struct args = 2; // the arguments for the function invocation.
string provider = 3; // an optional reference to the provider version to use for this invoke.
string version = 4; // the version of the provider to use when servicing this request.
bool acceptResources = 5; // when true operations should return resource references as strongly typed.
string pluginDownloadURL = 6; // an optional reference to the provider url to use for this invoke.
}