Am Montag, den 25.02.2019, 06:26 -0800 schrieb jcbollinger:

On Monday, February 25, 2019 at 2:30:02 AM UTC-6, Dirk Heinrichs wrote:
Am Montag, den 25.02.2019, 09:10 +0100 schrieb Martin Alfke:

Within the provider you specify getters (how to read existing data) and setters 
(how to set new data).
Maybe you want to have a look at my PuppetConf talk "Moving from exec to types 
and providers". You can find it at Puppet youtube channel.
There I describe getters and setters.

Thanks a lot. I think I've already understood that part. The problem I have is 
how to implement points 1 and 3 (getting the current configuration and writing 
back the changes). What are the entry points for these? If a type is ensurable 
I have "exists?", "create" and "destroy", but what do I use if it's not?



If the complete set of instances is well known, or if the API provides a way to 
enumerate instances, then your provider should be able to implement 
prefetching<https://urldefense.proofpoint.com/v2/url?u=https-3A__puppet.com_docs_puppet_5.5_provider-5Fdevelopment.html-23prefetching&d=DwMFaQ&c=ZgVRmm3mf2P1-XDAyDsu4A&r=TsKycyisPP_6FVCeETRooIdY_8hdAsXoxwbvHso_TaI&m=Mj0KuSV6rs0rmcjhZ9DTLqlsEWxHgaKlwq3pKrG0e8w&s=OW04raZp0nZRsznsvWyppix9UTfuxox39_9BA76ubOk&e=>.
  It can in any case implement 
flushing<https://urldefense.proofpoint.com/v2/url?u=https-3A__puppet.com_docs_puppet_5.5_provider-5Fdevelopment.html-23flushing&d=DwMFaQ&c=ZgVRmm3mf2P1-XDAyDsu4A&r=TsKycyisPP_6FVCeETRooIdY_8hdAsXoxwbvHso_TaI&m=Mj0KuSV6rs0rmcjhZ9DTLqlsEWxHgaKlwq3pKrG0e8w&s=aX0et_M5KufooX-9lsXyJhiV09qqou0dy4GfeiC4chg&e=>.
  These can serve as the entry points you're looking for.  If you can't or 
don't want to use one or both of these, then the alternative entry points are 
the property getter and setter methods, respectively.

It sounds like your API deals with state in whole-object units.  That's a 
classic case for implementing flushing.  It plays well with prefetching, too, 
but if you cannot enumerate instances or otherwise don't want to prefetch, then 
your provider can still implement its own, custom support for as-needed state 
fetching, and it can make all the property getters hook that.  For example, you 
could have methods is_fetched?() and fetch(),  and begin each property (not 
parameter) getter with

  fetch unless is_fetched?

Do understand that these method names are not special.  Puppet offers no 
built-in hooks for these particular operations.

You can implement something analogous on the setter side, but unless you have a 
way to modify properties individually, I don't see a reason to prefer that over 
flushing.


Thanks a lot. I followed Martin's talk he mentioned in his first reply and 
through that I got to Tim Cinel's slides. I could use his Bamboo types and 
providers as a starting point.

Bye...

Dirk
--
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Email: dhein...@opentext.com<mailto:dhein...@opentext.com>
Website: www.recommind.de
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon Davies, 
Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
gestattet.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/dff142e1e7cf1f0351d5e4ce8df4ca25b9ce8d9d.camel%40opentext.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to