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: ActiveDirectoryStore AWSStore AWSCertX509Store AzureStore CyberarkConjurStore CyberarkPAMStore CyberarkPAMExperimentalStore DelineaStore GCPStore GCPCertX509Store KeyfactorSSHStore KeyfactorX509Store StrongVaultStore VaultAppRoleStore VaultAppRoleCertSSHStore VaultAppRoleCertX509Store VaultAWSEC2Store VaultAWSEC2CertSSHStore VaultAWSEC2CertX509Store VaultAWSIAMStore VaultAWSIAMCertSSHStore VaultAWSIAMCertX509Store VaultTLSStore VaultTLSCertSSHStore VaultTLSCertX509Store VaultTokenStore VaultTokenCertSSHStore VaultTokenCertX509Store
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
6703 6704 6705 6706 6707 6708 6709 6710 |
# File 'lib/svc.rb', line 6703 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
6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 |
# File 'lib/svc.rb', line 6712 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, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) 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.
6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 |
# File 'lib/svc.rb', line 6806 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, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) 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.
6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 |
# File 'lib/svc.rb', line 6742 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, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) 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.
6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 |
# File 'lib/svc.rb', line 6835 def list( filter, *args, deadline: nil ) req = V1::SecretStoreListRequest.new() req. = V1::ListRequestMetadata.new() if not @parent.page_limit.nil? 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, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) 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.
6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 |
# File 'lib/svc.rb', line 6776 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, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) 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 |