Class: SDM::Resources
Overview
Resources are databases, servers, clusters, websites, or clouds that strongDM delegates access to.
See: AKS AKSBasicAuth AKSServiceAccount AKSServiceAccountUserImpersonation AKSUserImpersonation AmazonEKS AmazonEKSInstanceProfile AmazonEKSInstanceProfileUserImpersonation AmazonEKSUserImpersonation AmazonES AmazonMQAMQP091 Athena AuroraMysql AuroraPostgres AuroraPostgresIAM AWS AWSConsole AWSConsoleStaticKeyPair AWSInstanceProfile Azure AzureCertificate AzureMysql AzurePostgres AzurePostgresManagedIdentity BigQuery Cassandra Citus Clustrix Cockroach CouchbaseDatabase CouchbaseWebUI DB2I DB2LUW DocumentDBHost DocumentDBReplicaSet Druid DynamoDB Elastic ElasticacheRedis GCP GCPConsole GCPWIF GoogleGKE GoogleGKEUserImpersonation Greenplum HTTPAuth HTTPBasicAuth HTTPNoAuth Kubernetes KubernetesBasicAuth KubernetesServiceAccount KubernetesServiceAccountUserImpersonation KubernetesUserImpersonation Maria Memcached Memsql MongoHost MongoLegacyHost MongoLegacyReplicaset MongoReplicaSet MongoShardedCluster MTLSMysql MTLSPostgres Mysql Neptune NeptuneIAM Oracle Postgres Presto RabbitMQAMQP091 RawTCP RDP RDPCert RDSPostgresIAM Redis Redshift SingleStore Snowflake Snowsight SQLServer SQLServerAzureAD SQLServerKerberosAD SSH SSHCert SSHCustomerKey SSHPassword Sybase SybaseIQ Teradata Trino
Instance Method Summary collapse
-
#create(resource, deadline: nil) ⇒ Object
Create registers a new Resource.
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a Resource by ID.
-
#enumerate_tags(filter, *args, deadline: nil) ⇒ Object
EnumerateTags gets a list of the filter matching tags.
-
#get(id, deadline: nil) ⇒ Object
Get reads one Resource by ID.
-
#healthcheck(id, deadline: nil) ⇒ Object
Healthcheck triggers a remote healthcheck.
-
#initialize(channel, parent) ⇒ Resources
constructor
A new instance of Resources.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of Resources matching a given set of criteria.
-
#update(resource, deadline: nil) ⇒ Object
Update replaces all the fields of a Resource by ID.
Constructor Details
#initialize(channel, parent) ⇒ Resources
Returns a new instance of Resources.
4728 4729 4730 4731 4732 4733 4734 4735 |
# File 'lib/svc.rb', line 4728 def initialize(channel, parent) begin @stub = V1::Resources::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(resource, deadline: nil) ⇒ Object
Create registers a new Resource.
4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 |
# File 'lib/svc.rb', line 4777 def create( resource, deadline: nil ) req = V1::ResourceCreateRequest.new() req.resource = Plumbing::convert_resource_to_plumbing(resource) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("Resources.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 = ResourceCreateResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a Resource by ID.
4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 |
# File 'lib/svc.rb', line 4871 def delete( id, deadline: nil ) req = V1::ResourceDeleteRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("Resources.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 = ResourceDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#enumerate_tags(filter, *args, deadline: nil) ⇒ Object
EnumerateTags gets a list of the filter matching tags.
4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 |
# File 'lib/svc.rb', line 4738 def ( filter, *args, deadline: nil ) req = V1::EnumerateTagsRequest.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.(req, metadata: @parent.("Resources.EnumerateTags", 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.matches.each do |plumbing_item| g.yield Plumbing::convert_tag_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one Resource by ID.
4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 |
# File 'lib/svc.rb', line 4807 def get( id, deadline: nil ) req = V1::ResourceGetRequest.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.("Resources.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 = ResourceGetResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource) resp end |
#healthcheck(id, deadline: nil) ⇒ Object
Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a large network of Nodes. The call will return immediately, and the updated health of the Resource can be retrieved via Get or List.
4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 |
# File 'lib/svc.rb', line 4941 def healthcheck( id, deadline: nil ) req = V1::ResourceHealthcheckRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.healthcheck(req, metadata: @parent.("Resources.Healthcheck", 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 = ResourceHealthcheckResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of Resources matching a given set of criteria.
4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 |
# File 'lib/svc.rb', line 4900 def list( filter, *args, deadline: nil ) req = V1::ResourceListRequest.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.("Resources.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.resources.each do |plumbing_item| g.yield Plumbing::convert_resource_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |
#update(resource, deadline: nil) ⇒ Object
Update replaces all the fields of a Resource by ID.
4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 |
# File 'lib/svc.rb', line 4841 def update( resource, deadline: nil ) req = V1::ResourceUpdateRequest.new() req.resource = Plumbing::convert_resource_to_plumbing(resource) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.update(req, metadata: @parent.("Resources.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 = ResourceUpdateResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource) resp end |