Reference documentation and code samples for the Cloud Security Compliance V1 API class Google::Cloud::CloudSecurityCompliance::V1::Audit::Client.
Client for the Audit service.
Service describing handlers for resources
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Audit clients ::Google::Cloud::CloudSecurityCompliance::V1::Audit::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the Audit 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 Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_framework_audit
def create_framework_audit(request, options = nil) -> ::Gapic::Operation
def create_framework_audit(parent: nil, framework_audit_id: nil, framework_audit: nil) -> ::Gapic::OperationCreates an audit scope report for a framework.
def create_framework_audit(request, options = nil) -> ::Gapic::Operationcreate_framework_audit via a request object, either of type
CreateFrameworkAuditRequest or an equivalent Hash.
- request (::Google::Cloud::CloudSecurityCompliance::V1::CreateFrameworkAuditRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_framework_audit(parent: nil, framework_audit_id: nil, framework_audit: nil) -> ::Gapic::Operationcreate_framework_audit via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) —
Required. The parent resource where this framework audit is created.
Supported formats are the following:
organizations/{organization_id}/locations/{location}folders/{folder_id}/locations/{location}projects/{project_id}/locations/{location}
-
framework_audit_id (::String) — Optional. The ID to use for the framework audit. The ID becomes the final
component of the framework audit's full resource name.
The ID must be between 4-63 characters, and valid characters are
\[a-z][0-9]-\. - framework_audit (::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit, ::Hash) — Required. The framework audit to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/cloud_security_compliance/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::CloudSecurityCompliance::V1::Audit::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CloudSecurityCompliance::V1::CreateFrameworkAuditRequest.new # Call the create_framework_audit method. result = client.create_framework_audit request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#generate_framework_audit_scope_report
def generate_framework_audit_scope_report(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse
def generate_framework_audit_scope_report(scope: nil, report_format: nil, compliance_framework: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponseGenerates an audit scope report for a framework.
def generate_framework_audit_scope_report(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponsegenerate_framework_audit_scope_report via a request object, either of type
GenerateFrameworkAuditScopeReportRequest or an equivalent Hash.
- request (::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def generate_framework_audit_scope_report(scope: nil, report_format: nil, compliance_framework: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponsegenerate_framework_audit_scope_report via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
scope (::String) —
Required. The organization, folder or project for the audit report.
Supported formats are the following:
projects/{project_id}/locations/{location}folders/{folder_id}/locations/{location}organizations/{organization_id}/locations/{location}
- report_format (::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportRequest::Format) — Required. The format that the scope report bytes is returned in.
- compliance_framework (::String) — Required. The compliance framework that the scope report is generated for.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/cloud_security_compliance/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::CloudSecurityCompliance::V1::Audit::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportRequest.new # Call the generate_framework_audit_scope_report method. result = client.generate_framework_audit_scope_report request # The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse. p result
#get_framework_audit
def get_framework_audit(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit
def get_framework_audit(name: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAuditGets the details for a framework audit.
def get_framework_audit(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAuditget_framework_audit via a request object, either of type
GetFrameworkAuditRequest or an equivalent Hash.
- request (::Google::Cloud::CloudSecurityCompliance::V1::GetFrameworkAuditRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_framework_audit(name: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAuditget_framework_audit via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) —
Required. The name of the framework audit to retrieve.
Supported formats are the following:
organizations/{organization_id}/locations/{location}/frameworkAudits/{frameworkAuditName}folders/{folder_id}/locations/{location}/frameworkAudits/{frameworkAuditName}projects/{project_id}/locations/{location}/frameworkAudits/{frameworkAuditName}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/cloud_security_compliance/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::CloudSecurityCompliance::V1::Audit::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CloudSecurityCompliance::V1::GetFrameworkAuditRequest.new # Call the get_framework_audit method. result = client.get_framework_audit request # The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new Audit client object.
- (config) — Configure the Audit client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::CloudSecurityCompliance::V1::Audit::Client.new # Create a client using a custom configuration client = ::Google::Cloud::CloudSecurityCompliance::V1::Audit::Client.new do |config| config.timeout = 10.0 end
#list_framework_audits
def list_framework_audits(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>
def list_framework_audits(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>Lists the framework audits for a given organization, folder, or project.
def list_framework_audits(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>list_framework_audits via a request object, either of type
ListFrameworkAuditsRequest or an equivalent Hash.
- request (::Google::Cloud::CloudSecurityCompliance::V1::ListFrameworkAuditsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_framework_audits(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>list_framework_audits via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) —
Required. The parent resource where the framework audits are listed.
Supported formats are the following:
organizations/{organization_id}/locations/{location}folders/{folder_id}/locations/{location}projects/{project_id}/locations/{location}
- page_size (::Integer) — Optional. The maximum number of framework audits to return. The service might return fewer audits than this value. If unspecified, a maximum of 10 framework audits are returned. The maximum value is 50; values above 50 are limited to 50.
-
page_token (::String) — Optional. The
next_page_tokenvalue that's returned from a previous list request, if any. -
filter (::String) — Optional. The filters to apply to the framework audits.
Supported filters are
compliance_framework,compliance_state,create_time,andframework_audit_name. If the filter is invalid, an invalid argument error is returned. For syntax details, see [AIP-160][https://google.aip.dev/160].
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/cloud_security_compliance/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::CloudSecurityCompliance::V1::Audit::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CloudSecurityCompliance::V1::ListFrameworkAuditsRequest.new # Call the list_framework_audits method. result = client.list_framework_audits request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::CloudSecurityCompliance::V1::Audit::OperationsGet the associated client for long-running operations.
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)