Class: Google::Cloud::Asset::V1::AssetService::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Asset::V1::AssetService::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/asset/v1/asset_service/client.rb
Overview
Client for the AssetService service.
Asset service definition.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#operations_client ⇒ ::Google::Cloud::Asset::V1::AssetService::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the AssetService Client class.
Instance Method Summary collapse
-
#analyze_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse
Analyzes IAM policies to answer which identities have what accesses on which resources.
-
#analyze_iam_policy_longrunning(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination.
-
#analyze_move(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::AnalyzeMoveResponse
Analyze moving a resource to a specified destination without kicking off the actual move.
-
#analyze_org_policies(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult>
Analyzes organization policies under a scope.
-
#analyze_org_policy_governed_assets(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset>
Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope.
-
#analyze_org_policy_governed_containers(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer>
Analyzes organization policies governed containers (projects, folders or organization) under a scope.
-
#batch_get_assets_history(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse
Batch gets the update history of assets that overlap a time window.
-
#batch_get_effective_iam_policies(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesResponse
Gets effective IAM policies for a batch of resources.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the AssetService Client instance.
-
#create_feed(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::Feed
Creates a feed in a parent project/folder/organization to listen to its asset updates.
-
#create_saved_query(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::SavedQuery
Creates a saved query in a parent project/folder/organization.
-
#delete_feed(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes an asset feed.
-
#delete_saved_query(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a saved query.
-
#export_assets(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Exports assets with time and resource types to a given Cloud Storage location/BigQuery table.
-
#get_feed(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::Feed
Gets details about an asset feed.
-
#get_saved_query(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::SavedQuery
Gets details about a saved query.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new AssetService client object.
-
#list_assets(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::Asset>
Lists assets with time and resource types and returns paged results in response.
-
#list_feeds(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::ListFeedsResponse
Lists all asset feeds in a parent project/folder/organization.
-
#list_saved_queries(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::SavedQuery>
Lists all saved queries in a parent project/folder/organization.
-
#query_assets(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::QueryAssetsResponse
Issue a job that queries assets using a SQL statement compatible with BigQuery SQL.
-
#search_all_iam_policies(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult>
Searches all IAM policies within the specified scope, such as a project, folder, or organization.
-
#search_all_resources(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>
Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_feed(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::Feed
Updates an asset feed configuration.
-
#update_saved_query(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Asset::V1::SavedQuery
Updates a saved query.
Methods included from Paths
#feed_path, #folder_path, #organization_path, #project_path, #saved_query_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new AssetService client object.
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 213 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/asset/v1/asset_service_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @asset_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Asset::V1::AssetService::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) end |
Instance Attribute Details
#operations_client ⇒ ::Google::Cloud::Asset::V1::AssetService::Operations (readonly)
Get the associated client for long-running operations.
265 266 267 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 265 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the AssetService Client class.
See Configuration for a description of the configuration fields.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 59 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Asset", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.export_assets.timeout = 60.0 default_config.rpcs.list_assets.timeout = 60.0 default_config.rpcs.list_assets.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.batch_get_assets_history.timeout = 60.0 default_config.rpcs.batch_get_assets_history.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.create_feed.timeout = 60.0 default_config.rpcs.get_feed.timeout = 60.0 default_config.rpcs.get_feed.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_feeds.timeout = 60.0 default_config.rpcs.list_feeds.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.update_feed.timeout = 60.0 default_config.rpcs.delete_feed.timeout = 60.0 default_config.rpcs.delete_feed.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.search_all_resources.timeout = 30.0 default_config.rpcs.search_all_resources.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.search_all_iam_policies.timeout = 30.0 default_config.rpcs.search_all_iam_policies.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.analyze_iam_policy.timeout = 300.0 default_config.rpcs.analyze_iam_policy.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.analyze_iam_policy_longrunning.timeout = 60.0 default_config.rpcs.query_assets.timeout = 200.0 default_config.rpcs.query_assets.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_saved_query.timeout = 60.0 default_config.rpcs.get_saved_query.timeout = 60.0 default_config.rpcs.get_saved_query.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_saved_queries.timeout = 60.0 default_config.rpcs.list_saved_queries.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.update_saved_query.timeout = 60.0 default_config.rpcs.delete_saved_query.timeout = 60.0 default_config.rpcs.delete_saved_query.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.batch_get_effective_iam_policies.timeout = 300.0 default_config.rpcs.batch_get_effective_iam_policies.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.analyze_org_policies.timeout = 60.0 default_config.rpcs.analyze_org_policies.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.analyze_org_policy_governed_containers.timeout = 60.0 default_config.rpcs.analyze_org_policy_governed_containers.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.analyze_org_policy_governed_assets.timeout = 60.0 default_config.rpcs.analyze_org_policy_governed_assets.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config end yield @configure if block_given? @configure end |
Instance Method Details
#analyze_iam_policy(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse #analyze_iam_policy(analysis_query: nil, saved_analysis_query: nil, execution_timeout: nil) ⇒ ::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse
Analyzes IAM policies to answer which identities have what accesses on which resources.
1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 1672 def analyze_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.analyze_iam_policy..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.analysis_query&.scope header_params["analysis_query.scope"] = request.analysis_query.scope end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.analyze_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.analyze_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :analyze_iam_policy, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#analyze_iam_policy_longrunning(request, options = nil) ⇒ ::Gapic::Operation #analyze_iam_policy_longrunning(analysis_query: nil, saved_analysis_query: nil, output_config: nil) ⇒ ::Gapic::Operation
Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a AnalyzeIamPolicyResponse. This method implements the google.longrunning.Operation, which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.
1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 1793 def analyze_iam_policy_longrunning request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeIamPolicyLongrunningRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.analyze_iam_policy_longrunning..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.analysis_query&.scope header_params["analysis_query.scope"] = request.analysis_query.scope end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.analyze_iam_policy_longrunning.timeout, metadata: , retry_policy: @config.rpcs.analyze_iam_policy_longrunning.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :analyze_iam_policy_longrunning, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#analyze_move(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::AnalyzeMoveResponse #analyze_move(resource: nil, destination_parent: nil, view: nil) ⇒ ::Google::Cloud::Asset::V1::AnalyzeMoveResponse
Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.
1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 1895 def analyze_move request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeMoveRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.analyze_move..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.analyze_move.timeout, metadata: , retry_policy: @config.rpcs.analyze_move.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :analyze_move, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#analyze_org_policies(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult> #analyze_org_policies(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult>
Analyzes organization policies under a scope.
2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2746 def analyze_org_policies request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.analyze_org_policies..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.scope header_params["scope"] = request.scope end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.analyze_org_policies.timeout, metadata: , retry_policy: @config.rpcs.analyze_org_policies.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :analyze_org_policies, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policies, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#analyze_org_policy_governed_assets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset> #analyze_org_policy_governed_assets(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset>
Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following canned constraints:
- constraints/ainotebooks.accessMode
- constraints/ainotebooks.disableFileDownloads
- constraints/ainotebooks.disableRootAccess
- constraints/ainotebooks.disableTerminal
- constraints/ainotebooks.environmentOptions
- constraints/ainotebooks.requireAutoUpgradeSchedule
- constraints/ainotebooks.restrictVpcNetworks
- constraints/compute.disableGuestAttributesAccess
- constraints/compute.disableInstanceDataAccessApis
- constraints/compute.disableNestedVirtualization
- constraints/compute.disableSerialPortAccess
- constraints/compute.disableSerialPortLogging
- constraints/compute.disableVpcExternalIpv6
- constraints/compute.requireOsLogin
- constraints/compute.requireShieldedVm
- constraints/compute.restrictLoadBalancerCreationForTypes
- constraints/compute.restrictProtocolForwardingCreationForTypes
- constraints/compute.restrictXpnProjectLienRemoval
- constraints/compute.setNewProjectDefaultToZonalDNSOnly
- constraints/compute.skipDefaultNetworkCreation
- constraints/compute.trustedImageProjects
- constraints/compute.vmCanIpForward
- constraints/compute.vmExternalIpAccess
- constraints/gcp.detailedAuditLoggingMode
- constraints/gcp.resourceLocations
- constraints/iam.allowedPolicyMemberDomains
- constraints/iam.automaticIamGrantsForDefaultServiceAccounts
- constraints/iam.disableServiceAccountCreation
- constraints/iam.disableServiceAccountKeyCreation
- constraints/iam.disableServiceAccountKeyUpload
- constraints/iam.restrictCrossProjectServiceAccountLienRemoval
- constraints/iam.serviceAccountKeyExpiryHours
- constraints/resourcemanager.accessBoundaries
- constraints/resourcemanager.allowedExportDestinations
- constraints/sql.restrictAuthorizedNetworks
- constraints/sql.restrictNoncompliantDiagnosticDataAccess
- constraints/sql.restrictNoncompliantResourceCreation
- constraints/sql.restrictPublicIp
- constraints/storage.publicAccessPrevention
- constraints/storage.restrictAuthTypes
- constraints/storage.uniformBucketLevelAccess
This RPC only returns either resources of types supported by search APIs or IAM policies.
3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 3045 def analyze_org_policy_governed_assets request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.analyze_org_policy_governed_assets..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.scope header_params["scope"] = request.scope end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.analyze_org_policy_governed_assets.timeout, metadata: , retry_policy: @config.rpcs.analyze_org_policy_governed_assets.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :analyze_org_policy_governed_assets, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_assets, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#analyze_org_policy_governed_containers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer> #analyze_org_policy_governed_containers(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer>
Analyzes organization policies governed containers (projects, folders or organization) under a scope.
2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2864 def analyze_org_policy_governed_containers request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.analyze_org_policy_governed_containers..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.scope header_params["scope"] = request.scope end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.analyze_org_policy_governed_containers.timeout, metadata: , retry_policy: @config.rpcs.analyze_org_policy_governed_containers.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :analyze_org_policy_governed_containers, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_containers, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#batch_get_assets_history(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse #batch_get_assets_history(parent: nil, asset_names: nil, content_type: nil, read_time_window: nil, relationship_types: nil) ⇒ ::Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse
Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 655 def batch_get_assets_history request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.batch_get_assets_history..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.batch_get_assets_history.timeout, metadata: , retry_policy: @config.rpcs.batch_get_assets_history.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :batch_get_assets_history, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#batch_get_effective_iam_policies(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesResponse #batch_get_effective_iam_policies(scope: nil, names: nil) ⇒ ::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesResponse
Gets effective IAM policies for a batch of resources.
2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2632 def batch_get_effective_iam_policies request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.batch_get_effective_iam_policies..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.scope header_params["scope"] = request.scope end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.batch_get_effective_iam_policies.timeout, metadata: , retry_policy: @config.rpcs.batch_get_effective_iam_policies.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :batch_get_effective_iam_policies, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the AssetService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
183 184 185 186 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 183 def configure yield @config if block_given? @config end |
#create_feed(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::Feed #create_feed(parent: nil, feed_id: nil, feed: nil) ⇒ ::Google::Cloud::Asset::V1::Feed
Creates a feed in a parent project/folder/organization to listen to its asset updates.
753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 753 def create_feed request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::CreateFeedRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_feed..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_feed.timeout, metadata: , retry_policy: @config.rpcs.create_feed.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :create_feed, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_saved_query(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::SavedQuery #create_saved_query(parent: nil, saved_query: nil, saved_query_id: nil) ⇒ ::Google::Cloud::Asset::V1::SavedQuery
Creates a saved query in a parent project/folder/organization.
2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2147 def create_saved_query request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::CreateSavedQueryRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_saved_query..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_saved_query.timeout, metadata: , retry_policy: @config.rpcs.create_saved_query.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :create_saved_query, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_feed(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_feed(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes an asset feed.
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 1109 def delete_feed request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::DeleteFeedRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_feed..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_feed.timeout, metadata: , retry_policy: @config.rpcs.delete_feed.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :delete_feed, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_saved_query(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_saved_query(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a saved query.
2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2531 def delete_saved_query request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::DeleteSavedQueryRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_saved_query..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_saved_query.timeout, metadata: , retry_policy: @config.rpcs.delete_saved_query.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :delete_saved_query, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#export_assets(request, options = nil) ⇒ ::Gapic::Operation #export_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, output_config: nil, relationship_types: nil) ⇒ ::Gapic::Operation
Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a google.cloud.asset.v1.Asset in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the google.longrunning.Operation API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 380 def export_assets request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ExportAssetsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.export_assets..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.export_assets.timeout, metadata: , retry_policy: @config.rpcs.export_assets.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :export_assets, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_feed(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::Feed #get_feed(name: nil) ⇒ ::Google::Cloud::Asset::V1::Feed
Gets details about an asset feed.
841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 841 def get_feed request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::GetFeedRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_feed..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_feed.timeout, metadata: , retry_policy: @config.rpcs.get_feed.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :get_feed, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_saved_query(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::SavedQuery #get_saved_query(name: nil) ⇒ ::Google::Cloud::Asset::V1::SavedQuery
Gets details about a saved query.
2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2236 def get_saved_query request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::GetSavedQueryRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_saved_query..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_saved_query.timeout, metadata: , retry_policy: @config.rpcs.get_saved_query.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :get_saved_query, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_assets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::Asset> #list_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, page_size: nil, page_token: nil, relationship_types: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::Asset>
Lists assets with time and resource types and returns paged results in response.
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 526 def list_assets request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ListAssetsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_assets..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_assets.timeout, metadata: , retry_policy: @config.rpcs.list_assets.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :list_assets, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @asset_service_stub, :list_assets, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_feeds(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::ListFeedsResponse #list_feeds(parent: nil) ⇒ ::Google::Cloud::Asset::V1::ListFeedsResponse
Lists all asset feeds in a parent project/folder/organization.
928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 928 def list_feeds request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ListFeedsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_feeds..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_feeds.timeout, metadata: , retry_policy: @config.rpcs.list_feeds.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :list_feeds, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_saved_queries(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::SavedQuery> #list_saved_queries(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::SavedQuery>
Lists all saved queries in a parent project/folder/organization.
2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2346 def list_saved_queries request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ListSavedQueriesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_saved_queries..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_saved_queries.timeout, metadata: , retry_policy: @config.rpcs.list_saved_queries.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :list_saved_queries, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @asset_service_stub, :list_saved_queries, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#query_assets(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::QueryAssetsResponse #query_assets(parent: nil, statement: nil, job_reference: nil, page_size: nil, page_token: nil, timeout: nil, read_time_window: nil, read_time: nil, output_config: nil) ⇒ ::Google::Cloud::Asset::V1::QueryAssetsResponse
Issue a job that queries assets using a SQL statement compatible with BigQuery SQL.
If the query execution finishes within timeout and there's no pagination,
the full query results will be returned in the QueryAssetsResponse
.
Otherwise, full query results can be obtained by issuing extra requests
with the job_reference
from the a previous QueryAssets
call.
Note, the query result has approximately 10 GB limitation enforced by BigQuery. Queries return larger results will result in errors.
2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2045 def query_assets request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::QueryAssetsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.query_assets..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.query_assets.timeout, metadata: , retry_policy: @config.rpcs.query_assets.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :query_assets, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#search_all_iam_policies(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult> #search_all_iam_policies(scope: nil, query: nil, page_size: nil, page_token: nil, asset_types: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult>
Searches all IAM policies within the specified scope, such as a project,
folder, or organization. The caller must be granted the
cloudasset.assets.searchAllIamPolicies
permission on the desired scope,
otherwise the request will be rejected.
1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 1556 def search_all_iam_policies request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.search_all_iam_policies..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.scope header_params["scope"] = request.scope end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.search_all_iam_policies.timeout, metadata: , retry_policy: @config.rpcs.search_all_iam_policies.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :search_all_iam_policies, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @asset_service_stub, :search_all_iam_policies, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#search_all_resources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult> #search_all_resources(scope: nil, query: nil, asset_types: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>
Searches all Google Cloud resources within the specified scope, such as a
project, folder, or organization. The caller must be granted the
cloudasset.assets.searchAllResources
permission on the desired scope,
otherwise the request will be rejected.
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 1369 def search_all_resources request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::SearchAllResourcesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.search_all_resources..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.scope header_params["scope"] = request.scope end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.search_all_resources.timeout, metadata: , retry_policy: @config.rpcs.search_all_resources.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :search_all_resources, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @asset_service_stub, :search_all_resources, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
193 194 195 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 193 def universe_domain @asset_service_stub.universe_domain end |
#update_feed(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::Feed #update_feed(feed: nil, update_mask: nil) ⇒ ::Google::Cloud::Asset::V1::Feed
Updates an asset feed configuration.
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 1021 def update_feed request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::UpdateFeedRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_feed..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.feed&.name header_params["feed.name"] = request.feed.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_feed.timeout, metadata: , retry_policy: @config.rpcs.update_feed.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :update_feed, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_saved_query(request, options = nil) ⇒ ::Google::Cloud::Asset::V1::SavedQuery #update_saved_query(saved_query: nil, update_mask: nil) ⇒ ::Google::Cloud::Asset::V1::SavedQuery
Updates a saved query.
2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 |
# File 'lib/google/cloud/asset/v1/asset_service/client.rb', line 2441 def update_saved_query request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::UpdateSavedQueryRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_saved_query..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Asset::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.saved_query&.name header_params["saved_query.name"] = request.saved_query.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_saved_query.timeout, metadata: , retry_policy: @config.rpcs.update_saved_query.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @asset_service_stub.call_rpc :update_saved_query, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |