Reference documentation and code samples for the Audit Manager V1 API class Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.
REST client for the AuditManager service.
Service describing handlers for resources
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the AuditManager Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all AuditManager clients ::Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the AuditManager 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)
#enroll_resource
def enroll_resource(request, options = nil) -> ::Google::Cloud::AuditManager::V1::Enrollment
def enroll_resource(scope: nil, destinations: nil) -> ::Google::Cloud::AuditManager::V1::EnrollmentEnrolls the customer resource(folder/project/organization) to the audit manager service by creating the audit managers Service Agent in customers workload and granting required permissions to the Service Agent. Please note that if enrollment request is made on the already enrolled workload then enrollment is executed overriding the existing set of destinations.
def enroll_resource(request, options = nil) -> ::Google::Cloud::AuditManager::V1::Enrollmentenroll_resource via a request object, either of type
EnrollResourceRequest or an equivalent Hash.
- request (::Google::Cloud::AuditManager::V1::EnrollResourceRequest, ::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 enroll_resource(scope: nil, destinations: nil) -> ::Google::Cloud::AuditManager::V1::Enrollmentenroll_resource 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 resource to be enrolled to the audit manager. Scope format should be resource_type/resource_identifier Eg: projects/{project}/locations/{location}, folders/{folder}/locations/{location} organizations/{organization}/locations/{location}
- destinations (::Array<::Google::Cloud::AuditManager::V1::EnrollResourceRequest::EligibleDestination, ::Hash>) — Required. List of destination among which customer can choose to upload their reports during the audit process. While enrolling at a organization/folder level, customer can choose Cloud storage bucket in any project. If the audit is triggered at project level using the service agent at organization/folder level, all the destination options associated with respective organization/folder level service agent will be available to auditing projects.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::AuditManager::V1::Enrollment)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/audit_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AuditManager::V1::EnrollResourceRequest.new # Call the enroll_resource method. result = client.enroll_resource request # The returned object is of type Google::Cloud::AuditManager::V1::Enrollment. p result
#generate_audit_report
def generate_audit_report(request, options = nil) -> ::Gapic::Operation
def generate_audit_report(gcs_uri: nil, scope: nil, compliance_standard: nil, report_format: nil, compliance_framework: nil) -> ::Gapic::OperationRegister the Audit Report generation requests and returns the OperationId using which the customer can track the report generation progress.
def generate_audit_report(request, options = nil) -> ::Gapic::Operationgenerate_audit_report via a request object, either of type
GenerateAuditReportRequest or an equivalent Hash.
- request (::Google::Cloud::AuditManager::V1::GenerateAuditReportRequest, ::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_audit_report(gcs_uri: nil, scope: nil, compliance_standard: nil, report_format: nil, compliance_framework: nil) -> ::Gapic::Operationgenerate_audit_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).
- gcs_uri (::String) — Destination Cloud storage bucket where report and evidence must be uploaded. The Cloud storage bucket provided here must be selected among the buckets entered during the enrollment process.
- scope (::String) — Required. Scope for which the AuditScopeReport is required. Must be of format resource_type/resource_identifier Eg: projects/{project}/locations/{location}, folders/{folder}/locations/{location}
- compliance_standard (::String) — Required. Compliance Standard against which the Scope Report must be generated. Eg: FEDRAMP_MODERATE
- report_format (::Google::Cloud::AuditManager::V1::GenerateAuditReportRequest::AuditReportFormat) — Required. The format in which the audit report should be created.
- compliance_framework (::String) — Required. Compliance framework against which the Report must be generated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/audit_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AuditManager::V1::GenerateAuditReportRequest.new # Call the generate_audit_report method. result = client.generate_audit_report 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_audit_scope_report
def generate_audit_scope_report(request, options = nil) -> ::Google::Cloud::AuditManager::V1::AuditScopeReport
def generate_audit_scope_report(scope: nil, compliance_standard: nil, report_format: nil, compliance_framework: nil) -> ::Google::Cloud::AuditManager::V1::AuditScopeReportGenerates a demo report highlighting different responsibilities (Google/Customer/ shared) required to be fulfilled for the customer's workload to be compliant with the given standard.
def generate_audit_scope_report(request, options = nil) -> ::Google::Cloud::AuditManager::V1::AuditScopeReportgenerate_audit_scope_report via a request object, either of type
GenerateAuditScopeReportRequest or an equivalent Hash.
- request (::Google::Cloud::AuditManager::V1::GenerateAuditScopeReportRequest, ::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_audit_scope_report(scope: nil, compliance_standard: nil, report_format: nil, compliance_framework: nil) -> ::Google::Cloud::AuditManager::V1::AuditScopeReportgenerate_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. Scope for which the AuditScopeReport is required. Must be of format resource_type/resource_identifier Eg: projects/{project}/locations/{location}, folders/{folder}/locations/{location}
- compliance_standard (::String) — Required. Compliance Standard against which the Scope Report must be generated. Eg: FEDRAMP_MODERATE
- report_format (::Google::Cloud::AuditManager::V1::GenerateAuditScopeReportRequest::AuditScopeReportFormat) — Required. The format in which the Scope report bytes should be returned.
- compliance_framework (::String) — Required. Compliance framework against which the Scope Report must be generated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::AuditManager::V1::AuditScopeReport)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/audit_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AuditManager::V1::GenerateAuditScopeReportRequest.new # Call the generate_audit_scope_report method. result = client.generate_audit_scope_report request # The returned object is of type Google::Cloud::AuditManager::V1::AuditScopeReport. p result
#get_audit_report
def get_audit_report(request, options = nil) -> ::Google::Cloud::AuditManager::V1::AuditReport
def get_audit_report(name: nil) -> ::Google::Cloud::AuditManager::V1::AuditReportGet the overall audit report
def get_audit_report(request, options = nil) -> ::Google::Cloud::AuditManager::V1::AuditReportget_audit_report via a request object, either of type
GetAuditReportRequest or an equivalent Hash.
- request (::Google::Cloud::AuditManager::V1::GetAuditReportRequest, ::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_audit_report(name: nil) -> ::Google::Cloud::AuditManager::V1::AuditReportget_audit_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).
- name (::String) — Required. Format projects/{project}/locations/{location}/auditReports/{audit_report}, folders/{folder}/locations/{location}/auditReports/{audit_report}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::AuditManager::V1::AuditReport)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/audit_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AuditManager::V1::GetAuditReportRequest.new # Call the get_audit_report method. result = client.get_audit_report request # The returned object is of type Google::Cloud::AuditManager::V1::AuditReport. p result
#get_resource_enrollment_status
def get_resource_enrollment_status(request, options = nil) -> ::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus
def get_resource_enrollment_status(name: nil) -> ::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatusGet a resource along with its enrollment status.
def get_resource_enrollment_status(request, options = nil) -> ::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatusget_resource_enrollment_status via a request object, either of type
GetResourceEnrollmentStatusRequest or an equivalent Hash.
- request (::Google::Cloud::AuditManager::V1::GetResourceEnrollmentStatusRequest, ::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_resource_enrollment_status(name: nil) -> ::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatusget_resource_enrollment_status 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. Format folders/{folder}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}, projects/{project}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}, organizations/{organization}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/audit_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AuditManager::V1::GetResourceEnrollmentStatusRequest.new # Call the get_resource_enrollment_status method. result = client.get_resource_enrollment_status request # The returned object is of type Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new AuditManager REST client object.
- (config) — Configure the AuditManager client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new do |config| config.timeout = 10.0 end
#list_audit_reports
def list_audit_reports(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::AuditReport>
def list_audit_reports(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::AuditReport>Lists audit reports in the selected parent scope
def list_audit_reports(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::AuditReport>list_audit_reports via a request object, either of type
ListAuditReportsRequest or an equivalent Hash.
- request (::Google::Cloud::AuditManager::V1::ListAuditReportsRequest, ::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_audit_reports(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::AuditReport>list_audit_reports 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 scope for which to list the reports.
- page_size (::Integer) — Optional. The maximum number of resources to return.
- page_token (::String) — Optional. The next_page_token value returned from a previous List request, if any.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::AuditReport>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::AuditReport>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/audit_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AuditManager::V1::ListAuditReportsRequest.new # Call the list_audit_reports method. result = client.list_audit_reports 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::AuditManager::V1::AuditReport. p item end
#list_controls
def list_controls(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::Control>
def list_controls(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::Control>Gets controls needed to be implemented to be compliant to a standard.
def list_controls(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::Control>list_controls via a request object, either of type
ListControlsRequest or an equivalent Hash.
- request (::Google::Cloud::AuditManager::V1::ListControlsRequest, ::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_controls(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::Control>list_controls 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. Format projects/{project}/locations/{location}/standards/{standard}, folders/{folder}/locations/{location}/standards/{standard}
- page_size (::Integer) — Optional. The maximum number of resources to return.
- page_token (::String) — Optional. The next_page_token value returned from a previous List request, if any.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::Control>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::Control>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/audit_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AuditManager::V1::ListControlsRequest.new # Call the list_controls method. result = client.list_controls 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::AuditManager::V1::Control. p item end
#list_resource_enrollment_statuses
def list_resource_enrollment_statuses(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus>
def list_resource_enrollment_statuses(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus>Fetches all resources under the parent along with their enrollment.
def list_resource_enrollment_statuses(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus>list_resource_enrollment_statuses via a request object, either of type
ListResourceEnrollmentStatusesRequest or an equivalent Hash.
- request (::Google::Cloud::AuditManager::V1::ListResourceEnrollmentStatusesRequest, ::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_resource_enrollment_statuses(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus>list_resource_enrollment_statuses 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 scope for which the list of resources with enrollments are required.
- page_size (::Integer) — Optional. The maximum number of resources to return.
- page_token (::String) — Optional. The next_page_token value returned from a previous List request, if any.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::AuditManager::V1::ResourceEnrollmentStatus>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/audit_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AuditManager::V1::AuditManager::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AuditManager::V1::ListResourceEnrollmentStatusesRequest.new # Call the list_resource_enrollment_statuses method. result = client.list_resource_enrollment_statuses 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::AuditManager::V1::ResourceEnrollmentStatus. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::AuditManager::V1::AuditManager::Rest::OperationsGet the associated client for long-running operations.
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)