Class: SDM::SecretStores
- Inherits:
-
Object
- Object
- SDM::SecretStores
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
SecretStores are servers where resource secrets (passwords, keys) are stored.
See: AWSStore AzureStore CyberarkConjurStore CyberarkPAMStore CyberarkPAMExperimentalStore DelineaStore GCPStore VaultAppRoleStore VaultTLSStore VaultTokenStore
Instance Method Summary collapse
- #create(secret_store, deadline: nil) ⇒ Object
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a SecretStore by ID.
-
#get(id, deadline: nil) ⇒ Object
Get reads one SecretStore by ID.
-
#initialize(channel, parent) ⇒ SecretStores
constructor
A new instance of SecretStores.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of SecretStores matching a given set of criteria.
-
#update(secret_store, deadline: nil) ⇒ Object
Update replaces all the fields of a SecretStore by ID.
Constructor Details
#initialize(channel, parent) ⇒ SecretStores
Returns a new instance of SecretStores.
3761 3762 3763 3764 3765 3766 3767 3768 |
# File 'lib/svc.rb', line 3761 def initialize(channel, parent) begin @stub = V1::SecretStores::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(secret_store, deadline: nil) ⇒ Object
3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 |
# File 'lib/svc.rb', line 3770 def create( secret_store, deadline: nil ) req = V1::SecretStoreCreateRequest.new() req.secret_store = Plumbing::convert_secret_store_to_plumbing(secret_store) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("SecretStores.Create", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = SecretStoreCreateResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a SecretStore by ID.
3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 |
# File 'lib/svc.rb', line 3864 def delete( id, deadline: nil ) req = V1::SecretStoreDeleteRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("SecretStores.Delete", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = SecretStoreDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one SecretStore by ID.
3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 |
# File 'lib/svc.rb', line 3800 def get( id, deadline: nil ) req = V1::SecretStoreGetRequest.new() if not @parent.snapshot_time.nil? req. = V1::GetRequestMetadata.new() req..snapshot_at = @parent.snapshot_time end req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("SecretStores.Get", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = SecretStoreGetResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of SecretStores matching a given set of criteria.
3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 |
# File 'lib/svc.rb', line 3893 def list( filter, *args, deadline: nil ) req = V1::SecretStoreListRequest.new() req. = V1::ListRequestMetadata.new() if @parent.page_limit > 0 req..limit = @parent.page_limit end if not @parent.snapshot_time.nil? req..snapshot_at = @parent.snapshot_time end req.filter = Plumbing::quote_filter_args(filter, *args) resp = Enumerator::Generator.new { |g| tries = 0 loop do begin plumbing_response = @stub.list(req, metadata: @parent.("SecretStores.List", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end tries = 0 plumbing_response.secret_stores.each do |plumbing_item| g.yield Plumbing::convert_secret_store_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |
#update(secret_store, deadline: nil) ⇒ Object
Update replaces all the fields of a SecretStore by ID.
3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 |
# File 'lib/svc.rb', line 3834 def update( secret_store, deadline: nil ) req = V1::SecretStoreUpdateRequest.new() req.secret_store = Plumbing::convert_secret_store_to_plumbing(secret_store) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.update(req, metadata: @parent.("SecretStores.Update", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = SecretStoreUpdateResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store) resp end |