You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thx for creating this package for Pulumi. Since dynamic providers for .NET is not ready yet and I would like to implement a "simple" API based infra provider, I thought why not make use of Purrl instead of creating a full package. While doing so, I bumped against some limitations and questions which made me give second thoughts on my approach. I'm facing the following challenges:
I have this endpoint for managing DNS records. There is a PUT endpoint for creating a new record and a POST endpoint for updating an existing record. However, in the current implementation of Purrl I cannot change the method used for updates, can I? (see non working example below).
Second to this, the endpoint requires the ID of the DNS record when updating and removing the record. How can a property of an existing instance work for subsequent requests? In the example below, Id will be null in the constructor, so I would not be able to make use of it before instantiating the resource itself.
publicclassRecord:BunnyCdnComponentResource{[Output]publicOutput<string> Id {get;set;}publicRecord(stringname,stringzoneId,DnsRecordArgsargs,ComponentResourceOptions?options=null):base("", name, options){// Cannot make use of Id as it has not been defined yetvarrecordEndpoint= Id.Apply(recordId =>$"https://api.bunny.net/dnszone/{zoneId}/records/{recordId}");varrequest=new Purrl(name,new PurrlArgs
{Name=name,Url=$"https://api.bunny.net/dnszone/{zoneId}/records",ResponseCodes=newList<string>{"200"},Method="PUT",Headers=newDictionary<string,string>{{"accept","application/json"},{"content-type","application/json"}},Body= args.ToJson(),UpdateMethod="POST",// Currently does not exist <--------!!!!UpdateUrl=recordEndpoint,// Currently does not exist <--------!!!!DeleteMethod="DELETE",DeleteUrl=recordEndpoint,DeleteResponseCodes=newList<string>{"200"},});Id= request.Response;}}
The text was updated successfully, but these errors were encountered:
Hi! Thx for creating this package for Pulumi. Since dynamic providers for .NET is not ready yet and I would like to implement a "simple" API based infra provider, I thought why not make use of Purrl instead of creating a full package. While doing so, I bumped against some limitations and questions which made me give second thoughts on my approach. I'm facing the following challenges:
I have this endpoint for managing DNS records. There is a PUT endpoint for creating a new record and a POST endpoint for updating an existing record. However, in the current implementation of Purrl I cannot change the method used for updates, can I? (see non working example below).
Second to this, the endpoint requires the ID of the DNS record when updating and removing the record. How can a property of an existing instance work for subsequent requests? In the example below, Id will be null in the constructor, so I would not be able to make use of it before instantiating the resource itself.
The text was updated successfully, but these errors were encountered: