Cloud Security Compliance V1 API - Class Google::Cloud::CloudSecurityCompliance::V1::Audit::Client (v0.2.0)

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

Configure the Audit Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# 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::Configuration

Configure 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#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::Operation

Creates an audit scope report for a framework.

Overloads
def create_framework_audit(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_framework_audit via a request object, either of type CreateFrameworkAuditRequest or an equivalent Hash.
Parameters
  • 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::Operation
Pass arguments to create_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).
Parameters
  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::GenerateFrameworkAuditScopeReportResponse

Generates an audit scope report for a framework.

Overloads
def generate_framework_audit_scope_report(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse
Pass arguments to generate_framework_audit_scope_report via a request object, either of type GenerateFrameworkAuditScopeReportRequest or an equivalent Hash.
Parameters
def generate_framework_audit_scope_report(scope: nil, report_format: nil, compliance_framework: nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportResponse
Pass arguments to generate_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).
Parameters
  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::FrameworkAudit

Gets the details for a framework audit.

Overloads
def get_framework_audit(request, options = nil) -> ::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit
Pass arguments to get_framework_audit via a request object, either of type GetFrameworkAuditRequest or an equivalent Hash.
Parameters
  • 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::FrameworkAudit
Pass arguments to get_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).
Parameter
  • 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}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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| ... } -> Client

Create a new Audit client object.

Yields
  • (config) — Configure the Audit client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# 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.

Overloads
def list_framework_audits(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::FrameworkAudit>
Pass arguments to list_framework_audits via a request object, either of type ListFrameworkAuditsRequest or an equivalent Hash.
Parameters
  • 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>
Pass arguments to 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).
Parameters
  • 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_token value 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, and framework_audit_name. If the filter is invalid, an invalid argument error is returned. For syntax details, see [AIP-160][https://google.aip.dev/160].
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::CloudSecurityCompliance::V1::Audit::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)