Documentation ¶
Index ¶
- func GetResourceTypeToken(u string) string
- func MakeProvider(host *provider.HostClient, name, version string, ...) (pulumirpc.ResourceProviderServer, error)
- type Provider
- func (p *Provider) Attach(_ context.Context, req *pulumirpc.PluginAttach) (*pbempty.Empty, error)
- func (p *Provider) Call(_ context.Context, _ *pulumirpc.CallRequest) (*pulumirpc.CallResponse, error)
- func (p *Provider) Cancel(context.Context, *pbempty.Empty) (*pbempty.Empty, error)
- func (p *Provider) Check(_ context.Context, req *pulumirpc.CheckRequest) (*pulumirpc.CheckResponse, error)
- func (p *Provider) CheckConfig(_ context.Context, req *pulumirpc.CheckRequest) (*pulumirpc.CheckResponse, error)
- func (p *Provider) Configure(ctx context.Context, req *pulumirpc.ConfigureRequest) (*pulumirpc.ConfigureResponse, error)
- func (p *Provider) Construct(_ context.Context, _ *pulumirpc.ConstructRequest) (*pulumirpc.ConstructResponse, error)
- func (p *Provider) Create(ctx context.Context, req *pulumirpc.CreateRequest) (*pulumirpc.CreateResponse, error)
- func (p *Provider) CreateDeleteRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, ...) (*http.Request, error)
- func (p *Provider) CreateGetRequest(ctx context.Context, httpEndpointPath string, inputs resource.PropertyMap) (*http.Request, error)
- func (p *Provider) CreatePatchRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, ...) (*http.Request, error)
- func (p *Provider) CreatePostRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, ...) (*http.Request, error)
- func (p *Provider) CreatePutRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, ...) (*http.Request, error)
- func (p *Provider) Delete(ctx context.Context, req *pulumirpc.DeleteRequest) (*pbempty.Empty, error)
- func (p *Provider) Diff(ctx context.Context, req *pulumirpc.DiffRequest) (*pulumirpc.DiffResponse, error)
- func (p *Provider) DiffConfig(_ context.Context, _ *pulumirpc.DiffRequest) (*pulumirpc.DiffResponse, error)
- func (p *Provider) GetBaseURL() string
- func (p *Provider) GetHTTPClient() *http.Client
- func (p *Provider) GetMapping(_ context.Context, _ *pulumirpc.GetMappingRequest) (*pulumirpc.GetMappingResponse, error)
- func (p *Provider) GetOpenAPIDoc() openapi3.T
- func (p *Provider) GetPluginInfo(context.Context, *pbempty.Empty) (*pulumirpc.PluginInfo, error)
- func (p *Provider) GetSchema(_ context.Context, _ *pulumirpc.GetSchemaRequest) (*pulumirpc.GetSchemaResponse, error)
- func (p *Provider) GetSchemaSpec() pschema.PackageSpec
- func (p *Provider) Invoke(ctx context.Context, req *pulumirpc.InvokeRequest) (*pulumirpc.InvokeResponse, error)
- func (p *Provider) Read(ctx context.Context, req *pulumirpc.ReadRequest) (*pulumirpc.ReadResponse, error)
- func (p *Provider) StreamInvoke(req *pulumirpc.InvokeRequest, _ pulumirpc.ResourceProvider_StreamInvokeServer) error
- func (p *Provider) TransformBody(ctx context.Context, bodyMap map[string]interface{}, ...)
- func (p *Provider) Update(ctx context.Context, req *pulumirpc.UpdateRequest) (*pulumirpc.UpdateResponse, error)
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResourceTypeToken ¶
GetResourceTypeToken returns the type token from a resource URN string.
func MakeProvider ¶
func MakeProvider(host *provider.HostClient, name, version string, pulumiSchemaBytes, openapiDocBytes, metadataBytes []byte, callback callback.ProviderCallback) (pulumirpc.ResourceProviderServer, error)
MakeProvider returns an instance of the REST-based resource provider handler.
Types ¶
type Provider ¶
type Provider struct { pulumirpc.UnimplementedResourceProviderServer // contains filtered or unexported fields }
Provider implements Pulumi's `ResourceProviderServer` interface. The implemented methods assume that the cloud provider supports RESTful APIs that accept a content-type of `application/json`.
func (*Provider) Call ¶
func (p *Provider) Call(_ context.Context, _ *pulumirpc.CallRequest) (*pulumirpc.CallResponse, error)
Call dynamically executes a method in the provider associated with a component resource.
func (*Provider) Cancel ¶
Cancel signals the provider to gracefully shut down and abort any ongoing resource operations. Operations aborted in this way will return an error (e.g., `Update` and `Create` will either return a creation error or an initialization error). Since Cancel is advisory and non-blocking, it is up to the host to decide how long to wait after Cancel is called before (e.g.) hard-closing any gRPC connection.
func (*Provider) Check ¶
func (p *Provider) Check(_ context.Context, req *pulumirpc.CheckRequest) (*pulumirpc.CheckResponse, error)
Check validates that the given property bag is valid for a resource of the given type and returns the inputs that should be passed to successive calls to Diff, Create, or Update for this resource. As a rule, the provider inputs returned by a call to Check should preserve the original representation of the properties as present in the program inputs. Though this rule is not required for correctness, violations thereof can negatively impact the end-user experience, as the provider inputs are used for detecting and rendering diffs.
func (*Provider) CheckConfig ¶
func (p *Provider) CheckConfig(_ context.Context, req *pulumirpc.CheckRequest) (*pulumirpc.CheckResponse, error)
CheckConfig validates the configuration for this provider.
func (*Provider) Configure ¶
func (p *Provider) Configure(ctx context.Context, req *pulumirpc.ConfigureRequest) (*pulumirpc.ConfigureResponse, error)
Configure configures the resource provider with "globals" that control its behavior.
func (*Provider) Construct ¶
func (p *Provider) Construct(_ context.Context, _ *pulumirpc.ConstructRequest) (*pulumirpc.ConstructResponse, error)
Construct creates a new component resource.
func (*Provider) Create ¶
func (p *Provider) Create(ctx context.Context, req *pulumirpc.CreateRequest) (*pulumirpc.CreateResponse, error)
Create allocates a new instance of the provided resource and returns its unique ID afterwards.
func (*Provider) CreateDeleteRequest ¶
func (p *Provider) CreateDeleteRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, inputs resource.PropertyMap) (*http.Request, error)
CreateDeleteRequest returns a validated DELETE HTTP request for the provided inputs map.
func (*Provider) CreateGetRequest ¶
func (p *Provider) CreateGetRequest( ctx context.Context, httpEndpointPath string, inputs resource.PropertyMap) (*http.Request, error)
CreateGetRequest returns a validated GET HTTP request for the provided inputs map.
func (*Provider) CreatePatchRequest ¶
func (p *Provider) CreatePatchRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, inputs resource.PropertyMap) (*http.Request, error)
CreatePatchRequest returns a validated PATCH HTTP request for the provided inputs map.
func (*Provider) CreatePostRequest ¶
func (p *Provider) CreatePostRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, inputs resource.PropertyMap) (*http.Request, error)
CreatePostRequest returns a validated POST HTTP request for the provided inputs map.
func (*Provider) CreatePutRequest ¶
func (p *Provider) CreatePutRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, inputs resource.PropertyMap) (*http.Request, error)
CreatePutRequest returns a validated PUT HTTP request for the provided inputs map.
func (*Provider) Delete ¶
func (p *Provider) Delete(ctx context.Context, req *pulumirpc.DeleteRequest) (*pbempty.Empty, error)
Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
func (*Provider) Diff ¶
func (p *Provider) Diff(ctx context.Context, req *pulumirpc.DiffRequest) (*pulumirpc.DiffResponse, error)
Diff checks what impacts a hypothetical update will have on the resource's properties.
func (*Provider) DiffConfig ¶
func (p *Provider) DiffConfig(_ context.Context, _ *pulumirpc.DiffRequest) (*pulumirpc.DiffResponse, error)
DiffConfig diffs the configuration for this provider.
func (*Provider) GetBaseURL ¶
func (*Provider) GetHTTPClient ¶
func (*Provider) GetMapping ¶
func (p *Provider) GetMapping(_ context.Context, _ *pulumirpc.GetMappingRequest) (*pulumirpc.GetMappingResponse, error)
func (*Provider) GetOpenAPIDoc ¶
func (*Provider) GetPluginInfo ¶
GetPluginInfo returns generic information about this plugin, like its version.
func (*Provider) GetSchema ¶
func (p *Provider) GetSchema(_ context.Context, _ *pulumirpc.GetSchemaRequest) (*pulumirpc.GetSchemaResponse, error)
GetSchema returns the JSON-serialized schema for the provider.
func (*Provider) GetSchemaSpec ¶
func (p *Provider) GetSchemaSpec() pschema.PackageSpec
func (*Provider) Invoke ¶
func (p *Provider) Invoke(ctx context.Context, req *pulumirpc.InvokeRequest) (*pulumirpc.InvokeResponse, error)
Invoke dynamically executes a built-in function in the provider.
func (*Provider) Read ¶
func (p *Provider) Read(ctx context.Context, req *pulumirpc.ReadRequest) (*pulumirpc.ReadResponse, error)
Read the current live state associated with a resource.
func (*Provider) StreamInvoke ¶
func (p *Provider) StreamInvoke(req *pulumirpc.InvokeRequest, _ pulumirpc.ResourceProvider_StreamInvokeServer) error
StreamInvoke dynamically executes a built-in function in the provider. The result is streamed back as a series of messages.
func (*Provider) TransformBody ¶
func (*Provider) Update ¶
func (p *Provider) Update(ctx context.Context, req *pulumirpc.UpdateRequest) (*pulumirpc.UpdateResponse, error)
Update updates an existing resource with new values.
type Request ¶
type Request interface { CreateDeleteRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, inputs resource.PropertyMap) (*http.Request, error) CreateGetRequest(ctx context.Context, httpEndpointPath string, inputs resource.PropertyMap) (*http.Request, error) CreatePatchRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, inputs resource.PropertyMap) (*http.Request, error) CreatePostRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, inputs resource.PropertyMap) (*http.Request, error) CreatePutRequest(ctx context.Context, httpEndpointPath string, reqBody []byte, inputs resource.PropertyMap) (*http.Request, error) }
Request interface is implemented by REST-based providers that perform CRUD operations using RESTful APIs.